Documentation ¶
Index ¶
- func IntGetenv(envName string, defaultValue int) int
- type Comp
- type IP
- func (i *IP) Add(addr string) error
- func (i *IP) Add6(addr string) error
- func (i *IP) AdvertiseMacAddress(addr string) error
- func (i *IP) Compare(configured []string, desired []string, v6 bool) ([]string, []string)
- func (i *IP) Compare4(configured, desired []string) ([]string, []string)
- func (i *IP) Compare6(configured, desired []string) ([]string, []string)
- func (i *IP) Del(device string) error
- func (i *IP) Device(addr string, isV6 bool) string
- func (i *IP) Get() ([]string, []string, error)
- func (i *IP) SetARP() error
- func (i *IP) SetMTU(config map[types.ServiceIP]string, isIP6 bool) error
- func (i *IP) SetRPFilter() error
- func (i *IP) Teardown(ctx context.Context, config4 map[types.ServiceIP]types.PortMap, ...) error
- type IPVS
- func (i *IPVS) CheckConfigParity(w *watcher.Watcher, config *types.ClusterConfig, addresses []string) (bool, error)
- func (i *IPVS) Get() ([]string, error)
- func (i *IPVS) GetV6() ([]string, error)
- func (i *IPVS) Set(rules []string) ([]byte, error)
- func (i *IPVS) SetIPVS(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger, ...) error
- func (i *IPVS) SetIPVS6_NU(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger) error
- func (i *IPVS) SetIPVSEarlyLate(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger, ...) error
- func (i *IPVS) SetIPVSRules(w *watcher.Watcher, config *types.ClusterConfig, logger log.FieldLogger, ...) error
- func (i *IPVS) Teardown(ctx context.Context) error
- func (i *IPVS) WaitAWhile()
- type IRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
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) AdvertiseMacAddress ¶
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) SetRPFilter ¶
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 ¶
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 ¶
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) 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) WaitAWhile ¶
func (i *IPVS) WaitAWhile()