loadwatcher

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ComponentName = "loadwatcher"
View Source
const TaintKey = "loadwatcher.mittwald.systems/load-exceeded"

Variables

This section is empty.

Functions

This section is empty.

Types

type Evicter

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

func NewEvicter

func NewEvicter(client kubernetes.Interface, threshold int, nodeName string, backoff string) (*Evicter, error)

func (*Evicter) CanEvict

func (e *Evicter) CanEvict() bool

func (*Evicter) EvictPod

func (e *Evicter) EvictPod(evt LoadThresholdEvent) (bool, error)

type LoadThresholdEvent

type LoadThresholdEvent struct {
	LoadThreshold float64
	Load5         float64
	Load15        float64
}

type PodCandidate

type PodCandidate struct {
	Pod   *v1.Pod
	Score int
}

type PodCandidateSet

type PodCandidateSet []PodCandidate

func PodCandidateSetFromPodList

func PodCandidateSetFromPodList(l *v1.PodList) PodCandidateSet

func (PodCandidateSet) Len

func (s PodCandidateSet) Len() int

func (PodCandidateSet) Less

func (s PodCandidateSet) Less(i, j int) bool

func (PodCandidateSet) SelectPodForEviction

func (s PodCandidateSet) SelectPodForEviction() *v1.Pod

func (PodCandidateSet) Swap

func (s PodCandidateSet) Swap(i, j int)

type Tainter

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

func NewTainter

func NewTainter(c kubernetes.Interface, nodeName string) (*Tainter, error)

func (*Tainter) IsNodeTainted

func (t *Tainter) IsNodeTainted() (bool, error)

func (*Tainter) TaintNode

func (t *Tainter) TaintNode(evt LoadThresholdEvent) error

func (*Tainter) UntaintNode

func (t *Tainter) UntaintNode(evt LoadThresholdEvent) error

type Watcher

type Watcher struct {
	TickerInterval time.Duration
	LoadThreshold  float64
	// contains filtered or unexported fields
}

func NewWatcher

func NewWatcher(loadThreshold int) (*Watcher, error)

func (*Watcher) Run

func (w *Watcher) Run(closeChan chan struct{}) (<-chan LoadThresholdEvent, <-chan LoadThresholdEvent, <-chan error)

func (*Watcher) SetAsHigh

func (w *Watcher) SetAsHigh(high bool)

Jump to

Keyboard shortcuts

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