Documentation ¶
Index ¶
- func NewMetricsContext(componentName, checkName string) *metricsContext
- func RegisterMetrics()
- func WithBackoff(duration time.Duration) backoffEventRecorderOptionFunc
- func WithLongWindow(duration time.Duration, maxCount int) backoffEventRecorderOptionFunc
- func WithShortWindow(duration time.Duration, maxCount int) backoffEventRecorderOptionFunc
- type CertificatesGetter
- type ConnectionChecker
- type GetCheckFunc
- type MetricsContext
- type PodNetworkConnectivityCheckController
- type Recorder
- type UpdatesManager
- type UpdatesProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetricsContext ¶
func NewMetricsContext(componentName, checkName string) *metricsContext
func WithBackoff ¶
WithBackoff sets the duration of the event backoff
func WithLongWindow ¶
WithLongWindow sets the long window excessive event rate
func WithShortWindow ¶
WithShortWindow sets the short window excessive event rate
Types ¶
type CertificatesGetter ¶
type CertificatesGetter func() []tls.Certificate
type ConnectionChecker ¶
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 GetCheckFunc ¶
type GetCheckFunc func() *operatorcontrolplanev1alpha1.PodNetworkConnectivityCheck
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.
type UpdatesProcessor ¶
type UpdatesProcessor func(context.Context, ...v1alpha1helpers.UpdateStatusFunc) error