Documentation ¶
Index ¶
- func GetAbsoluteNodeName() string
- func GetClusterName() string
- func GetKeyNodeName(cluster, node string) string
- func GetName() string
- func SetName(name string)
- type Address
- type Identity
- type Node
- func (in *Node) DeepCopy() *Node
- func (in *Node) DeepCopyInto(out *Node)
- func (n *Node) DeepKeyCopy() store.LocalKey
- func (n *Node) Fullname() string
- func (n *Node) GetCiliumInternalIP(ipv6 bool) net.IP
- func (n *Node) GetExternalIP(ipv6 bool) net.IP
- func (n *Node) GetIPByType(addrType addressing.AddressType, ipv6 bool) net.IP
- func (n *Node) GetIPv4AllocCIDRs() []*cidr.CIDR
- func (n *Node) GetIPv6AllocCIDRs() []*cidr.CIDR
- func (n *Node) GetK8sNodeIP() net.IP
- func (n *Node) GetKeyName() string
- func (n *Node) GetModel() *models.NodeElement
- func (n *Node) GetNodeIP(ipv6 bool) net.IP
- func (n *Node) GetNodeInternalIPv4() net.IP
- func (n *Node) GetNodeInternalIPv6() net.IP
- func (n *Node) Identity() Identity
- func (n *Node) IsLocal() bool
- func (n *Node) LogRepr() string
- func (n *Node) Marshal() ([]byte, error)
- func (n *Node) RemoveAddresses(typ addressing.AddressType)
- func (n *Node) SetCiliumInternalIP(newAddr net.IP)
- func (n *Node) SetNodeExternalIP(newAddr net.IP)
- func (n *Node) SetNodeInternalIP(newAddr net.IP)
- func (n *Node) ToCiliumNode() *ciliumv2.CiliumNode
- func (n *Node) Unmarshal(_ string, data []byte) error
- type RegisterNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAbsoluteNodeName ¶
func GetAbsoluteNodeName() string
GetAbsoluteNodeName returns the absolute node name combined of both (prefixed)cluster name and the local node name in case of clustered environments otherwise returns the name of the local node.
func GetClusterName ¶
func GetClusterName() string
func GetKeyNodeName ¶
GetKeyNodeName constructs the API name for the given cluster and node name.
func GetName ¶
func GetName() string
GetName returns the name of the local node. The value returned was either previously set with SetName(), retrieved via `os.Hostname()`, or as a last resort is hardcoded to "localhost".
func SetName ¶
func SetName(name string)
SetName sets the name of the local node. This will overwrite the value that is automatically retrieved with `os.Hostname()`.
Note: This function is currently designed to only be called during the bootstrapping procedure of the agent where no parallelism exists. If you want to use this function in later stages, a mutex must be added first.
Types ¶
type Address ¶
type Address struct { Type addressing.AddressType IP net.IP }
Address is a node address which contains an IP and the address type.
+k8s:deepcopy-gen=true
func (Address) AddrType ¶ added in v1.15.0
func (a Address) AddrType() addressing.AddressType
func (*Address) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Address.
func (*Address) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Node ¶
type Node struct { // Name is the name of the node. This is typically the hostname of the node. Name string // Cluster is the name of the cluster the node is associated with Cluster string IPAddresses []Address // IPv4AllocCIDR if set, is the IPv4 address pool out of which the node // allocates IPs for local endpoints from IPv4AllocCIDR *cidr.CIDR // IPv4SecondaryAllocCIDRs contains additional IPv4 CIDRs from which this //node allocates IPs for its local endpoints from IPv4SecondaryAllocCIDRs []*cidr.CIDR // IPv6AllocCIDR if set, is the IPv6 address pool out of which the node // allocates IPs for local endpoints from IPv6AllocCIDR *cidr.CIDR // IPv6SecondaryAllocCIDRs contains additional IPv6 CIDRs from which this // node allocates IPs for its local endpoints from IPv6SecondaryAllocCIDRs []*cidr.CIDR // IPv4HealthIP if not nil, this is the IPv4 address of the // cilium-health endpoint located on the node. IPv4HealthIP net.IP // IPv6HealthIP if not nil, this is the IPv6 address of the // cilium-health endpoint located on the node. IPv6HealthIP net.IP // IPv4IngressIP if not nil, this is the IPv4 address of the // Ingress listener on the node. IPv4IngressIP net.IP // IPv6IngressIP if not nil, this is the IPv6 address of the // Ingress listener located on the node. IPv6IngressIP net.IP // ClusterID is the unique identifier of the cluster ClusterID uint32 // Source is the source where the node configuration was generated / created. Source source.Source // Key index used for transparent encryption or 0 for no encryption EncryptionKey uint8 // Node labels Labels map[string]string // Node annotations Annotations map[string]string // NodeIdentity is the numeric identity allocated for the node NodeIdentity uint32 // WireguardPubKey is the WireGuard public key of this node WireguardPubKey string // BootID is a unique node identifier generated on boot BootID string }
Node contains the nodes name, the list of addresses to this address
+k8s:deepcopy-gen=true
func ParseCiliumNode ¶
func ParseCiliumNode(n *ciliumv2.CiliumNode) (node Node)
ParseCiliumNode parses a CiliumNode custom resource and returns a Node instance. Invalid IP and CIDRs are silently ignored
func (*Node) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.
func (*Node) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Node) DeepKeyCopy ¶
DeepKeyCopy creates a deep copy of the LocalKey
func (*Node) Fullname ¶
Fullname returns the node's full name including the cluster name if a cluster name value other than the default value has been specified
func (*Node) GetCiliumInternalIP ¶
GetCiliumInternalIP returns the CiliumInternalIP e.g. the IP associated with cilium_host on the node.
func (*Node) GetExternalIP ¶
GetExternalIP returns ExternalIP of k8s Node. If not present, then it returns nil;
func (*Node) GetIPByType ¶
func (n *Node) GetIPByType(addrType addressing.AddressType, ipv6 bool) net.IP
func (*Node) GetIPv4AllocCIDRs ¶
func (*Node) GetIPv6AllocCIDRs ¶
func (*Node) GetK8sNodeIP ¶
GetK8sNodeIPs returns k8s Node IP (either InternalIP or ExternalIP or nil; the former is preferred).
func (*Node) GetKeyName ¶
GetKeyName returns the kvstore key to be used for the node
func (*Node) GetModel ¶
func (n *Node) GetModel() *models.NodeElement
GetModel returns the API model representation of a node.
func (*Node) GetNodeIP ¶
GetNodeIP returns one of the node's IP addresses available with the following priority: - NodeInternalIP - NodeExternalIP - other IP address type Nil is returned if GetNodeIP fails to extract an IP from the Node based on the provided address family.
func (*Node) GetNodeInternalIPv4 ¶
GetNodeInternalIP returns the Internal IPv4 of node or nil.
func (*Node) GetNodeInternalIPv6 ¶
GetNodeInternalIP returns the Internal IPv6 of node or nil.
func (*Node) IsLocal ¶
IsLocal returns true if this is the node on which the agent itself is running on
func (*Node) LogRepr ¶ added in v1.12.18
LogRepr returns a representation of the node to be used for logging
func (*Node) RemoveAddresses ¶
func (n *Node) RemoveAddresses(typ addressing.AddressType)
func (*Node) SetCiliumInternalIP ¶
SetCiliumInternalIP sets the CiliumInternalIP e.g. the IP associated with cilium_host on the node.
func (*Node) SetNodeExternalIP ¶
SetNodeExternalIP sets the NodeExternalIP.
func (*Node) SetNodeInternalIP ¶
SetNodeInternalIP sets the NodeInternalIP.
func (*Node) ToCiliumNode ¶
func (n *Node) ToCiliumNode() *ciliumv2.CiliumNode
ToCiliumNode converts the node to a CiliumNode
type RegisterNode ¶
type RegisterNode struct {
Node
}
RegisterNode overloads GetKeyName to ignore the cluster name, as cluster name may not be stable during node registration.
+k8s:deepcopy-gen=true
func (*RegisterNode) DeepCopy ¶
func (in *RegisterNode) DeepCopy() *RegisterNode
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegisterNode.
func (*RegisterNode) DeepCopyInto ¶
func (in *RegisterNode) DeepCopyInto(out *RegisterNode)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RegisterNode) DeepKeyCopy ¶
func (n *RegisterNode) DeepKeyCopy() store.LocalKey
DeepKeyCopy creates a deep copy of the LocalKey
func (*RegisterNode) GetKeyName ¶
func (n *RegisterNode) GetKeyName() string
GetKeyName Overloaded key name w/o cluster name