Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Cell = cell.Module( "clustermesh", "Cell providing clustermesh capabilities in the operator", cell.Config(ClusterMeshConfig{}), cell.Config(mcsapitypes.DefaultMCSAPIConfig), cell.Config(types.DefaultServiceModeV2Config), cell.Invoke(types.ServiceModeV2Config.Validate), cell.Provide( common.DefaultRemoteClientFactory, newClusterMesh, newAPIClustersHandler, ), cell.ProvidePrivate(common.NewClusterIDsManager), cell.Config(common.DefaultConfig), cell.Config(wait.TimeoutConfigDefault), metrics.Metric(NewMetrics), metrics.Metric(common.MetricsProvider(metrics.SubsystemClusterMesh)), metrics.Metric(cmendpointslice.MetricsProvider(metrics.CiliumOperatorNamespace)), cmendpointslice.Cell, )
Cell is the cell for the Operator ClusterMesh
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 ¶
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 ¶
func (s *RemoteObjectSource[T]) Start( ctx context.Context, queue workqueue.TypedRateLimitingInterface[ctrl.Request], ) error