operator

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: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Cell is the cell for the Operator ClusterMesh

View Source
var (
	// ErrObserverNotRegistered is the error returned when referencing an observer
	// which has not been registered.
	ErrObserverNotRegistered = errors.New("observer not registered")
)

Functions

func NewServiceExportsObserver added in v1.17.0

func NewServiceExportsObserver(
	cache *GlobalServiceExportCache, onUpdate, onDelete func(*mcsapitypes.MCSAPIServiceSpec),
) store.Observer

NewServiceExportsObserver returns an observer implementing the logic to convert and filter export notifications, update the global service export cache and call the upstream handlers when appropriate.

Types

type ClusterMesh

type ClusterMesh interface {
	// RegisterClusterAddHook register a hook when a cluster is added to the mesh.
	// This should NOT be called after the Start hook.
	RegisterClusterAddHook(clusterAddHook func(string))
	// RegisterClusterDeleteHook register a hook when a cluster is removed from the mesh.
	// This should NOT be called after the Start hook.
	RegisterClusterDeleteHook(clusterDeleteHook func(string))
	// RegisterClusterServiceUpdateHook register a hook when a service in the mesh is updated.
	// This should NOT be called after the Start hook.
	RegisterClusterServiceUpdateHook(clusterServiceUpdateHook func(*serviceStore.ClusterService))
	// RegisterClusterServiceDeleteHook register a hook when a service in the mesh is deleted.
	// This should NOT be called after the Start hook.
	RegisterClusterServiceDeleteHook(clusterServiceDeleteHook func(*serviceStore.ClusterService))
	// RegisterClusterServiceExportUpdateHook register a hook when a service export in the mesh is updated.
	// This should NOT be called after the Start hook.
	RegisterClusterServiceExportUpdateHook(clusterServiceExportUpdateHook func(*mcsapitypes.MCSAPIServiceSpec))
	// RegisterClusterServiceExportDeleteHook register a hook when a service export in the mesh is deleted.
	// This should NOT be called after the Start hook.
	RegisterClusterServiceExportDeleteHook(clusterServiceExportDeleteHook func(*mcsapitypes.MCSAPIServiceSpec))

	ServicesSynced(ctx context.Context) error
	GlobalServices() *common.GlobalServiceCache

	ServiceExportsSynced(ctx context.Context) error
	GlobalServiceExports() *GlobalServiceExportCache

	ObserverSynced(ctx context.Context, name observer.Name) error
}

ClusterMesh is the interface corresponding to the clusterMesh struct to expose its public methods to other Cilium packages.

type ClusterMeshConfig

type ClusterMeshConfig struct {
	// ClusterMeshEnableEndpointSync enables the EndpointSlice Cluster Mesh synchronization
	ClusterMeshEnableEndpointSync bool `mapstructure:"clustermesh-enable-endpoint-sync"`
}

ClusterMeshConfig contains the configuration for ClusterMesh inside the operator.

func (ClusterMeshConfig) Flags

func (cfg ClusterMeshConfig) Flags(flags *pflag.FlagSet)

Flags adds the flags used by ClientConfig.

type GlobalServiceExportCache added in v1.17.0

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

func NewGlobalServiceExportCache added in v1.17.0

func NewGlobalServiceExportCache() *GlobalServiceExportCache

func (*GlobalServiceExportCache) GetServiceExportByCluster added in v1.17.0

func (c *GlobalServiceExportCache) GetServiceExportByCluster(serviceExportNN types.NamespacedName) ServiceExportsByCluster

GetServiceExportByCluster returns a shallow copy of the GlobalServiceExport object, thus the MCSAPIServiceSpec objects should not be mutated.

func (*GlobalServiceExportCache) GetServiceExportsName added in v1.17.0

func (c *GlobalServiceExportCache) GetServiceExportsName(namespace string) []string

GetServiceExportsName returns all the service exports for a specific namespace that have at least one service export in one of the remote cluster in the mesh.

func (*GlobalServiceExportCache) OnDelete added in v1.17.0

func (*GlobalServiceExportCache) OnUpdate added in v1.17.0

func (c *GlobalServiceExportCache) OnUpdate(svcExport *mcsapitypes.MCSAPIServiceSpec)

func (*GlobalServiceExportCache) Size added in v1.17.0

func (c *GlobalServiceExportCache) Size() uint64

type Metrics

type Metrics struct {
	// TotalServices tracks the number of total global services per remote cluster.
	TotalServices metric.Vec[metric.Gauge]
	// TotalServiceExports tracks the number of total MCS-API service exports per remote cluster.
	TotalServiceExports metric.Vec[metric.Gauge]
}

func NewMetrics

func NewMetrics() Metrics

type ServiceExportsByCluster added in v1.17.0

type ServiceExportsByCluster map[string]*mcsapitypes.MCSAPIServiceSpec

type ServiceExportsByName added in v1.17.0

type ServiceExportsByName map[string]ServiceExportsByCluster

type ServiceExportsByNamespace added in v1.17.0

type ServiceExportsByNamespace map[string]ServiceExportsByName

Jump to

Keyboard shortcuts

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