nodediscovery

package
v1.20.0-pre.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 40 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"nodediscovery",
	"Communicate changes in local node information to the API server or KVStore",

	cell.Provide(NewNodeDiscovery),

	cell.Invoke(func(nd *NodeDiscovery, fence regeneration.Fence) {
		fence.Add("kvstore-nodes", nd.WaitForKVStoreSync)
	}),
	cell.Config(defaultConfig),
)

The node discovery cell provides the local node configuration and node discovery which communicate changes in local node information to the API server or KVStore.

Functions

func RegisterENIMutator

func RegisterENIMutator(fn ENIMutator)

RegisterENIMutator installs the function used to populate the ENI fields of a CiliumNode. It is called from pkg/nodediscovery/eni's init().

Types

type ENIMutateInputs

type ENIMutateInputs struct {
	FirstInterfaceIndex     int
	UsePrimaryAddress       bool
	DisablePrefixDelegation bool
	DeleteOnTermination     bool
	SubnetIDs               []string
	SubnetTags              map[string]string
	SecurityGroups          []string
	SecurityGroupTags       map[string]string
	ExcludeInterfaceTags    map[string]string
	IPAMMinAllocate         int
	IPAMPreAllocate         int
	IPAMMaxAllocate         int
	CNIConfigManager        cni.CNIConfigManager
}

ENIMutateInputs carries the agent configuration needed to populate the ENI-specific fields of a CiliumNode resource. It deliberately uses only plain Go types (no AWS SDK types) so that this file does not pull in any AWS dependency. The actual mutator implementation, registered from pkg/nodediscovery/eni, is what links against the AWS SDK and the EC2 IMDS client.

type ENIMutator

type ENIMutator func(ctx context.Context, in ENIMutateInputs, nodeResource *ciliumv2.CiliumNode) error

ENIMutator populates the ENI-specific fields of nodeResource. It is registered from pkg/nodediscovery/eni's init() so that the AWS SDK and EC2 IMDS client are only linked into binaries that import that package (notably cilium-agent), keeping them out of cilium-operator-generic.

type GetNodeAddresses

type GetNodeAddresses interface {
	GetNodeAddresses() []nodeTypes.Address
}

type NodeDiscovery

type NodeDiscovery struct {
	// contains filtered or unexported fields
}

NodeDiscovery represents a node discovery action

func NewNodeDiscovery

func NewNodeDiscovery(
	logger *slog.Logger,
	manager nodemanager.NodeManager,
	clientset client.Clientset,
	kvstoreClient kvstore.Client,
	lns *node.LocalNodeStore,
	cniConfigManager cni.CNIConfigManager,
	k8sNodeWatcher *watchers.K8sCiliumNodeWatcher,
	daemonConfig *option.DaemonConfig,
	c config,
) *NodeDiscovery

NewNodeDiscovery returns a pointer to new node discovery object

func (*NodeDiscovery) AnnotateK8sNode

func (n *NodeDiscovery) AnnotateK8sNode(ctx context.Context)

func (*NodeDiscovery) StartDiscovery

func (n *NodeDiscovery) StartDiscovery(ctx context.Context)

start configures the local node and starts node discovery. This is called on agent startup to configure the local node based on the configuration options passed to the agent. nodeName is the name to be used in the local agent.

NOTE: StartDiscovery is manually called from newDaemon after the Wireguard and IPSec cells have been initialized, as they modify the local node. This requires the daemon to always hold references to both cells to ensure they're started first. Keep this behavior in mind when modifying this function, its cell, or the daemon.

func (*NodeDiscovery) UpdateCiliumNodeResource

func (n *NodeDiscovery) UpdateCiliumNodeResource()

UpdateCiliumNodeResource updates the CiliumNode resource representing the local node. This function can be safely executed only before starting the discovery logic through StartDiscovery(), as otherwise possibly racing against concurrent updates triggered by the LocalNodeStore observer.

func (*NodeDiscovery) WaitForKVStoreSync added in v1.16.4

func (n *NodeDiscovery) WaitForKVStoreSync(ctx context.Context) error

WaitForKVStoreSync blocks until kvstore synchronization of node information completed. It returns immediately in CRD mode.

Directories

Path Synopsis
Package eni wires the ENI-specific CiliumNode mutator (using the EC2 IMDS client and the AWS SDK helpers) into pkg/nodediscovery.
Package eni wires the ENI-specific CiliumNode mutator (using the EC2 IMDS client and the AWS SDK helpers) into pkg/nodediscovery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL