Documentation ¶
Overview ¶
Package healthcheck provides tools for serving kube-proxy healthchecks.
Index ¶
Constants ¶
const ( // ToBeDeletedTaint is a taint used by the CLuster Autoscaler before marking a node for deletion. Defined in // https://github.com/kubernetes/autoscaler/blob/e80ab518340f88f364fe3ef063f8303755125971/cluster-autoscaler/utils/deletetaint/delete.go#L36 ToBeDeletedTaint = "ToBeDeletedByClusterAutoscaler" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeServiceHealthServer ¶ added in v1.17.0
type FakeServiceHealthServer struct{}
FakeServiceHealthServer is a fake ServiceHealthServer for test programs
func (FakeServiceHealthServer) SyncEndpoints ¶ added in v1.17.0
func (fake FakeServiceHealthServer) SyncEndpoints(_ map[types.NamespacedName]int) error
SyncEndpoints is part of ServiceHealthServer
func (FakeServiceHealthServer) SyncServices ¶ added in v1.17.0
func (fake FakeServiceHealthServer) SyncServices(_ map[types.NamespacedName]uint16) error
SyncServices is part of ServiceHealthServer
type ProxierHealthUpdater ¶ added in v1.17.0
type ProxierHealthUpdater interface { // QueuedUpdate should be called when the proxier receives a Service or Endpoints // event containing information that requires updating service rules. QueuedUpdate() // Updated should be called when the proxier has successfully updated the service // rules to reflect the current state. Updated() // Run starts the healthz HTTP server and blocks until it exits. Run() error // Sync the node and determine if its eligible or not. Eligible is // defined as being: not tainted by ToBeDeletedTaint and not deleted. SyncNode(node *v1.Node) // contains filtered or unexported methods }
ProxierHealthUpdater allows callers to update healthz timestamp only.
func NewProxierHealthServer ¶ added in v1.17.0
func NewProxierHealthServer(addr string, healthTimeout time.Duration, recorder events.EventRecorder, nodeRef *v1.ObjectReference) ProxierHealthUpdater
NewProxierHealthServer returns a proxier health http server.
type ServiceHealthServer ¶ added in v1.17.0
type ServiceHealthServer interface { // Make the new set of services be active. Services that were open before // will be closed. Services that are new will be opened. Service that // existed and are in the new set will be left alone. The value of the map // is the healthcheck-port to listen on. SyncServices(newServices map[types.NamespacedName]uint16) error // Make the new set of endpoints be active. Endpoints for services that do // not exist will be dropped. The value of the map is the number of // endpoints the service has on this node. SyncEndpoints(newEndpoints map[types.NamespacedName]int) error }
ServiceHealthServer serves HTTP endpoints for each service name, with results based on the endpoints. If there are 0 endpoints for a service, it returns a 503 "Service Unavailable" error (telling LBs not to use this node). If there are 1 or more endpoints, it returns a 200 "OK".
func NewFakeServiceHealthServer ¶ added in v1.17.0
func NewFakeServiceHealthServer() ServiceHealthServer
NewFakeServiceHealthServer allocates a new fake service healthcheck server manager
func NewServiceHealthServer ¶ added in v1.17.0
func NewServiceHealthServer(hostname string, recorder events.EventRecorder, nodePortAddresses *proxyutil.NodePortAddresses, healthzServer proxierHealthChecker) ServiceHealthServer
NewServiceHealthServer allocates a new service healthcheck server manager