Documentation ¶
Index ¶
- func Addresses(n *v1.Node) []string
- func IPV4(n *v1.Node) string
- func IPV6(n *v1.Node) string
- func IsEligibleBackend(n *v1.Node, labels map[string]string, ip string, ignoreCordon bool, v6 bool, ...) (bool, string)
- func IsEligibleBackendV4(n *v1.Node, labels map[string]string, ip string, ignoreCordon bool, ...) (bool, string)
- func IsEligibleBackendV6(n *v1.Node, labels map[string]string, ip string, ignoreCordon bool, ...) (bool, string)
- func IsInReadyState(n *v1.Node) bool
- func IsUnschedulable(n *v1.Node) bool
- func MakeIdent(namespace, service, portName string) string
- func NodeEqual(a, b *v1.Node) bool
- func NodesEqual(a []*v1.Node, b []*v1.Node) bool
- type ClusterConfig
- type IPVSOptions
- type KubeRules
- type PortMap
- type RulesSet
- type ServiceDef
- type ServiceIP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEligibleBackend ¶
func IsEligibleBackendV4 ¶
func IsEligibleBackendV6 ¶
func IsInReadyState ¶
func IsUnschedulable ¶
Types ¶
type ClusterConfig ¶
type ClusterConfig struct { sync.RWMutex VIPPool []string `json:"vipPool"` MTUConfig map[ServiceIP]string `json:"mtuConfig"` MTUConfig6 map[ServiceIP]string `json:"mtuConfig6"` NodeLabels map[string]string `json:"labels"` IPV6 map[ServiceIP]string `json:"ipv6"` Config map[ServiceIP]PortMap `json:"config"` Config6 map[ServiceIP]PortMap `json:"config6"` }
ClusterConfig is a representation of an input configuration for this iptables management utility.
Configuration must support the following use cases: - multiple namespaces - multiple VIPs - multiple namespaces per VIP - redundant definitions for the same service (i.e. rio/manifest-agent on 1.2.3.4:8765 and 1.2.3.5:80)
i.e. sharing a single VIP across a pile of namespaces and services, all with different (but unique for the VIP) input ports
func NewClusterConfig ¶
func NewClusterConfig(config *v1.ConfigMap, configKey string) (*ClusterConfig, error)
func (*ClusterConfig) Validate ¶
func (c *ClusterConfig) Validate() error
type IPVSOptions ¶
type IPVSOptions struct { // RawUThreshold is the upper bound beyond which (active+inactive) connections are no longer // permitted. RawUThreshold int `json:"uThreshold"` // RawLThreshold is the lower bound below which active conncections must fall before // new connections are accepted. RawLThreshold int `json:"lThreshold"` // can be either 'g' or 'i', indicating DSR or TUN mode. // -g RawForwardingMethod string `json:"forwardingMethod"` // Scheduler is the way that connections are load balanced to the realservers. defaults to 'wrr' // -s wrr RawScheduler string `json:"scheduler"` // Flags are optional args for a new virtual server // if flags: -b <flag-1>,<flag-2>,... (default empty) Flags string `json:"flags"` }
IPVSOptions contains per-service options for the IPVS configuration. http://kb.linuxvirtualserver.org/wiki/Ipvsadm
func (*IPVSOptions) ForwardingMethod ¶
func (i *IPVSOptions) ForwardingMethod() string
ForwardingMethod outupts the forwarding method
func (*IPVSOptions) LThreshold ¶
func (i *IPVSOptions) LThreshold() int
RawLThreshold outputs the lower threshold
func (*IPVSOptions) Scheduler ¶
func (i *IPVSOptions) Scheduler() string
Scheduler returns a scheduler
func (*IPVSOptions) UThreshold ¶
func (i *IPVSOptions) UThreshold() int
UThreshold outputs the upper threshold
type KubeRules ¶
KubeRules contains two sets of iptables rules for insertion or management, one of MASQ instructions, and one of JUMP instructions. There is a 1:1 correspondance between masq and jump rules in iptables.
This structure is used in order to ensure that the rules are always paired together. In particular, the compareAndPrune and compareAndCreate functions always manage generated rules together. This ensures that the rules are represented in the correct order inside of iptables.
type PortMap ¶
type PortMap map[string]*ServiceDef
PortMap stores a mapping of ports to service definitions.
type ServiceDef ¶
type ServiceDef struct { Namespace string `json:"namespace"` Service string `json:"service"` PortName string `json:"portName"` // Here, the ServiceDef also defines x,y connection limits for IPVS, as well // as any other per-LB options IPVSOptions IPVSOptions `json:"ipvsOptions"` IPV4Enabled bool `json:"ipv4Enabled"` IPV6Enabled bool `json:"ipv6Enabled"` TCPEnabled bool `json:"tcpEnabled"` UDPEnabled bool `json:"udpEnabled"` ProxyProtocolEnabled bool `json:"proxyProtocolEnabled"` }
ServiceDef stores a Namespace/Service mapping for input from the user, and stores ancillary data collected from iptables about the configuration of that service.
func NewServiceDef ¶
func NewServiceDef(s string) (*ServiceDef, error)
NewServiceDef accepts a kubernetes-formatted "namespace/service:port" identifier and outputs a populated ServiceDef