prober

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultProbeInterval is the default duration representing the interval for a probe.
	DefaultProbeInterval = 10 * time.Second
	// DefaultProbeInitialDelay is the default duration representing an initial delay to start a probe.
	DefaultProbeInitialDelay = 30 * time.Second
	// DefaultScaleInitialDelay is the default duration representing an initial delay to start to scale up a kubernetes resource.
	DefaultScaleInitialDelay = 0 * time.Second
	// DefaultProbeTimeout is the default duration representing total timeout for a probe to complete.
	DefaultProbeTimeout = 30 * time.Second
	// DefaultBackoffJitterFactor is the default jitter value with which successive probe runs are scheduled.
	DefaultBackoffJitterFactor = 0.2
	// DefaultScaleUpdateTimeout is the default duration representing a timeout for the scale operation to complete.
	DefaultScaleUpdateTimeout = 30 * time.Second
	// DefaultNodeLeaseFailureFraction is used to determine the maximum number of node leases that can be expired for a node lease probe to succeed.
	// Eg:- 1. numberOfOwnedLeases = 10, numberOfExpiredLeases = 6.
	// 		   numberOfExpiredLeases/numberOfOwnedLeases = 0.6, which is >= DefaultNodeLeaseFailureFraction and so the lease probe will fail.
	//		2. numberOfOwnedLeases = 10, numberOfExpiredLeases = 5.
	//	 	   numberOfExpiredLeases/numberOfOwnedLeases = 0.5, which is < DefaultNodeLeaseFailureFraction and so the lease probe will succeed.
	DefaultNodeLeaseFailureFraction = 0.60
	// DefaultKCMNodeMonitorGraceDuration is set to the default value of nodeMonitorGracePeriod in KCM.
	// See https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/#:~:text=%2D%2Dnode%2Dmonitor%2Dgrace%2Dperiod%20duration
	// Note: Make sure to keep this value in sync with default value of nodeMonitorGracePeriod in KCM.
	DefaultKCMNodeMonitorGraceDuration = 40 * time.Second
)

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(file string, scheme *runtime.Scheme) (*papi.Config, error)

LoadConfig reads the prober configuration from a file, unmarshalls it, fills in the default values and validates the unmarshalled configuration If all validations pass it will return papi.Config else it will return an error.

Types

type Manager

type Manager interface {
	// Register registers the given prober with the manager. It should return false if prober is already registered.
	Register(prober Prober) bool
	// Unregister closes the prober and removes it from the manager. It should return false if prober is not registered with the manager.
	Unregister(key string) bool
	// GetProber uses the given key to get a registered prober from the manager. It returns false if prober is not found.
	GetProber(key string) (Prober, bool)
	// GetAllProbers returns a slice of all the probers registered with the manager.
	GetAllProbers() []Prober
}

Manager is the convenience interface to manage lifecycle of probers.

func NewManager

func NewManager() Manager

NewManager creates a new manager to manage probers.

type Prober

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

Prober represents a probe to the Kube ApiServer of a shoot

func NewProber

func NewProber(parentCtx context.Context, seedClient client.Client, namespace string, config *papi.Config, workerNodeConditions map[string][]string, scaler dwdScaler.Scaler, shootClientCreator shoot.ClientCreator, logger logr.Logger) *Prober

NewProber creates a new Prober

func (*Prober) AreWorkerNodeConditionsStale added in v1.3.0

func (p *Prober) AreWorkerNodeConditionsStale(newWorkerNodeConditions map[string][]string) bool

AreWorkerNodeConditionsStale checks if the worker node conditions are up-to-date

func (*Prober) Close

func (p *Prober) Close()

Close closes a probe

func (*Prober) GetConfig added in v1.2.0

func (p *Prober) GetConfig() *papi.Config

GetConfig returns the probe config for the prober. Currently, this is only used for testing purposes.

func (*Prober) IsClosed

func (p *Prober) IsClosed() bool

IsClosed checks if the context of the prober is cancelled or not.

func (*Prober) IsInBackOff added in v1.3.0

func (p *Prober) IsInBackOff() bool

IsInBackOff checks if the prober is in backoff. Currently, this is only used for testing purposes.

func (*Prober) Run

func (p *Prober) Run()

Run starts a probe which will run with a configured interval and jitter.

Directories

Path Synopsis
fakes
k8s
Package types contains the API definitions for the dependency-watchdog prober.
Package types contains the API definitions for the dependency-watchdog prober.

Jump to

Keyboard shortcuts

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