apiserver: k8s.io/apiserver/pkg/server/healthz Index | Files

package healthz

import "k8s.io/apiserver/pkg/server/healthz"

Package healthz implements basic http server health checking. Usage:

import "k8s.io/apiserver/pkg/server/healthz"
healthz.InstallHandler(mux)

Index

Package Files

doc.go healthz.go

func InstallHandler Uses

func InstallHandler(mux mux, checks ...HealthChecker)

InstallHandler registers handlers for health checking on the path "/healthz" to mux. *All handlers* for mux must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same mux will result in a panic.

func InstallLivezHandler Uses

func InstallLivezHandler(mux mux, checks ...HealthChecker)

InstallLivezHandler registers handlers for liveness checking on the path "/livez" to mux. *All handlers* for mux must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same mux will result in a panic.

func InstallPathHandler Uses

func InstallPathHandler(mux mux, path string, checks ...HealthChecker)

InstallPathHandler registers handlers for health checking on a specific path to mux. *All handlers* for the path must be specified in exactly one call to InstallPathHandler. Calling InstallPathHandler more than once for the same path and mux will result in a panic.

func InstallReadyzHandler Uses

func InstallReadyzHandler(mux mux, checks ...HealthChecker)

InstallReadyzHandler registers handlers for health checking on the path "/readyz" to mux. *All handlers* for mux must be specified in exactly one call to InstallHandler. Calling InstallHandler more than once for the same mux will result in a panic.

type HealthChecker Uses

type HealthChecker interface {
    Name() string
    Check(req *http.Request) error
}

HealthChecker is a named healthz checker.

var LogHealthz HealthChecker = &log{}

LogHealthz returns true if logging is not blocked

var PingHealthz HealthChecker = ping{}

PingHealthz returns true automatically when checked

func NamedCheck Uses

func NamedCheck(name string, check func(r *http.Request) error) HealthChecker

NamedCheck returns a healthz checker for the given name and function.

Package healthz imports 11 packages (graph) and is imported by 134 packages. Updated 2019-09-01. Refresh now. Tools for package owners.