cilium: github.com/cilium/cilium/pkg/node/types Index | Files

package types

import "github.com/cilium/cilium/pkg/node/types"

Index

Package Files

logfields.go node.go nodename.go zz_generated.deepcopy.go

func GetKeyNodeName Uses

func GetKeyNodeName(cluster, node string) string

GetKeyNodeName constructs the API name for the given cluster and node name.

func GetName Uses

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 Uses

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.

type Address Uses

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) DeepCopy Uses

func (in *Address) DeepCopy() *Address

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Address.

func (*Address) DeepCopyInto Uses

func (in *Address) DeepCopyInto(out *Address)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Identity Uses

type Identity struct {
    Name    string
    Cluster string
}

Identity represents the node identity of a node.

func (Identity) String Uses

func (nn Identity) String() string

String returns the string representation on NodeIdentity.

type Node Uses

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

    // IPv6AllocCIDR if set, is the IPv6 address pool out of which the node
    // allocates IPs for local endpoints from
    IPv6AllocCIDR *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

    // ClusterID is the unique identifier of the cluster
    ClusterID int

    // 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 contains the nodes name, the list of addresses to this address

+k8s:deepcopy-gen=true

func ParseCiliumNode Uses

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 Uses

func (in *Node) DeepCopy() *Node

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.

func (*Node) DeepCopyInto Uses

func (in *Node) DeepCopyInto(out *Node)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Node) DeepKeyCopy Uses

func (n *Node) DeepKeyCopy() store.LocalKey

DeepKeyCopy creates a deep copy of the LocalKey

func (*Node) Fullname Uses

func (n *Node) Fullname() string

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 Uses

func (n *Node) GetCiliumInternalIP(ipv6 bool) net.IP

GetCiliumInternalIP returns the CiliumInternalIP e.g. the IP associated with cilium_host on the node.

func (*Node) GetK8sNodeIP Uses

func (n *Node) GetK8sNodeIP() net.IP

GetK8sNodeIPs returns k8s Node IP (either InternalIP or ExternalIP or nil; the former is prefered).

func (*Node) GetKeyName Uses

func (n *Node) GetKeyName() string

GetKeyName returns the kvstore key to be used for the node

func (*Node) GetModel Uses

func (n *Node) GetModel() *models.NodeElement

GetModel returns the API model representation of a node.

func (*Node) GetNodeIP Uses

func (n *Node) GetNodeIP(ipv6 bool) net.IP

GetNodeIP returns one of the node's IP addresses available with the following priority: - NodeInternalIP - NodeExternalIP - other IP address type

func (*Node) Identity Uses

func (n *Node) Identity() Identity

Identity returns the identity of the node

func (*Node) IsLocal Uses

func (n *Node) IsLocal() bool

IsLocal returns true if this is the node on which the agent itself is running on

func (*Node) Marshal Uses

func (n *Node) Marshal() ([]byte, error)

Marshal returns the node object as JSON byte slice

func (*Node) ToCiliumNode Uses

func (n *Node) ToCiliumNode() *ciliumv2.CiliumNode

ToCiliumNode converts the node to a CiliumNode

func (*Node) Unmarshal Uses

func (n *Node) Unmarshal(data []byte) error

Unmarshal parses the JSON byte slice and updates the node receiver

Package types imports 17 packages (graph) and is imported by 10 packages. Updated 2020-07-03. Refresh now. Tools for package owners.