Documentation
¶
Index ¶
- Constants
- func CheckerFunc(h Manager) healthz.Checker
- func NewAPIServerHealthz(ctx context.Context, restClient rest.Interface) healthz.Checker
- func NewCacheSyncHealthz(cacheSyncWaiter cacheSyncWaiter) healthz.Checker
- func NewCacheSyncHealthzWithDeadline(log logr.Logger, clock clock.Clock, cacheSyncWaiter cacheSyncWaiter, ...) healthz.Checker
- type Manager
Constants ¶
const DefaultCacheSyncDeadline = 3 * time.Minute
DefaultCacheSyncDeadline is a default deadline for the cache sync healthz check.
const DefaultHealthManagerName = "default"
DefaultHealthManagerName is the name of the default health manager.
const PeriodicHealthManagerName = "periodic"
PeriodicHealthManagerName is the name of the periodic health manager.
Variables ¶
This section is empty.
Functions ¶
func CheckerFunc ¶ added in v1.57.0
CheckerFunc returns a new healthz.Checker that will pass only if the given health manager returns true.
func NewAPIServerHealthz ¶ added in v1.59.0
NewAPIServerHealthz returns a new healthz.Checker that will pass only if the /healthz endpoint of the API server returns status code 200.
func NewCacheSyncHealthz ¶ added in v1.18.0
NewCacheSyncHealthz returns a new healthz.Checker that will pass only if all informers in the given cacheSyncWaiter sync.
func NewCacheSyncHealthzWithDeadline ¶ added in v1.118.0
func NewCacheSyncHealthzWithDeadline(log logr.Logger, clock clock.Clock, cacheSyncWaiter cacheSyncWaiter, deadline time.Duration) healthz.Checker
NewCacheSyncHealthzWithDeadline is like NewCacheSyncHealthz, however, it fails when at least one informer in the given cacheSyncWaiter is not synced for at least the given deadline.
Types ¶
type Manager ¶
type Manager interface {
// Name returns the name of the health manager.
Name() string
// Start starts the health manager.
Start(context.Context) error
// Stop stops the health manager.
Stop()
// Get returns the current health status.
Get() bool
// Set updates the current health status with the given value.
Set(bool)
}
Manager is an interface for health managers.
func NewDefaultHealthz ¶
func NewDefaultHealthz() Manager
NewDefaultHealthz returns a default health manager that stores the given health status and returns it.
func NewPeriodicHealthz ¶
NewPeriodicHealthz returns a health manager that automatically sets the health status to false after the given reset duration. The timer is reset again when the health status is true (i.e., a running timer is reset and starts again from the beginning).