healthchecks

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 19 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteHealthCheck added in v1.9.0

func DeleteHealthCheck(cloud *gce.Cloud, name string) error

func EnsureL4HealthCheck added in v1.9.0

func EnsureL4HealthCheck(cloud *gce.Cloud, name string, svcName types.NamespacedName, shared bool, path string, port int32) (*composite.HealthCheck, string, error)

EnsureL4HealthCheck creates a new HTTP health check for an L4 LoadBalancer service, based on the parameters provided. If the healthcheck already exists, it is updated as needed.

func HealthCheckName added in v1.9.0

func HealthCheckName(shared bool, clusteruid, lbName string) (string, string)

HealthCheckName returns the name of the healthcheck as well as the name of the associated firewall rule that opens up access for the healthheck.

func NewL4HealthCheck added in v1.9.0

func NewL4HealthCheck(name string, svcName types.NamespacedName, shared bool, path string, port int32) *composite.HealthCheck

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) (string, error)
	Delete(name string, scope meta.KeyType) error
	Get(name string, version meta.Version, scope meta.KeyType) (*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) *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) error

Delete deletes the health check by port.

func (*HealthChecks) Get

func (h *HealthChecks) Get(name string, version meta.Version, scope meta.KeyType) (*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) (string, error)

SyncServicePort implements HealthChecker.

Jump to

Keyboard shortcuts

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