Documentation ¶
Index ¶
- Constants
- Variables
- func SendHeartBeat(channel chan<- *ControllerHeartbeat, component int)
- type ControllerHeartbeat
- type HealthController
- func (hc *HealthController) CheckHealth() bool
- func (hc *HealthController) HandleHeartbeat(beat *ControllerHeartbeat)
- func (hc *HealthController) Handler(w http.ResponseWriter, _ *http.Request)
- func (hc *HealthController) RunCheck(healthChan <-chan *ControllerHeartbeat, stopCh <-chan struct{}, ...)
- func (hc *HealthController) RunServer(stopCh <-chan struct{}, wg *sync.WaitGroup)
- func (hc *HealthController) SetAlive()
- type HealthStats
Constants ¶
View Source
const ( HPCStaticSyncInterval = 60 HPCSyncPeriod = time.Duration(HPCStaticSyncInterval) * time.Second // Defined health checks NetworkRoutesController = iota LoadBalancerController NetworkPolicyController NetworkServicesController HairpinController MetricsController RouteSyncController )
Variables ¶
View Source
var ( HeartBeatCompNames = map[int]string{ NetworkRoutesController: "NetworkRoutesController", LoadBalancerController: "LoadBalancerController", NetworkPolicyController: "NetworkPolicyController", NetworkServicesController: "NetworkServicesController", HairpinController: "HairpinController", MetricsController: "MetricsController", RouteSyncController: "RouteSyncController", } )
Functions ¶
func SendHeartBeat ¶
func SendHeartBeat(channel chan<- *ControllerHeartbeat, component int)
SendHeartBeat sends a heartbeat on the passed channel
Types ¶
type ControllerHeartbeat ¶
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, _ *http.Request)
Handler writes HTTP responses to the health path
func (*HealthController) RunCheck ¶
func (hc *HealthController) RunCheck(healthChan <-chan *ControllerHeartbeat, stopCh <-chan struct{}, wg *sync.WaitGroup)
RunCheck starts the HealthController's check
func (*HealthController) RunServer ¶
func (hc *HealthController) RunServer(stopCh <-chan struct{}, wg *sync.WaitGroup)
RunServer starts the HealthController's server
func (*HealthController) SetAlive ¶
func (hc *HealthController) SetAlive()
type HealthStats ¶
type HealthStats struct { sync.Mutex Healthy bool LoadBalancerControllerAlive time.Time LoadBalancerControllerAliveTTL time.Duration MetricsControllerAlive time.Time NetworkPolicyControllerAlive time.Time NetworkPolicyControllerAliveTTL time.Duration NetworkRoutingControllerAlive time.Time NetworkRoutingControllerAliveTTL time.Duration NetworkServicesControllerAlive time.Time NetworkServicesControllerAliveTTL time.Duration HairpinControllerAlive time.Time HairpinControllerAliveTTL time.Duration RouteSyncControllerAlive time.Time RouteSyncControllerAliveTTL time.Duration }
HealthStats is holds the latest heartbeats
Click to show internal directories.
Click to hide internal directories.