k8shealthz

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

README

CircleCI

k8shealthz

Package k8shealthz provides microkit endpoints for Kubernetes health checks.

Documentation

Index

Constants

View Source
const (
	// Description describes which functionality this health check implements.
	Description = "Ensure Kubernetes API availability."
	// Name is the identifier of the health check. This can be used for emitting
	// metrics.
	Name = "k8s"
	// SuccessMessage is the message returned in case the health check did not
	// fail.
	SuccessMessage = "all good"
	// Timeout is the time being waited until timing out health check, which
	// renders its result unsuccessful.
	Timeout = 5 * time.Second
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	// Dependencies.
	K8sClient kubernetes.Interface
	Logger    micrologger.Logger

	// Settings.
	Timeout time.Duration
}

Config represents the configuration used to create a healthz service.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig provides a default configuration to create a new healthz service by best effort.

type Service

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

Service implements the healthz service interface.

func New

func New(config Config) (*Service, error)

New creates a new configured healthz service.

func (*Service) GetHealthz

func (s *Service) GetHealthz(ctx context.Context) (healthz.Response, error)

GetHealthz implements the health check for Kubernetes.

Jump to

Keyboard shortcuts

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