ClusterUnregistered is issued when this ClusterWatcher is shut down.
type ClusterUnregistered struct{}
func (cgu ClusterUnregistered) String() string
OnAddCalled is issued when the onAdd function of the shared informer is called
type OnAddCalled struct {
// contains filtered or unexported fields
}
func (oa OnAddCalled) String() string
OnAddEndpointsCalled is issued when the onAdd function of the Endpoints shared informer is called
type OnAddEndpointsCalled struct {
// contains filtered or unexported fields
}
OnDeleteCalled is issued when the onDelete function of the shared informer is called
type OnDeleteCalled struct {
// contains filtered or unexported fields
}
func (od OnDeleteCalled) String() string
OnLocalNamespaceAdded is issued when when a new namespace is added to the local cluster. This means that we should check the remote cluster for exported service in that namespace.
type OnLocalNamespaceAdded struct {
// contains filtered or unexported fields
}
func (ol OnLocalNamespaceAdded) String() string
OnUpdateCalled is issued when the onUpdate function of the shared informer is called
type OnUpdateCalled struct {
// contains filtered or unexported fields
}
func (ou OnUpdateCalled) String() string
OnUpdateEndpointsCalled is issued when the onUpdate function of the shared Endpoints informer is called
type OnUpdateEndpointsCalled struct {
// contains filtered or unexported fields
}
OrphanedServicesGcTriggered is a self-triggered event which aims to delete any orphaned services that are no longer on the remote cluster. It is emitted every time a new remote cluster is registered for monitoring. The need for this arises because the following might happen.
1. A cluster is registered for monitoring 2. Services A,B,C are created and mirrored 3. Then this component crashes, leaving the mirrors around 4. In the meantime services B and C are deleted on the remote cluster 5. When the controller starts up again it registers to listen for mirrored services 6. It receives an ADD for A but not a DELETE for B and C
This event indicates that we need to make a diff with all services on the remote cluster, ensuring that we do not keep any mirrors that are not relevant anymore
type OrphanedServicesGcTriggered struct{}
func (cgu OrphanedServicesGcTriggered) String() string
ProbeMetricVecs stores metrics about about gateways collected by probe workers.
type ProbeMetricVecs struct {
// contains filtered or unexported fields
}
func NewProbeMetricVecs() ProbeMetricVecs
NewProbeMetricVecs creates a new ProbeMetricVecs.
func (mv ProbeMetricVecs) NewWorkerMetrics(remoteClusterName string) (*ProbeMetrics, error)
NewWorkerMetrics creates a new ProbeMetrics by scoping to a specific target cluster.
ProbeMetrics stores metrics about about a specific gateway collected by a probe worker.
type ProbeMetrics struct {
// contains filtered or unexported fields
}
ProbeWorker is responsible for monitoring gateways using a probe specification
type ProbeWorker struct { Liveness chan bool *sync.RWMutex // contains filtered or unexported fields }
func NewProbeWorker(localGatewayName string, spec *multicluster.ProbeSpec, metrics *ProbeMetrics, probekey string) *ProbeWorker
NewProbeWorker creates a new probe worker associated with a particular gateway
func (pw *ProbeWorker) Start()
Start this probe worker
func (pw *ProbeWorker) Stop()
Stop this probe worker
func (pw *ProbeWorker) UpdateProbeSpec(spec *multicluster.ProbeSpec)
UpdateProbeSpec is used to update the probe specification when something about the gateway changes
RemoteClusterServiceWatcher is a watcher instantiated for every cluster that is being watched Its main job is to listen to events coming from the remote cluster and react accordingly, keeping the state of the mirrored services in sync. This is achieved by maintaining a SharedInformer on the remote cluster. The basic add/update/delete operations are mapped to a more domain specific events, put onto a work queue and handled by the processing loop. In case processing an event fails it can be requeued up to N times, to ensure that the failure is not due to some temporary network problems or general glitch in the Matrix.
type RemoteClusterServiceWatcher struct {
// contains filtered or unexported fields
}
func NewRemoteClusterServiceWatcher( ctx context.Context, serviceMirrorNamespace string, localAPI *k8s.API, cfg *rest.Config, link *multicluster.Link, requeueLimit int, repairPeriod time.Duration, liveness chan bool, enableHeadlessSvc bool, ) (*RemoteClusterServiceWatcher, error)
NewRemoteClusterServiceWatcher constructs a new cluster watcher
func (rcsw *RemoteClusterServiceWatcher) Start(ctx context.Context) error
Start starts watching the remote cluster
func (rcsw *RemoteClusterServiceWatcher) Stop(cleanupState bool)
Stop stops watching the cluster and cleans up all mirrored resources
RemoteServiceCreated is generated whenever a remote service is created Observing this event means that the service in question is not mirrored atm
type RemoteServiceCreated struct {
// contains filtered or unexported fields
}
func (rsc RemoteServiceCreated) String() string
Events for cluster watcher
RemoteServiceDeleted when a remote service is going away or it is not considered mirrored anymore
type RemoteServiceDeleted struct { Name string Namespace string }
func (rsd RemoteServiceDeleted) String() string
RemoteServiceUpdated is generated when we see something about an already mirrored service change on the remote cluster. In that case we need to reconcile. Most importantly we need to keep track of exposed ports and gateway association changes.
type RemoteServiceUpdated struct {
// contains filtered or unexported fields
}
func (rsu RemoteServiceUpdated) String() string
RepairEndpoints is issued when the service mirror and mirror gateway endpoints should be resolved based on the remote gateway and updated.
type RepairEndpoints struct{}
func (re RepairEndpoints) String() string
RetryableError is an error that should be retried through requeuing events
type RetryableError struct{ Inner []error }
func (re RetryableError) Error() string
Ticker tries to emit events on channel C at minDuration intervals plus up to maxJitter.
type Ticker struct { C <-chan time.Time MinDuration time.Duration MaxJitter time.Duration // contains filtered or unexported fields }
func NewTicker(minDuration time.Duration, maxJitter time.Duration) *Ticker
NewTicker creates a new Ticker
func (t *Ticker) Stop()
Stop the ticker