controller

package
v0.0.0-...-bd27db3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetricsContext

func NewMetricsContext(componentName, checkName string) *metricsContext

func RegisterMetrics

func RegisterMetrics()

RegisterMetrics in the global registry

func WithBackoff

func WithBackoff(duration time.Duration) backoffEventRecorderOptionFunc

WithBackoff sets the duration of the event backoff

func WithLongWindow

func WithLongWindow(duration time.Duration, maxCount int) backoffEventRecorderOptionFunc

WithLongWindow sets the long window excessive event rate

func WithShortWindow

func WithShortWindow(duration time.Duration, maxCount int) backoffEventRecorderOptionFunc

WithShortWindow sets the short window excessive event rate

Types

type CertificatesGetter

type CertificatesGetter func() []tls.Certificate

type ConnectionChecker

type ConnectionChecker interface {
	Run(ctx context.Context)
	Stop(ctx context.Context)
}

ConnectionChecker checks a single connection and updates status when appropriate

func NewConnectionChecker

func NewConnectionChecker(name, podName, podNamespace string, getCheck GetCheckFunc, client v1alpha1helpers.PodNetworkConnectivityCheckClient, clientCertGetter CertificatesGetter, recorder Recorder) ConnectionChecker

NewConnectionChecker returns a ConnectionChecker.

type MetricsContext

type MetricsContext interface {
	Update(targetEndpoint string, latency *trace.LatencyInfo, checkErr error)
}

MetricsContext updates connectivity check metrics

type PodNetworkConnectivityCheckController

type PodNetworkConnectivityCheckController interface {
	factory.Controller
}

PodNetworkConnectivityCheckController continuously performs network connectivity checks and reports the results.

func NewPodNetworkConnectivityCheckController

func NewPodNetworkConnectivityCheckController(podName, podNamespace string,
	checksGetter operatorcontrolplaneclientv1alpha1.PodNetworkConnectivityChecksGetter,
	checkInformer alpha1.PodNetworkConnectivityCheckInformer,
	secretInformer coreinformersv1.SecretInformer, recorder events.Recorder) PodNetworkConnectivityCheckController

Returns a new PodNetworkConnectivityCheckController that performs network connectivity checks as specified in the PodNetworkConnectivityChecks defined in the specified namespace, for the specified pod.

type Recorder

type Recorder interface {
	Event(reason, message string)
	Eventf(reason, messageFmt string, args ...interface{})
	Warning(reason, message string)
	Warningf(reason, messageFmt string, args ...interface{})
}

Recorder is a stripped down version of the library-go events.Recorder interface.

func NewBackoffEventRecorder

func NewBackoffEventRecorder(recorder events.Recorder, options ...backoffEventRecorderOptionFunc) Recorder

NewBackoffEventRecorder returns a new Recorder that keeps track of the rate of events being recorded and if the rate is too fast, suspend recording events for a while, keeping events in memory. When event recording is resumed, record a single summary events for all the events for a given event reason. By default, event recording id paused for 30 minutes when the rate of events exceed either 30 events in 30 seconds or 600 events in 10 minutes.

type UpdatesManager

type UpdatesManager interface {
	// Add an update to the queue.
	Add(timestamp time.Time, updates ...v1alpha1helpers.UpdateStatusFunc)
	// Process the updates ready to be processed.
	Process(ctx context.Context, flush bool) error
}

UpdatesManager manages a queue of updates.

func NewUpdatesManager

func NewUpdatesManager(checkPeriod, checkTimeout time.Duration, processor UpdatesProcessor) UpdatesManager

NewUpdatesManager returns a queue sorting UpdateManager.

Jump to

Keyboard shortcuts

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