manager

package
v1.16.0-pre.3 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 35 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cell = cell.Module(
	"node-manager",
	"Manages the collection of Cilium nodes",
	cell.Provide(newAllNodeManager),
	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(c *option.DaemonConfig, ipCache IPCache, ipsetMgr ipset.Manager, ipsetFilter IPSetFilterFn, nodeMetrics *nodeMetrics, health cell.Health) (*manager, error)

New returns a new node manager

func NewNodeMetrics

func NewNodeMetrics() *nodeMetrics

Types

type IPCache

type IPCache interface {
	GetMetadataSourceByPrefix(prefix netip.Prefix) source.Source
	UpsertMetadata(prefix netip.Prefix, src source.Source, resource ipcacheTypes.ResourceID, aux ...ipcache.IPMetadata)
	OverrideIdentity(prefix netip.Prefix, identityLabels labels.Labels, src source.Source, resource ipcacheTypes.ResourceID)
	RemoveMetadata(prefix netip.Prefix, resource ipcacheTypes.ResourceID, aux ...ipcache.IPMetadata)
	RemoveIdentityOverride(prefix netip.Prefix, identityLabels labels.Labels, resource ipcacheTypes.ResourceID)
}

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

type IPSetFilterFn added in v1.16.0

type IPSetFilterFn func(*nodeTypes.Node) bool

IPSetFilterFn is a function allowing to optionally filter out the insertion of IPSet entries based on node characteristics. The insertion is performed if the function returns false, and skipped otherwise.

type NodeManager

type NodeManager interface {
	datapath.NodeNeighborEnqueuer

	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()

	// ClusterSizeDependantInterval returns a time.Duration that is dependent on
	// the cluster size, i.e. the number of nodes that have been discovered. This
	// can be used to control sync intervals of shared or centralized resources to
	// avoid overloading these resources as the cluster grows.
	ClusterSizeDependantInterval(baseInterval time.Duration) time.Duration

	// StartNeighborRefresh spawns a controller which refreshes neighbor table
	// by sending arping periodically.
	StartNeighborRefresh(nh datapath.NodeNeighbors)

	// StartNodeNeighborLinkUpdater spawns a controller that watches a queue
	// for node neighbor link updates.
	StartNodeNeighborLinkUpdater(nh datapath.NodeNeighbors)
}

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(datapath.NodeHandler)

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

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