healthchecks

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 21 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeSingletonRecorderGetter added in v1.24.0

func NewFakeSingletonRecorderGetter(bufferSize int) *singletonFakeRecorderGetter

Types

type HealthCheckProvider

type HealthCheckProvider interface {
	CreateHTTPHealthCheck(hc *compute.HttpHealthCheck) error
	UpdateHTTPHealthCheck(hc *compute.HttpHealthCheck) error
	DeleteHTTPHealthCheck(name string) error
	GetHTTPHealthCheck(name string) (*compute.HttpHealthCheck, error)

	CreateAlphaHealthCheck(hc *computealpha.HealthCheck) error
	CreateBetaHealthCheck(hc *computebeta.HealthCheck) error
	CreateHealthCheck(hc *compute.HealthCheck) error
	UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error
	UpdateBetaHealthCheck(hc *computebeta.HealthCheck) error
	UpdateHealthCheck(hc *compute.HealthCheck) error
	DeleteHealthCheck(name string) error
	GetAlphaHealthCheck(name string) (*computealpha.HealthCheck, error)
	GetBetaHealthCheck(name string) (*computebeta.HealthCheck, error)
	GetHealthCheck(name string) (*compute.HealthCheck, error)
}

HealthCheckProvider is an interface to manage a single GCE health check. TODO: (shance) convert this to use composite types

type HealthChecker

type HealthChecker interface {
	// SyncServicePort syncs the healthcheck associated with the given
	// ServicePort and Pod Probe definition.
	//
	// `probe` can be nil if no probe exists.
	SyncServicePort(sp *utils.ServicePort, probe *v1.Probe, logger klog.Logger) (string, error)
	Delete(name string, scope meta.KeyType, logger klog.Logger) error
	Get(name string, version meta.Version, scope meta.KeyType, logger klog.Logger) (*translator.HealthCheck, error)
}

HealthChecker is an interface to manage cloud HTTPHealthChecks.

type HealthChecks

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

HealthChecks manages health checks.

func NewHealthChecker

func NewHealthChecker(cloud HealthCheckProvider, healthCheckPath string, defaultBackendSvc types.NamespacedName, recorderGetter RecorderGetter, serviceGetter ServiceGetter, flags HealthcheckFlags) *HealthChecks

NewHealthChecker creates a new health checker. cloud: the cloud object implementing SingleHealthCheck. defaultHealthCheckPath: is the HTTP path to use for health checks.

func (*HealthChecks) Delete

func (h *HealthChecks) Delete(name string, scope meta.KeyType, beLogger klog.Logger) error

Delete deletes the health check by port.

func (*HealthChecks) Get

func (h *HealthChecks) Get(name string, version meta.Version, scope meta.KeyType, hcLogger klog.Logger) (*translator.HealthCheck, error)

Get returns the health check by port

func (*HealthChecks) SyncServicePort added in v1.9.0

func (h *HealthChecks) SyncServicePort(sp *utils.ServicePort, probe *v1.Probe, beLogger klog.Logger) (string, error)

SyncServicePort implements HealthChecker.

type HealthcheckFlags added in v1.25.0

type HealthcheckFlags struct {
	EnableTHC                                 bool
	EnableRecalculationOnBackendConfigRemoval bool
	THCPort                                   int64
}

type RecorderGetter added in v1.24.0

type RecorderGetter interface {
	Recorder(ns string) record.EventRecorder
}

func NewFakeRecorderGetter added in v1.24.0

func NewFakeRecorderGetter(bufferSize int) RecorderGetter

type ServiceGetter added in v1.24.0

type ServiceGetter interface {
	GetService(namespace, name string) (*v1.Service, error)
}

ServiceGetter is an interface to retrieve Kubernetes Services.

func NewFakeServiceGetter added in v1.24.0

func NewFakeServiceGetter() ServiceGetter

Jump to

Keyboard shortcuts

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