healthchecker

package
v1.4.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ProbePhaseInit   = "init"
	ProbePhaseNormal = "normal"
)
View Source
const (
	DelegateHeartBeat = "openyurt.io/delegate-heartbeat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendProber added in v1.1.0

type BackendProber interface {
	// RenewKubeletLeaseTime is used for notifying whether kubelet stopped or not,
	// when kubelet lease renew time is stopped to report, health checker will stop check
	// the healthy status of remote server and mark remote server as unhealthy.
	RenewKubeletLeaseTime(time time.Time)
	// Probe send one heartbeat to backend and should be executed by caller in interval
	Probe(phase string) bool
	IsHealthy() bool
}

BackendProber is used to send heartbeat to backend and verify backend is healthy or not

type HealthChecker

type HealthChecker interface {
	// RenewKubeletLeaseTime is used for notifying whether kubelet stopped or not,
	// when kubelet lease renew time is stopped to report, health checker will stop check
	// the healthy status of remote server and mark remote server as unhealthy.
	RenewKubeletLeaseTime()
	IsHealthy() bool
}

HealthChecker is an interface for checking healthy status of one server

func NewCoordinatorHealthChecker added in v1.1.0

func NewCoordinatorHealthChecker(cfg *config.YurtHubConfiguration, checkerClient kubernetes.Interface, cloudServerHealthChecker HealthChecker, stopCh <-chan struct{}) (HealthChecker, error)

NewCoordinatorHealthChecker returns a health checker for verifying yurt coordinator status.

type MultipleBackendsHealthChecker added in v1.1.0

type MultipleBackendsHealthChecker interface {
	HealthChecker
	BackendHealthyStatus(server *url.URL) bool
	PickHealthyServer() (*url.URL, error)
}

MultipleBackendsHealthChecker is used for checking healthy status of multiple servers, like there are several kube-apiserver instances on the cloud for high availability.

func NewCloudAPIServerHealthChecker added in v1.1.0

func NewCloudAPIServerHealthChecker(cfg *config.YurtHubConfiguration, healthCheckerClients map[string]kubernetes.Interface, stopCh <-chan struct{}) (MultipleBackendsHealthChecker, error)

NewCloudAPIServerHealthChecker returns a health checker for verifying cloud kube-apiserver status.

func NewFakeChecker

func NewFakeChecker(healthy bool, settings map[string]int) MultipleBackendsHealthChecker

NewFakeChecker creates a fake checker

type NodeLease

type NodeLease interface {
	Update(base *coordinationv1.Lease) (*coordinationv1.Lease, error)
}

func NewNodeLease

func NewNodeLease(client clientset.Interface, holderIdentity string, leaseDurationSeconds int32, failedRetry int) NodeLease

Jump to

Keyboard shortcuts

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