Documentation ¶
Index ¶
- func HTTPProbe(config HTTPProbeConfigOptions) error
- func IsHTTPProbeReady(res *http.Response) bool
- func TCPProbe(config TCPProbeConfigOptions) error
- type HTTPProbeConfigOptions
- type State
- func (h *State) DrainHandler() func(_ http.ResponseWriter, _ *http.Request)
- func (h *State) HealthHandler(prober func() bool, isNotAggressive bool) func(w http.ResponseWriter, r *http.Request)
- func (h *State) IsAlive() bool
- func (h *State) IsShuttingDown() bool
- func (h *State) Shutdown(drain func())
- type TCPProbeConfigOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPProbe ¶ added in v0.8.0
func HTTPProbe(config HTTPProbeConfigOptions) error
HTTPProbe checks that HTTP connection can be established to the address.
func IsHTTPProbeReady ¶ added in v0.8.0
IsHTTPProbeReady checks whether we received a successful Response
func TCPProbe ¶
func TCPProbe(config TCPProbeConfigOptions) error
TCPProbe checks that a TCP socket to the address can be opened. Did not reuse k8s.io/kubernetes/pkg/probe/tcp to not create a dependency on klog.
Types ¶
type HTTPProbeConfigOptions ¶ added in v0.8.0
type HTTPProbeConfigOptions struct { Timeout time.Duration *corev1.HTTPGetAction KubeMajor string KubeMinor string }
HTTPProbeConfigOptions holds the HTTP probe config options
type State ¶
type State struct {
// contains filtered or unexported fields
}
State holds state about the current healthiness of the component.
func (*State) DrainHandler ¶ added in v0.5.0
func (h *State) DrainHandler() func(_ http.ResponseWriter, _ *http.Request)
DrainHandler constructs a handler that waits until the proxy server is shut down.
func (*State) HealthHandler ¶
func (h *State) HealthHandler(prober func() bool, isNotAggressive bool) func(w http.ResponseWriter, r *http.Request)
HealthHandler constructs a handler that returns the current state of the health server. If isNotAggressive is true and prober has succeeded previously, the function return success without probing user-container again (until shutdown).
func (*State) IsAlive ¶
IsAlive returns whether or not the health server is in a known working state currently.
func (*State) IsShuttingDown ¶
IsShuttingDown returns whether or not the health server is currently shutting down.
type TCPProbeConfigOptions ¶ added in v0.8.0
TCPProbeConfigOptions holds the TCP probe config options