multicooker

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ComponentName = "multicooker"
View Source
const TaintKey = "multicooker/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, nodeName string, backoff string, minPodAge string) (*Evicter, error)

func (*Evicter) CanEvict

func (e *Evicter) CanEvict() bool

func (*Evicter) EvictPod

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

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(minPodAge time.Duration) *v1.Pod

func (PodCandidateSet) Swap

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

type PressureThresholdEvent

type PressureThresholdEvent struct {
	Message         string
	MeticValue      float64
	IsCurrentlyHigh bool
}

type Tainter

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

func NewTainter

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

func (*Tainter) IsMulticookerDisabled

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

func (*Tainter) IsNodeTainted

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

func (*Tainter) TaintNode

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

func (*Tainter) UntaintNode

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

type Watcher

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

func NewWatcher

func NewWatcher(pressureThreshold float64, nodeName string) (*Watcher, error)

func (*Watcher) CollectMetricsData

func (w *Watcher) CollectMetricsData(closeChan chan struct{}, useAvarage bool, metricChan chan [3]float64, errorChan chan error)

func (*Watcher) Run

func (w *Watcher) Run(closeChan chan struct{}, useAvarage bool, targetMetic int) (<-chan PressureThresholdEvent, <-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