system

package
v0.0.0-...-606a1df Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntGetenv

func IntGetenv(envName string, defaultValue int) int

Types

type Comp

type Comp struct {
	// contains filtered or unexported fields
}

type IP

type IP struct {
	IPCommandPath string // the path to the 'ip' binary
	// contains filtered or unexported fields
}

IP defines a wrapper on the ip command, which can be used to interface with the ip binary

func NewIP

func NewIP(ctx context.Context, device string, gateway string, announce, ignore int, logger log.FieldLogger) (*IP, error)

NewIP creates a new ipManager struct for manging ip binary operations

func (*IP) Add

func (i *IP) Add(addr string) error

func (*IP) Add6

func (i *IP) Add6(addr string) error

func (*IP) AdvertiseMacAddress

func (i *IP) AdvertiseMacAddress(addr string) error

AdvertiseMacAddress does a gratuitous ARP a specific VIP on a specific interface. Exec's the command: arping -c 1 -s $VIP_IP $gateway_ip -I $interface That's going to ask for the MAC address of $gateway_ip, sending the Who-has ARP packet out of $interface. The intent is to get the $gateway_ip to associate $interface's MAC (ethernet) address with the VIP. The Who-has ARP packet tricks the gateway into putting $interface's MAC address in its own ARP table with the VIP as the associated IP address.

func (*IP) Compare

func (i *IP) Compare(configured []string, desired []string, v6 bool) ([]string, []string)

pass in an array of v4 or

func (*IP) Compare4

func (i *IP) Compare4(configured, desired []string) ([]string, []string)

func (*IP) Compare6

func (i *IP) Compare6(configured, desired []string) ([]string, []string)

func (*IP) Del

func (i *IP) Del(device string) error

func (*IP) Device

func (i *IP) Device(addr string, isV6 bool) string

func (*IP) Get

func (i *IP) Get() ([]string, []string, error)

func (*IP) SetARP

func (i *IP) SetARP() error

func (*IP) SetMTU

func (i *IP) SetMTU(config map[types.ServiceIP]string, isIP6 bool) error

func (*IP) SetRPFilter

func (i *IP) SetRPFilter() error

func (*IP) Teardown

func (i *IP) Teardown(ctx context.Context, config4 map[types.ServiceIP]types.PortMap, config6 map[types.ServiceIP]types.PortMap) error

type IPVS

type IPVS struct {
	// contains filtered or unexported fields
}

func NewIPVS

func NewIPVS(ctx context.Context, primaryIP string, weightOverride bool, ignoreCordon bool, logger log.FieldLogger, ravelMode string) (*IPVS, error)

NewIPVS creates a new IPVS struct which manages ipvsadm

func (*IPVS) CheckConfigParity

func (i *IPVS) CheckConfigParity(w *watcher.Watcher, config *types.ClusterConfig, addresses []string) (bool, error)

returns an error if the configurations generated from d.Nodes and d.ConfigMap are different than the configurations that are applied in IPVS. This enables for nodes and configmaps to be stored declaratively, and for configuration to be reconciled outside of a typical event loop. addresses passed in as param here must be the set of v4 and v6 addresses

func (*IPVS) Get

func (i *IPVS) Get() ([]string, error)

getConfiguredIPVS returns the output of `ipvsadm -Sn` That IPVS command returns a list of director VIP addresses sorted in lexicographic order by address:port, with backends sorted by realserver address:port.

func (*IPVS) GetV6

func (i *IPVS) GetV6() ([]string, error)

getConfiguredIPVS returns the output of `ipvsadm -Sn` That IPVS command returns a list of director VIP addresses sorted in lexicographic order by address:port, with backends sorted by realserver address:port. GetV6 filters only ipv6 rules. Sadly there is no native ipvsadm command to filter this

func (*IPVS) Set

func (i *IPVS) Set(rules []string) ([]byte, error)

func (*IPVS) SetIPVS

func (i *IPVS) SetIPVS(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger, ipType string) error

func (*IPVS) SetIPVS6_NU

func (i *IPVS) SetIPVS6_NU(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger) error

func (*IPVS) SetIPVSEarlyLate

func (i *IPVS) SetIPVSEarlyLate(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger, ipType string) error

SetIPVSEarlyLate - generate 2 sets of rules (early, late) to allow more time for the node workers.

func (*IPVS) SetIPVSRules

func (i *IPVS) SetIPVSRules(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger, ipType string) error

generate one set of rules

func (*IPVS) Teardown

func (i *IPVS) Teardown(ctx context.Context) error

func (*IPVS) WaitAWhile

func (i *IPVS) WaitAWhile()

type IRule

type IRule struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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