healthcheck

package
v0.0.0-...-ef552c2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHealthCheckInterval defines how frequently a probe runs
	// TODO(nikhiljindal): Share them with kubernetes/ingress.
	// These values set a low health threshold and a high failure threshold.
	// We're just trying to detect if the node networking is
	// borked, service level outages will get detected sooner
	// by kube-proxy.
	DefaultHealthCheckInterval = 1 * time.Minute
	// DefaultHealthyThreshold defines the threshold of success probes that declare a backend "healthy"
	DefaultHealthyThreshold = 1
	// DefaultUnhealthyThreshold defines the threshold of failure probes that declare a backend "unhealthy"
	DefaultUnhealthyThreshold = 10
	// DefaultTimeout defines the timeout of each probe
	DefaultTimeout = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeHealthCheckSyncer

type FakeHealthCheckSyncer struct {
	// List of health checks that this has been asked to ensure.
	EnsuredHealthChecks []fakeHealthCheck
}

FakeHealthCheckSyncer is a fake implementation of SyncerInterface to be used in tests.

func (*FakeHealthCheckSyncer) DeleteHealthChecks

func (f *FakeHealthCheckSyncer) DeleteHealthChecks(ports []ingressbe.ServicePort) error

DeleteHealthChecks deletes the health checks that EnsureHealthCheck would have created. See interface for more details.

func (*FakeHealthCheckSyncer) EnsureHealthCheck

func (f *FakeHealthCheckSyncer) EnsureHealthCheck(lbName string, ports []ingressbe.ServicePort, clients map[string]kubernetes.Interface, force bool) (HealthChecksMap, error)

EnsureHealthCheck ensures that the required health checks exist for the given load balancer. See interface for more details.

type HealthChecksMap

type HealthChecksMap map[int64]*compute.HealthCheck

HealthChecksMap is a map of port number to the health check for that port.

type Syncer

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

Syncer manages GCP health checks for multicluster GCP L7 load balancers.

func (*Syncer) DeleteHealthChecks

func (h *Syncer) DeleteHealthChecks(ports []ingressbe.ServicePort) error

DeleteHealthChecks deletes the health checks that EnsureHealthCheck would have created. See interface for more details.

func (*Syncer) EnsureHealthCheck

func (h *Syncer) EnsureHealthCheck(lbName string, ports []ingressbe.ServicePort, clients map[string]kubernetes.Interface, forceUpdate bool) (HealthChecksMap, error)

EnsureHealthCheck ensures that the required health check exists. Does nothing if it exists already, else creates a new one. Returns a map of the ensured health checks keyed by the corresponding port.

type SyncerInterface

type SyncerInterface interface {
	// EnsureHealthCheck ensures that the required health checks exist.
	// Returns a map of port number to the health check for that port. The map contains all the ports for which  it was successfully able to ensure a health check.
	// In case of no error, the map will contain all the ports from the given array of ports.
	EnsureHealthCheck(lbName string, ports []ingressbe.ServicePort, clients map[string]kubernetes.Interface, forceUpdate bool) (HealthChecksMap, error)
	// DeleteHealthChecks deletes all the health checks that EnsureHealthCheck would have created.
	DeleteHealthChecks(ports []ingressbe.ServicePort) error
}

SyncerInterface is an interface to manage GCP health checks.

func NewFakeHealthCheckSyncer

func NewFakeHealthCheckSyncer() SyncerInterface

NewFakeHealthCheckSyncer returns a new instance of the fake syncer.

func NewHealthCheckSyncer

func NewHealthCheckSyncer(namer *utilsnamer.Namer, hcp ingresshc.HealthCheckProvider) SyncerInterface

NewHealthCheckSyncer returns a new instance of the syncer.

Jump to

Keyboard shortcuts

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