Documentation ¶
Overview ¶
Package node provides functionality related to the local and remote node addresses
Index ¶
- func AutoComplete() error
- func GetEndpointHealthIPv4() net.IP
- func GetEndpointHealthIPv6() net.IP
- func GetEndpointID() uint64
- func GetExcludedIPs() []net.IP
- func GetHostMasqueradeIPv4() net.IP
- func GetHostMasqueradeIPv6() net.IP
- func GetIPsecKeyIdentity() uint8
- func GetIPv4() net.IP
- func GetIPv4AllocRange() *cidr.CIDR
- func GetIPv4Loopback() net.IP
- func GetIPv6() net.IP
- func GetIPv6AllocRange() *cidr.CIDR
- func GetIPv6Router() net.IP
- func GetInternalIPv4Router() net.IP
- func GetK8sExternalIPv4() net.IP
- func GetK8sExternalIPv6() net.IP
- func GetK8sNodeIP() net.IP
- func GetLabels() map[string]string
- func GetMasqIPv4AddrsWithDevices() map[string]net.IP
- func GetNodeAddressing() *models.NodeAddressing
- func GetNodePortIPv4Addrs() []net.IP
- func GetNodePortIPv4AddrsWithDevices() map[string]net.IP
- func GetNodePortIPv6Addrs() []net.IP
- func GetNodePortIPv6AddrsWithDevices() map[string]net.IP
- func GetWireguardPubKey() string
- func InitBPFMasqueradeAddrs(devices []string) error
- func InitDefaultPrefix(device string)
- func InitNodePortAddrs(devices []string, inheritIPAddrFromDevice string) error
- func RestoreHostIPs(ipv6 bool, fromK8s, fromFS net.IP, cidrs []*cidr.CIDR) net.IP
- func SetEndpointHealthIPv4(ip net.IP)
- func SetEndpointHealthIPv6(ip net.IP)
- func SetEndpointID(id uint64)
- func SetIPsecKeyIdentity(id uint8)
- func SetIPv4(ip net.IP)
- func SetIPv4AllocRange(net *cidr.CIDR)
- func SetIPv4Loopback(ip net.IP)
- func SetIPv6(ip net.IP)
- func SetIPv6NodeRange(net *cidr.CIDR)
- func SetIPv6Router(ip net.IP)
- func SetInternalIPv4Router(ip net.IP)
- func SetK8sExternalIPv4(ip net.IP)
- func SetK8sExternalIPv6(ip net.IP)
- func SetK8sNodeIP(ip net.IP)
- func SetLabels(l map[string]string)
- func SetRouterInfo(info RouterInfo)
- func SetWireguardPubKey(key string)
- func Uninitialize()
- func ValidatePostInit() error
- type RouterInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoComplete ¶
func AutoComplete() error
AutoComplete completes the parts of addressing that can be auto derived
func GetEndpointHealthIPv4 ¶
GetEndpointHealthIPv4 returns the IPv4 cilium-health endpoint address.
func GetEndpointHealthIPv6 ¶
GetEndpointHealthIPv6 returns the IPv6 cilium-health endpoint address.
func GetEndpointID ¶
func GetEndpointID() uint64
GetEndpointID returns the ID of the host endpoint for this node.
func GetExcludedIPs ¶
GetExcludedIPs returns a list of IPs from netdevices that Cilium needs to exclude to operate
func GetHostMasqueradeIPv4 ¶
GetHostMasqueradeIPv4 returns the IPv4 address to be used for masquerading any traffic that is being forwarded from the host into the Cilium cluster.
func GetHostMasqueradeIPv6 ¶
GetHostMasqueradeIPv6 returns the IPv6 address to be used for masquerading any traffic that is being forwarded from the host into the Cilium cluster.
func GetIPsecKeyIdentity ¶
func GetIPsecKeyIdentity() uint8
GetIPsecKeyIdentity returns the IPsec key identity of the node
func GetIPv4 ¶
GetIPv4 returns one of the IPv4 node address available with the following priority: - NodeInternalIP - NodeExternalIP - other IP address type. It must be reachable on the network.
func GetIPv4AllocRange ¶
GetIPv4AllocRange returns the IPv4 allocation prefix of this node
func GetIPv4Loopback ¶
GetIPv4Loopback returns the loopback IPv4 address of this node.
func GetIPv6AllocRange ¶
GetIPv6AllocRange returns the IPv6 allocation prefix of this node
func GetInternalIPv4Router ¶
GetInternalIPv4Router returns the cilium internal IPv4 node address. This must not be conflated with k8s internal IP as this IP address is only relevant within the Cilium-managed network (this means within the node for direct routing mode and on the overlay for tunnel mode).
func GetK8sExternalIPv4 ¶
GetK8sExternalIPv4 returns the external IPv4 node address. It must be a public IP that is routable on the network as well as the internet. It can return nil if no External IPv4 address is assigned.
func GetK8sExternalIPv6 ¶
GetK8sExternalIPv6 returns the external IPv6 node address.
func GetMasqIPv4AddrsWithDevices ¶
GetMasqIPv4AddrsWithDevices returns the map iface => BPF masquerade IPv4.
func GetNodeAddressing ¶
func GetNodeAddressing() *models.NodeAddressing
GetNodeAddressing returns the NodeAddressing model for the local IPs.
func GetNodePortIPv4Addrs ¶
GetNodePortIPv4Addrs returns the node-port IPv4 address for NAT
func GetNodePortIPv4AddrsWithDevices ¶
GetNodePortIPv4AddrsWithDevices returns the map iface => NodePort IPv4.
func GetNodePortIPv6Addrs ¶
GetNodePortIPv6Addrs returns the node-port IPv6 address for NAT
func GetNodePortIPv6AddrsWithDevices ¶
GetNodePortIPv6AddrsWithDevices returns the map iface => NodePort IPv6.
func GetWireguardPubKey ¶
func GetWireguardPubKey() string
func InitBPFMasqueradeAddrs ¶
InitBPFMasqueradeAddrs initializes BPF masquerade addrs for the given devices.
func InitDefaultPrefix ¶
func InitDefaultPrefix(device string)
InitDefaultPrefix initializes the node address and allocation prefixes with default values derived from the system. device can be set to the primary network device of the system in which case the first address with global scope will be regarded as the system's node address.
func InitNodePortAddrs ¶
InitNodePortAddrs initializes NodePort IPv{4,6} addrs for the given devices. If inheritIPAddrFromDevice is non-empty, then the IP addr for the devices will be derived from it.
func RestoreHostIPs ¶
RestoreHostIPs restores the router IPs (`cilium_host`) from a previous Cilium run. Router IPs from the filesystem are preferred over the IPs found in the Kubernetes resource (Node or CiliumNode), because we consider the filesystem to be the most up-to-date source of truth. The chosen router IP is then checked whether it is contained inside node CIDR (pod CIDR) range. If not, then the router IP is discarded and not restored.
The restored IP is returned.
func SetEndpointHealthIPv4 ¶
SetEndpointHealthIPv4 sets the IPv6 cilium-health endpoint address.
func SetEndpointHealthIPv6 ¶
SetEndpointHealthIPv6 sets the IPv6 cilium-health endpoint address.
func SetEndpointID ¶
func SetEndpointID(id uint64)
SetEndpointID sets the ID of the host endpoint this node.
func SetIPsecKeyIdentity ¶
func SetIPsecKeyIdentity(id uint8)
SetIPsecKeyIdentity sets the IPsec key identity an opaque value used to identity encryption keys used on the node.
func SetIPv4 ¶
SetIPv4 sets the IPv4 node address. It must be reachable on the network. It is set based on the following priority: - NodeInternalIP - NodeExternalIP - other IP address type
func SetIPv4AllocRange ¶
SetIPv4AllocRange sets the IPv4 address pool to use when allocating addresses for local endpoints
func SetIPv4Loopback ¶
SetIPv4Loopback sets the loopback IPv4 address of this node.
func SetIPv6NodeRange ¶
SetIPv6NodeRange sets the IPv6 address pool to be used on this node
func SetIPv6Router ¶
SetIPv6Router returns the IPv6 address of the node
func SetInternalIPv4Router ¶
SetInternalIPv4Router sets the cilium internal IPv4 node address, it is allocated from the node prefix. This must not be conflated with k8s internal IP as this IP address is only relevant within the Cilium-managed network (this means within the node for direct routing mode and on the overlay for tunnel mode).
func SetK8sExternalIPv4 ¶
SetK8sExternalIPv4 sets the external IPv4 node address. It must be a public IP that is routable on the network as well as the internet.
func SetK8sExternalIPv6 ¶
SetK8sExternalIPv6 sets the external IPv6 node address. It must be a public IP.
func SetRouterInfo ¶
func SetRouterInfo(info RouterInfo)
SetRouterInfo sets additional information for the router, the cilium_host interface.
func SetWireguardPubKey ¶
func SetWireguardPubKey(key string)
func Uninitialize ¶
func Uninitialize()
Uninitialize resets this package to the default state, for use in testsuite code.
func ValidatePostInit ¶
func ValidatePostInit() error
ValidatePostInit validates the entire addressing setup and completes it as required
Types ¶
type RouterInfo ¶
func GetRouterInfo ¶
func GetRouterInfo() RouterInfo
GetRouterInfo returns additional information for the router, the cilium_host interface.