healthcheck

package
v0.2.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendHeartBeat

func SendHeartBeat(channel chan<- *ControllerHeartbeat, controller string)

SendHeartBeat sends a heartbeat on the passed channel

Types

type ControllerHeartbeat

type ControllerHeartbeat struct {
	Component     string
	LastHeartBeat time.Time
}

ControllerHeartbeat is the structure to hold the heartbeats sent by controllers

type HealthController

type HealthController struct {
	HealthPort  uint16
	HTTPEnabled bool
	Status      HealthStats
	Config      *options.KubeRouterConfig
}

HealthController reports the health of the controller loops as a http endpoint

func NewHealthController

func NewHealthController(config *options.KubeRouterConfig) (*HealthController, error)

NewHealthController creates a new health controller and returns a reference to it

func (*HealthController) CheckHealth

func (hc *HealthController) CheckHealth() bool

CheckHealth evaluates the time since last heartbeat to decide if the controller is running or not

func (*HealthController) HandleHeartbeat

func (hc *HealthController) HandleHeartbeat(beat *ControllerHeartbeat)

HandleHeartbeat handles received heartbeats on the health channel

func (*HealthController) Handler

func (hc *HealthController) Handler(w http.ResponseWriter, req *http.Request)

Handler writes HTTP responses to the health path

func (*HealthController) Run

func (hc *HealthController) Run(healthChan <-chan *ControllerHeartbeat, stopCh <-chan struct{}, wg *sync.WaitGroup) error

Run starts the HealthController

type HealthStats

type HealthStats struct {
	sync.Mutex
	Healthy                        bool
	MetricsControllerAlive         time.Time
	NetworkPolicyControllerAlive   time.Time
	NetworkRoutingControllerAlive  time.Time
	NetworkServicesControllerAlive time.Time
}

HealthStats is holds the latest heartbeats

Jump to

Keyboard shortcuts

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