node

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// when initializing or unable to detect state
	Unknown = 0
	// pod is ready
	Ready = 1
	// pod is in unready state for > X seconds, but < Y seconds
	Unready = 2
	// pod is in unready state for > Y seconds
	PermanentDown = 3
)

constants for state monitoring

View Source
const (
	UnreadyTimeout       = 60
	PermanentDownTimeout = 120
	SleepBeforeNextPoll  = 30
	// StartupProtectionMultiplier will be applied to Timeouts if POD is under startup protection
	StartupProtectionMultiplier = 5
)

timeout constant seconds

Variables

This section is empty.

Functions

This section is empty.

Types

type ServicesStateMonitor

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

ServicesStateMonitor contains methods to get Node service health state

func NewNodeServicesStateMonitor

func NewNodeServicesStateMonitor(client *k8s.KubeClient, logger *logrus.Logger) *ServicesStateMonitor

NewNodeServicesStateMonitor instantiates health monitor

func (*ServicesStateMonitor) GetReadyPods

func (n *ServicesStateMonitor) GetReadyPods() []string

GetReadyPods obtains list of Ready pods. Blocking for read

func (*ServicesStateMonitor) GetUnreadyPods

func (n *ServicesStateMonitor) GetUnreadyPods() []string

GetUnreadyPods obtains list of Unready pods. Blocking for read

func (*ServicesStateMonitor) Run

func (n *ServicesStateMonitor) Run()

Run inits map node id -> health

func (*ServicesStateMonitor) UpdateNodeHealthCache

func (n *ServicesStateMonitor) UpdateNodeHealthCache()

UpdateNodeHealthCache check if node service pods are ready and update nodeHealthMap

Jump to

Keyboard shortcuts

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