# Functions
Append appends rule to chain at the end of buffer.
AppendUnique ensures that rule is in chain only once in the buffer and that the occurrence is at the end of the buffer.
CloseCloserDisregardError it is a common need throughout kube-router's code base to need close a closer in defer statements, this allows an action like that to pass a linter as well as describe its intention well.
ClusterIPIsNone checks to see whether the ClusterIP contains "None" which would indicate that it is headless.
ClusterIPIsNoneOrBlank checks to see whether the ClusterIP contains "None" or is blank.
CommonICMPRules returns a list of common ICMP rules that should always be allowed for given IP family.
ContainsIPv4Address checks a given string array to see if it contains a valid IPv4 address within it.
ContainsIPv6Address checks a given string array to see if it contains a valid IPv6 address within it.
GetNodeObject returns the node API object for the node.
GetNodeSubnet returns the subnet and interface name for a given node IP.
GetPodCidrFromNodeSpec reads the pod CIDR allocated to the node from API node object and returns it.
GetPodCIDRsFromNodeSpecDualStack reads the IPv4 and IPv6 pod CIDR allocated to the node from API node object and returns them.
GetSysctl gets a sysctl value.
GetSysctlSingleTemplate gets a sysctl value by first formatting the PathTemplate parameter with the substitute string and then getting the sysctl value and converting it into a string.
IPSetName returns the proper set name for this component based upon whether or not it is an IPv6 set.
No description provided by the author
No description provided by the author
NewIPSet create a new IPSet with ipSetPath initialized.
NewIPTablesSaveRestore returns an IPTablesSaveRestore with apparopriate commands based on ipFamily (IPv4 or IPv6).
NewKRNode creates a new KRNode object from a Kubernetes Node Object.
NewRemoteKRNode creates a new KRNode object from a Kubernetes Node Object.
PartialJSONMarshal allows a struct that implements the rawMapAble interface to be fully restored without having to know about every possible field that may exist within the JSON.
PartialJSONUnmarshal allows a struct that implements the rawMapAble interface to be partially unmarshaled.
RouteTableAdd adds a new named table to iproute's rt_tables configuration file.
SaveInto calls `iptables-save` for given table and stores result in a given buffer.
ServiceForEndpoints given Endpoint object return Service API object if it exists.
ServiceForEndpoints given EndpointSlice object return Service API object if it exists.
ServiceHasNoClusterIP decides whether or not the this service is a headless service which is often useful to kube-router as there is no need to execute logic on most headless changes.
ServiceNameforEndpointSlice returns the name of the service that created the EndpointSlice for a given EndpointSlice
With endpoints, the name of the endpoint object always matches the service object, however when it comes to EndpointSlices, things work a bit different as k8s' controller will autogenerated it (something like: foo-kl29b)
We can get service information from a number of spots: * From the ownerReferences in the metadata EndpointSlice -> metadata -> ownerReferences[0] -> name * We can also get this from the label: kubernetes.io/service-name * generateName will also contain the prefix for the autogenerated name which should align with our service name
We'll all through all of these and do our best to identify the service's name, if we aren't able to find any of these or they disagree with each other we'll throw an error.
SetSysctl sets a sysctl value.
SetSysctlSingleTemplate sets a sysctl value by first formatting the PathTemplate parameter with the substitute string and then setting the sysctl to the value parameter.
SliceContainsString checks to see if needle is contained within haystack, returns true if found, otherwise returns false.
TCPAddressBindable checks to see if an IP/port is bindable by attempting to open a listener then closing it returns nil if successful.
# Constants
No description provided by the author
Network Routes Configuration Paths.
DefaultHasSize Defaul OptionHashSize value.
DefaultMaxElem Default OptionMaxElem value.
FamillyInet IPV4.
FamillyInet6 IPV6.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Template Configuration Paths.
No description provided by the author
From what I can see there are no IPv6 equivalents for the below options, so we only consider IPv6 here Network Services Configuration Paths.
No description provided by the author
No description provided by the author
No description provided by the author
IPv6SetPrefix is the prefix that ipset requires on IPv6 ipsets in order to distinguish them from IPv4 sets.
OptionBytes All set types support the optional counters option when creating a set.
OptionComment All set types support the optional comment extension.
OptionCounters All set types support the optional counters option when creating a set.
OptionFamilly This parameter is valid for the create command of all hash type sets except for hash:mac.
OptionForceAdd All hash set types support the optional forceadd parameter when creating a set.
OptionHashSize This parameter is valid for the create command of all hash type sets.
OptionMaxElem This parameter is valid for the create command of all hash type sets.
OptionNoMatch The hash set types which can store net type of data (i.e.
OptionPackets All set types support the optional counters option when creating a set.
OptionSkbinfo All set types support the optional skbinfo extension.
OptionSkbmark All set types support the optional skbinfo extension.
OptionSkbprio All set types support the optional skbinfo extension.
OptionSkbqueue All set types support the optional skbinfo extension.
OptionTimeout All set types supports the optional timeout parameter when creating a set and adding entries.
TypeHashIP The hash:ip set type uses a hash to store IP host addresses (default) or network addresses.
TypeHashIPMark The hash:ip,mark set type uses a hash to store IP address and packet mark pairs.
TypeHashIPNetPortNet The hash:net,port,net set type behaves similarly to hash:ip,port,net but accepts a cidr value for both the first and last parameter.
TypeHashIPPort The hash:ip,port set type uses a hash to store IP address and port number pairs.
TypeHashIPPortIP The hash:ip,port,ip set type uses a hash to store IP address, port number and a second IP address triples.
TypeHashIPPortNet The hash:ip,port,net set type uses a hash to store IP address, port number and IP network address triples.
TypeHashMac The hash:mac set type uses a hash to store MAC addresses.
TypeHashNet The hash:net set type uses a hash to store different sized IP network addresses.
TypeHashNetIface The hash:net,iface set type uses a hash to store different sized IP network address and interface name pairs.
TypeHashNetNet The hash:net,net set type uses a hash to store pairs of different sized IP network addresses.
TypeHashNetPort The hash:net,port set type uses a hash to store different sized IP network address and port pairs.
TypeListSet The list:set type uses a simple list in which you can store set names.
# Structs
Broadcaster holds the details of registered listeners.
Conf represents the individual CNI configuration that may exist on its own, or be part of a ConfList.
ConfList represents a list of CNI configurations.
Entry of ipset Set.
No description provided by the author
No description provided by the author
IPAM represents the ipam specific configuration that may exist on a given CNI configuration / plugin.
IPSet represent ipset sets managed by.
IPTablesSaveRestore struct stores shell commands to save and restore iptables state.
KRNode is a struct that holds information about a node that is used by kube-router.
LocalKRNode is a struct that holds information about this kube-router node.
No description provided by the author
Range represents an IP range that may exist within a range set (hence the double array above).
Set represent a ipset set entry.
No description provided by the author
# Interfaces
No description provided by the author
IPTablesHandler interface based on the IPTables struct from github.com/coreos/go-iptables which allows to mock it.
IPTablesSaveRestorer interface that defines functions to save and restore tables.
No description provided by the author
No description provided by the author
NodeAware is an interface that combines the NodeIPAware, NodeInterfaceAware, NodeFamilyAware, and NodeNameAware interfaces.
NodeFamilyAware is an interface that provides methods to check if a node is IPv4 or IPv6 capable.
NodeInterfaceAware is an interface that provides methods to get the node's interface name, MTU, and subnet.
NodeIPAndFamilyAware is an interface that combines the NodeIPAware and NodeFamilyAware interfaces.
NodeIPAware is an interface that provides methods to get the node's IP addresses in various data structures.
NodeNameAware is an interface that provides a method to get the node's name.
# Type aliases
No description provided by the author