podRestarts

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	RestartObservations map[string][]RestartCountObservation
	Errors              []string
	Namespace           string
	MaxFailuresAllowed  int
	// contains filtered or unexported fields
}

Checker represents a long running pod restart checker.

func New

func New(namespace string) *Checker

New creates a new pod restart checker for a specific namespace, ready to use.

func (*Checker) CheckNamespace

func (prc *Checker) CheckNamespace() string

CheckNamespace returns the namespace of this checker

func (*Checker) CurrentStatus

func (prc *Checker) CurrentStatus() (bool, []string)

CurrentStatus returns the status of the check as of right now

func (*Checker) IdentifyRestartProblems

func (prc *Checker) IdentifyRestartProblems() []string

IdentifyRestartProblems identifies pods that are restarting too much and returns a slice of string errors describing the issue

func (*Checker) Interval

func (prc *Checker) Interval() time.Duration

Interval returns the interval at which this check runs

func (*Checker) Name

func (prc *Checker) Name() string

Name returns the name of this checker

func (*Checker) Run

func (prc *Checker) Run(client *kubernetes.Clientset) error

Run implements the entrypoint for check execution

func (*Checker) Shutdown

func (prc *Checker) Shutdown() error

Shutdown is implemented to satsify the KuberhealthyCheck interface, but no action is necessary.

func (*Checker) Timeout

func (prc *Checker) Timeout() time.Duration

Timeout returns the maximum run time for this check before it times out

type RestartCountObservation

type RestartCountObservation struct {
	Time  time.Time
	Count int32
}

RestartCountObservation keeps track of the number of restarts for a given pod

func (*RestartCountObservation) UpdatePodRestartCheckCount

func (p *RestartCountObservation) UpdatePodRestartCheckCount(r int32)

UpdatePodRestartCheckCount adds new data to PodRestartCheck

Jump to

Keyboard shortcuts

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