healthcheck

package
v1.11.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

README

Package proxy/healthcheck is copied from [k8s.io/kubernetes@/v1.24.4](https://github.com/kubernetes/kubernetes/tree/v1.24.4) to avoid importing the whole kubernetes repo.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeServiceHealthServer

type FakeServiceHealthServer struct{}

FakeServiceHealthServer is a fake ServiceHealthServer for test programs

func (FakeServiceHealthServer) SyncEndpoints

func (fake FakeServiceHealthServer) SyncEndpoints(_ map[types.NamespacedName]int) error

SyncEndpoints is part of ServiceHealthServer

func (FakeServiceHealthServer) SyncServices

func (fake FakeServiceHealthServer) SyncServices(_ map[types.NamespacedName]uint16) error

SyncServices is part of ServiceHealthServer

type ServiceHealthServer

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

func NewFakeServiceHealthServer() ServiceHealthServer

NewFakeServiceHealthServer allocates a new fake service healthcheck server manager

func NewServiceHealthServer

func NewServiceHealthServer(hostname string, recorder events.EventRecorder, nodePortAddresses []string) ServiceHealthServer

NewServiceHealthServer allocates a new service healthcheck server manager

Jump to

Keyboard shortcuts

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