iptables

package
v0.0.0-...-1fbe32e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesFromRules

func BytesFromRules(rules map[string]*RuleSet) []byte

func GetSaveLines

func GetSaveLines(table util.Table, save []byte) (map[string]*RuleSet, error)

GetSaveLines parses the iptables-save as a string and puts it into a map[string]*kubeRules Modifications were made from the Kube codebase to support iptables save/restore

func NewMetrics

func NewMetrics(lbKind, configKey string) *metrics

func ReadLine

func ReadLine(readIndex int, byteArray []byte) (string, int)

Types

type IPTables

type IPTables interface {
	Save() (map[string]*RuleSet, error)
	Restore(map[string]*RuleSet) error
	Flush() error

	GenerateRules(config *types.ClusterConfig) (rules map[string]*RuleSet, err error)
	GenerateRulesForNode(node types.Node, config *types.ClusterConfig, useWeightedService bool) (map[string]*RuleSet, error)
	Merge(subset, wholeset map[string]*RuleSet) (rules map[string]*RuleSet, removals int, err error)

	BaseChain() string
}

func NewIPTables

func NewIPTables(ctx context.Context, lbKind, configKey, podCidrMasq, chain string, masq bool, logger logrus.FieldLogger) (IPTables, error)

type RuleSet

type RuleSet struct {
	ChainRule string   //    :KUBE-SVC-ZEHG7HT725H2KQF7 - [0:0]
	Rules     []string // -A PREROUTING -m comment --comment "kubernetes service portals" -j KUBE-SERVICES
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL