nodediscovery

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 36 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

This section is empty.

Types

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,
	c config,
) *NodeDiscovery

NewNodeDiscovery returns a pointer to new node discovery object

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.

Jump to

Keyboard shortcuts

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