kubernetes: k8s.io/kubernetes/pkg/proxy/healthcheck Index | Files

package healthcheck

import "k8s.io/kubernetes/pkg/proxy/healthcheck"

Package healthcheck provides tools for serving kube-proxy healthchecks.


Package Files

doc.go healthcheck.go

type HTTPServer Uses

type HTTPServer interface {
    // Server is designed so that http.Server satisfies this interface,
    Serve(listener net.Listener) error

HTTPServer allows for testing of Server.

type HTTPServerFactory Uses

type HTTPServerFactory interface {
    // New creates an instance of a type satisfying HTTPServer.  This is
    // designed to include http.Server.
    New(addr string, handler http.Handler) HTTPServer

HTTPServerFactory allows for testing of Server. If the HTTPServerFactory argument to NewServer() is nil, the real http.Server type will be used.

type HealthzServer Uses

type HealthzServer struct {
    // contains filtered or unexported fields

HealthzServer returns 200 "OK" by default. Once timestamp has been updated, it verifies we don't exceed max no respond duration since last update.

func NewDefaultHealthzServer Uses

func NewDefaultHealthzServer(addr string, healthTimeout time.Duration, recorder record.EventRecorder, nodeRef *v1.ObjectReference) *HealthzServer

NewDefaultHealthzServer returns a default healthz http server.

func (*HealthzServer) Run Uses

func (hs *HealthzServer) Run()

Run starts the healthz http server and returns.

func (*HealthzServer) UpdateTimestamp Uses

func (hs *HealthzServer) UpdateTimestamp()

UpdateTimestamp updates the lastUpdated timestamp.

type HealthzUpdater Uses

type HealthzUpdater interface {

HealthzUpdater allows callers to update healthz timestamp only.

type Listener Uses

type Listener interface {
    // Listen is very much like net.Listen, except the first arg (network) is
    // fixed to be "tcp".
    Listen(addr string) (net.Listener, error)

Listener allows for testing of Server. If the Listener argument to NewServer() is nil, the real net.Listen function will be used.

type Server Uses

type Server 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

Server 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 NewServer Uses

func NewServer(hostname string, recorder record.EventRecorder, listener Listener, httpServerFactory HTTPServerFactory) Server

NewServer allocates a new healthcheck server manager. If either of the injected arguments are nil, defaults will be used.

Package healthcheck imports 15 packages (graph) and is imported by 46 packages. Updated 2019-05-17. Refresh now. Tools for package owners.