...

Package servicemirror

import "github.com/linkerd/linkerd2/multicluster/service-mirror"
Overview
Index

Overview ▾

Index ▾

type ClusterUnregistered
    func (cgu ClusterUnregistered) String() string
type OnAddCalled
    func (oa OnAddCalled) String() string
type OnAddEndpointsCalled
type OnDeleteCalled
    func (od OnDeleteCalled) String() string
type OnLocalNamespaceAdded
    func (ol OnLocalNamespaceAdded) String() string
type OnUpdateCalled
    func (ou OnUpdateCalled) String() string
type OnUpdateEndpointsCalled
type OrphanedServicesGcTriggered
    func (cgu OrphanedServicesGcTriggered) String() string
type ProbeMetricVecs
    func NewProbeMetricVecs() ProbeMetricVecs
    func (mv ProbeMetricVecs) NewWorkerMetrics(remoteClusterName string) (*ProbeMetrics, error)
type ProbeMetrics
type ProbeWorker
    func NewProbeWorker(localGatewayName string, spec *multicluster.ProbeSpec, metrics *ProbeMetrics, probekey string) *ProbeWorker
    func (pw *ProbeWorker) Start()
    func (pw *ProbeWorker) Stop()
    func (pw *ProbeWorker) UpdateProbeSpec(spec *multicluster.ProbeSpec)
type RemoteClusterServiceWatcher
    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)
    func (rcsw *RemoteClusterServiceWatcher) Start(ctx context.Context) error
    func (rcsw *RemoteClusterServiceWatcher) Stop(cleanupState bool)
type RemoteServiceCreated
    func (rsc RemoteServiceCreated) String() string
type RemoteServiceDeleted
    func (rsd RemoteServiceDeleted) String() string
type RemoteServiceUpdated
    func (rsu RemoteServiceUpdated) String() string
type RepairEndpoints
    func (re RepairEndpoints) String() string
type RetryableError
    func (re RetryableError) Error() string
type Ticker
    func NewTicker(minDuration time.Duration, maxJitter time.Duration) *Ticker
    func (t *Ticker) Stop()

Package files

cluster_watcher.go cluster_watcher_headless.go cluster_watcher_test_util.go events_formatting.go jittered_ticker.go metrics.go probe_worker.go

type ClusterUnregistered

ClusterUnregistered is issued when this ClusterWatcher is shut down.

type ClusterUnregistered struct{}

func (ClusterUnregistered) String

func (cgu ClusterUnregistered) String() string

type OnAddCalled

OnAddCalled is issued when the onAdd function of the shared informer is called

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

func (OnAddCalled) String

func (oa OnAddCalled) String() string

type OnAddEndpointsCalled

OnAddEndpointsCalled is issued when the onAdd function of the Endpoints shared informer is called

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

type OnDeleteCalled

OnDeleteCalled is issued when the onDelete function of the shared informer is called

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

func (OnDeleteCalled) String

func (od OnDeleteCalled) String() string

type OnLocalNamespaceAdded

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

func (ol OnLocalNamespaceAdded) String() string

type OnUpdateCalled

OnUpdateCalled is issued when the onUpdate function of the shared informer is called

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

func (OnUpdateCalled) String

func (ou OnUpdateCalled) String() string

type OnUpdateEndpointsCalled

OnUpdateEndpointsCalled is issued when the onUpdate function of the shared Endpoints informer is called

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

type OrphanedServicesGcTriggered

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

func (cgu OrphanedServicesGcTriggered) String() string

type ProbeMetricVecs

ProbeMetricVecs stores metrics about about gateways collected by probe workers.

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

func NewProbeMetricVecs

func NewProbeMetricVecs() ProbeMetricVecs

NewProbeMetricVecs creates a new ProbeMetricVecs.

func (ProbeMetricVecs) NewWorkerMetrics

func (mv ProbeMetricVecs) NewWorkerMetrics(remoteClusterName string) (*ProbeMetrics, error)

NewWorkerMetrics creates a new ProbeMetrics by scoping to a specific target cluster.

type ProbeMetrics

ProbeMetrics stores metrics about about a specific gateway collected by a probe worker.

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

type ProbeWorker

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

func NewProbeWorker(localGatewayName string, spec *multicluster.ProbeSpec, metrics *ProbeMetrics, probekey string) *ProbeWorker

NewProbeWorker creates a new probe worker associated with a particular gateway

func (*ProbeWorker) Start

func (pw *ProbeWorker) Start()

Start this probe worker

func (*ProbeWorker) Stop

func (pw *ProbeWorker) Stop()

Stop this probe worker

func (*ProbeWorker) UpdateProbeSpec

func (pw *ProbeWorker) UpdateProbeSpec(spec *multicluster.ProbeSpec)

UpdateProbeSpec is used to update the probe specification when something about the gateway changes

type RemoteClusterServiceWatcher

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

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 (*RemoteClusterServiceWatcher) Start

func (rcsw *RemoteClusterServiceWatcher) Start(ctx context.Context) error

Start starts watching the remote cluster

func (*RemoteClusterServiceWatcher) Stop

func (rcsw *RemoteClusterServiceWatcher) Stop(cleanupState bool)

Stop stops watching the cluster and cleans up all mirrored resources

type RemoteServiceCreated

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

func (rsc RemoteServiceCreated) String() string

Events for cluster watcher

type RemoteServiceDeleted

RemoteServiceDeleted when a remote service is going away or it is not considered mirrored anymore

type RemoteServiceDeleted struct {
    Name      string
    Namespace string
}

func (RemoteServiceDeleted) String

func (rsd RemoteServiceDeleted) String() string

type RemoteServiceUpdated

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

func (rsu RemoteServiceUpdated) String() string

type RepairEndpoints

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

func (re RepairEndpoints) String() string

type RetryableError

RetryableError is an error that should be retried through requeuing events

type RetryableError struct{ Inner []error }

func (RetryableError) Error

func (re RetryableError) Error() string

type Ticker

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

func NewTicker(minDuration time.Duration, maxJitter time.Duration) *Ticker

NewTicker creates a new Ticker

func (*Ticker) Stop

func (t *Ticker) Stop()

Stop the ticker