operator

package
v1.21.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 35 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 NewEnqueueRequestForNamespacedNameFunc

func NewEnqueueRequestForNamespacedNameFunc[T NamespacedNamed]() handler.TypedEventHandler[T, ctrl.Request]

NewEnqueueRequestForNamespacedNameFunc returns a simple handler that enqueues a reconcile request with the object namespaced name.

Types

type CacheStore

type CacheStore[T store.NamedKey] struct {
	// contains filtered or unexported fields
}

func NewCacheStore

func NewCacheStore[T store.NamedKey](indexers cache.Indexers) *CacheStore[T]

NewCacheStore creates an indexer for clustermesh objects. The API was simplified to not return errors since we provide a key function that cannot return an error. This means that from the underlying methods only ByIndex could return an error when providing an unknown index.

func (*CacheStore[T]) Delete

func (s *CacheStore[T]) Delete(obj T)

func (*CacheStore[T]) Get

func (s *CacheStore[T]) Get(obj T) (item T, exists bool)

func (*CacheStore[T]) GetByKey

func (s *CacheStore[T]) GetByKey(key string) (item T, exists bool)

func (*CacheStore[T]) MustByIndex

func (s *CacheStore[T]) MustByIndex(indexName, indexedValue string) []T

func (*CacheStore[T]) Update

func (s *CacheStore[T]) Update(obj T)

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

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

	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 Metrics

type Metrics struct {
	// TotalServices tracks the number of total global services per remote cluster.
	TotalServices metric.Vec[metric.Gauge]
}

func NewMetrics

func NewMetrics() Metrics

type NamespacedNamed

type NamespacedNamed interface {
	NamespacedName() types.NamespacedName
}

type RemoteObjectSource

type RemoteObjectSource[T any] struct {
	// contains filtered or unexported fields
}

RemoteObjectSource bridges remote clustermesh object events into controller-runtime reconcile requests.

func NewRemoteObjectSource

func NewRemoteObjectSource[T any](
	handler handler.TypedEventHandler[T, ctrl.Request],
) *RemoteObjectSource[T]

NewRemoteObjectSource creates a controller-runtime source for remote clustermesh object events.

func (*RemoteObjectSource[T]) OnEvent

func (s *RemoteObjectSource[T]) OnEvent(obj T)

func (*RemoteObjectSource[T]) Start

Jump to

Keyboard shortcuts

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