manager

package
v1.21.0-pre.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 36 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// ClusterNodeTableInitializerName is completed once the initial listing of
	// nodes in the local cluster has been received.
	ClusterNodeTableInitializerName = "node-manager-cluster"
	// MeshNodeTableInitializerName is completed once the initial listing of
	// nodes in remote clusters has been received.
	MeshNodeTableInitializerName = "node-manager-mesh"
)

Variables

View Source
var Cell = cell.Module(
	"node-manager",
	"Manages the collection of Cilium nodes",
	cell.Provide(newAllNodeManager),
	cell.Provide(newNodeConfigNotifier),
	metrics.Metric(NewNodeMetrics),
)

Cell provides the NodeManager, which manages information about Cilium nodes in the cluster and informs other modules of changes to node configuration.

Functions

func New

func New(
	logger *slog.Logger,
	c *option.DaemonConfig,
	clusterInfo cmtypes.ClusterInfo,
	tunnelConf tunnel.Config,
	ipCache IPCache,
	nodeMetrics *nodeMetrics,
	health cell.Health,
	jobGroup job.Group,
	db *statedb.DB,
	devices statedb.Table[*tables.Device],
	wgCfg types.Config,
	writer *node.Writer,
	clusterSizeDependantInterval node.ClusterSizeDependantIntervalFunc,
) (*manager, error)

New returns a new node manager

func NewNodeMetrics

func NewNodeMetrics() *nodeMetrics

Types

type IPCache

type IPCache interface {
	GetMetadataSourceByPrefix(prefix cmtypes.PrefixCluster) source.Source
	UpsertMetadata(prefix cmtypes.PrefixCluster, src source.Source, resource ipcacheTypes.ResourceID, aux ...ipcache.IPMetadata)
	RemoveMetadata(prefix cmtypes.PrefixCluster, resource ipcacheTypes.ResourceID, aux ...ipcache.IPMetadata)
	UpsertMetadataBatch(updates ...ipcache.MU) (revision uint64)
	RemoveMetadataBatch(updates ...ipcache.MU) (revision uint64)
}

IPCache is the set of interactions the node manager performs with the ipcache

type NodeConfigNotifier added in v1.18.0

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

NodeConfigNotifier is used to notify subscribers about changes in the local node configuration. Handlers must be subscribed during hive construction, before the lifecycle starts.

func (*NodeConfigNotifier) Notify added in v1.18.0

func (n *NodeConfigNotifier) Notify(nodeConfig config.Config) error

func (*NodeConfigNotifier) Subscribe added in v1.18.0

func (n *NodeConfigNotifier) Subscribe(handler config.ChangeHandler)

type NodeManager

type NodeManager interface {
	Notifier

	// GetNodes returns a copy of all the nodes as a map from Identity to Node.
	GetNodes() map[types.Identity]types.Node

	// GetNodeIdentities returns a list of all node identities store in node
	// manager.
	GetNodeIdentities() []types.Identity

	// NodeUpdated is called when the store detects a change in node
	// information
	NodeUpdated(n types.Node)

	// NodeDeleted is called when the store detects a deletion of a node
	NodeDeleted(n types.Node)

	// NodeSync is called when the store completes the initial nodes listing
	NodeSync()
	// MeshNodeSync is called when the store completes the initial nodes listing including meshed nodes
	MeshNodeSync()

	// SetPrefixClusterMutatorFn allows to inject a custom prefix cluster mutator.
	// The mutator may then be applied to the PrefixCluster(s) using cmtypes.PrefixClusterFrom.
	SetPrefixClusterMutatorFn(mutator node.PrefixClusterMutatorFn)
}

type Notifier

type Notifier interface {
	// Subscribe adds the given NodeHandler to the list of subscribers that are
	// notified of node changes. Upon call to this method, the NodeHandler is
	// being notified of all nodes that are already in the cluster by calling
	// the NodeHandler's NodeAdd callback.
	Subscribe(node.Handler)

	// Unsubscribe removes the given NodeHandler from the list of subscribers.
	Unsubscribe(node.Handler)
}

Notifier is the interface the wraps Subscribe and Unsubscribe. An implementation of this interface notifies subscribers of nodes being added, updated or deleted.

Jump to

Keyboard shortcuts

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