Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultEvictionHard includes default options for kubelet hard eviction // ref: https://github.com/kubernetes/kubernetes/blob/ec39cc2eafffa51b3267e3bd64fbd2598c0db94d/pkg/kubelet/apis/config/v1beta1/defaults_linux.go#L21 DefaultEvictionHard = map[string]string{ string(SignalMemoryAvailable): "100Mi", string(SignalNodeFsAvailable): "10%", string(SignalNodeFsInodesFree): "5%", string(SignalImageFsAvailable): "15%", } )
View Source
var OpForSignal = map[Signal]ThresholdOperator{ SignalMemoryAvailable: OpLessThan, SignalNodeFsAvailable: OpLessThan, SignalNodeFsInodesFree: OpLessThan, SignalImageFsAvailable: OpLessThan, SignalImageFsInodesFree: OpLessThan, SignalPIDAvailable: OpLessThan, }
OpForSignal maps Signals to ThresholdOperators. Today, the only supported operator is "LessThan".
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config interface { GetHard() ThresholdMap String() string }
Config holds information about how eviction is configured.
type Signal ¶
type Signal string
Signal defines a signal that can trigger eviction of pods on a node.
const ( // SignalMemoryAvailable is memory available (i.e. capacity - workingSet), in bytes. SignalMemoryAvailable Signal = "memory.available" // SignalNodeFsAvailable is amount of storage available on filesystem that kubelet uses for volumes, daemon logs, etc. SignalNodeFsAvailable Signal = "nodefs.available" // SignalNodeFsInodesFree is amount of storage available on filesystem that container runtime uses for storing images and container writable layers. SignalNodeFsInodesFree Signal = "nodefs.inodesFree" // SignalImageFsAvailable is amount of storage available on filesystem that container runtime uses for storing images and container writable layers. SignalImageFsAvailable Signal = "imagefs.available" // SignalImageFsInodesFree is amount of inodes available on filesystem that container runtime uses for storing images and container writable layers. SignalImageFsInodesFree Signal = "imagefs.inodesFree" // SignalAllocatableMemoryAvailable is amount of memory available for pod allocation (i.e. allocatable - workingSet (of pods), in bytes) // SignalAllocatableMemoryAvailable Signal = "allocatableMemory.available" // SignalPIDAvailable is amount of PID available for pod allocation SignalPIDAvailable Signal = "pid.available" )
type Threshold ¶
type Threshold struct { // Signal defines the entity that was measured. Signal Signal // Operator represents a relationship of a signal to a value. Operator ThresholdOperator // Value is the threshold the resource is evaluated against. Value ThresholdValue }
Threshold defines a metric for when eviction should occur.
type ThresholdMap ¶
func (ThresholdMap) GetImageFsAvailable ¶
func (m ThresholdMap) GetImageFsAvailable() *Threshold
func (ThresholdMap) GetMemoryAvailable ¶
func (m ThresholdMap) GetMemoryAvailable() *Threshold
func (ThresholdMap) GetNodeFsAvailable ¶
func (m ThresholdMap) GetNodeFsAvailable() *Threshold
func (ThresholdMap) GetNodeFsInodesFree ¶
func (m ThresholdMap) GetNodeFsInodesFree() *Threshold
type ThresholdOperator ¶
type ThresholdOperator string
ThresholdOperator is the operator used to express a Threshold.
const ( // OpLessThan is the operator that expresses a less than operator. OpLessThan ThresholdOperator = "LessThan" )
type ThresholdValue ¶
type ThresholdValue struct { // Quantity is a quantity associated with the signal Quantity *resource.Quantity // Percentage represents the usage percentage over the total resource Percentage float32 }
ThresholdValue is a value holder that abstracts literal versus percentage based quantity
Click to show internal directories.
Click to hide internal directories.