health

package
v0.0.0-...-307b342 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregateProber

type AggregateProber struct {
	Probes []Prober
}

func (AggregateProber) Probe

func (a AggregateProber) Probe(timeout time.Duration) (ProbeResult, error)

type EnvoyProber

type EnvoyProber struct {
	Config ready.Prober
}

func (EnvoyProber) Probe

type ExecProber

type ExecProber struct {
	Config *v1alpha3.ExecHealthCheckConfig
}

func (*ExecProber) Probe

func (e *ExecProber) Probe(timeout time.Duration) (ProbeResult, error)

type GRPCProber

type GRPCProber struct {
	Config      *v1alpha3.GrpcHealthCheckConfig
	DefaultHost string
}

func NewGRPCProber

func NewGRPCProber(cfg *v1alpha3.GrpcHealthCheckConfig, defaultHost string) *GRPCProber

func (*GRPCProber) Probe

func (g *GRPCProber) Probe(timeout time.Duration) (ProbeResult, error)

type HTTPProber

type HTTPProber struct {
	Config      *v1alpha3.HTTPHealthCheckConfig
	Transport   *http.Transport
	DefaultHost string
}

func NewHTTPProber

func NewHTTPProber(cfg *v1alpha3.HTTPHealthCheckConfig, defaultHost string, ipv6 bool) *HTTPProber

func (*HTTPProber) Probe

func (h *HTTPProber) Probe(timeout time.Duration) (ProbeResult, error)

HttpProber_Probe will return whether or not the target is healthy (true -> healthy) by making an HTTP Get response.

type ProbeEvent

type ProbeEvent struct {
	Healthy          bool
	UnhealthyStatus  int32
	UnhealthyMessage string
}

type ProbeResult

type ProbeResult string
const (
	Healthy   ProbeResult = "HEALTHY"
	Unhealthy ProbeResult = "UNHEALTHY"
	Unknown   ProbeResult = "UNKNOWN"
)

func (*ProbeResult) IsHealthy

func (p *ProbeResult) IsHealthy() bool

type Prober

type Prober interface {
	// Probe will healthcheck and return whether or not the target is healthy.
	// If an error returned is not nil, it is assumed that the process could
	// not complete, and Probe() was unable to determine whether or not the
	// target was healthy.
	Probe(timeout time.Duration) (ProbeResult, error)
}

type TCPProber

type TCPProber struct {
	Config      *v1alpha3.TCPHealthCheckConfig
	DefaultHost string
}

func NewTCPProber

func NewTCPProber(cfg *v1alpha3.TCPHealthCheckConfig, host string) *TCPProber

func (*TCPProber) Probe

func (t *TCPProber) Probe(timeout time.Duration) (ProbeResult, error)

type WorkloadHealthChecker

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

func NewWorkloadHealthChecker

func NewWorkloadHealthChecker(cfg *v1alpha3.ReadinessProbe, envoyProbe ready.Prober, proxyAddrs []string, ipv6 bool) *WorkloadHealthChecker

func (*WorkloadHealthChecker) PerformApplicationHealthCheck

func (w *WorkloadHealthChecker) PerformApplicationHealthCheck(callback func(*ProbeEvent), quit chan struct{})

PerformApplicationHealthCheck Performs the application-provided configuration health check. Instead of a heartbeat-based health checks, we only send on a health state change, and this is determined by the success & failure threshold provided by the user.

Jump to

Keyboard shortcuts

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