...

Package externalworkload

import "github.com/linkerd/linkerd2/controller/api/destination/external-workload"
Overview
Index

Overview ▾

Constants

const (
    WorkQueueSubsystem         = "workqueue"
    DepthKey                   = "depth"
    AddsKey                    = "adds_total"
    QueueLatencyKey            = "queue_duration_seconds"
    WorkDurationKey            = "work_duration_seconds"
    UnfinishedWorkKey          = "unfinished_work_seconds"
    LongestRunningProcessorKey = "longest_running_processor_seconds"
    RetriesKey                 = "retries_total"
    DropsTotalKey              = "drops_total"
)

func IsEwReady

func IsEwReady(ew *ewv1beta1.ExternalWorkload) bool

type EndpointsController

EndpointsController reconciles service memberships for ExternalWorkload resources by writing EndpointSlice objects for Services that select one or more external endpoints.

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

func NewEndpointsController

func NewEndpointsController(k8sAPI *k8s.API, hostname, controllerNs string, stopCh chan struct{}, exportQueueMetrics bool) (*EndpointsController, error)

The EndpointsController code has been structured (and modified) based on the core EndpointSlice controller. Copyright 2014 The Kubernetes Authors https://github.com/kubernetes/kubernetes/blob/29fad383dab0dd7b7b563ec9eae10156616a6f34/pkg/controller/endpointslice/endpointslice_controller.go

There are some fundamental differences between the core endpoints controller and Linkerd's endpoints controller; for one, the churn rate is expected to be much lower for a controller that reconciles ExternalWorkload resources. Furthermore, the structure of the resource is different, statuses do not contain as many conditions, and the lifecycle of an ExternalWorkload is different to that of a Pod (e.g. a workload is long lived).

NewEndpointsController creates a new controller. The controller must be started with its `Start()` method.

func (*EndpointsController) Start

func (ec *EndpointsController) Start()

Start will run the endpoint manager's processing loop and leader elector.

The function will spawn three background tasks; one to run the leader elector client, one that will process updates applied by the informer callbacks and one to handle shutdown signals and propagate them to all components.

Warning: Do not call Start() more than once