eviction

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	FakeMetricQoSLevel = "qos.pod"
	FakeMetricPriority = "priority.pod"
)

Fake metrics are not fetched from meta-server

View Source
const (
	// DefaultEnableNumaLevelEviction is the default value of whether enable numa-level eviction
	DefaultEnableNumaLevelEviction = true
	// DefaultEnableSystemLevelEviction is the default value of whether enable system-level eviction
	DefaultEnableSystemLevelEviction = true
	// DefaultNumaFreeBelowWatermarkTimesThreshold is the default threshold for the number of times
	// that NUMA's free memory falls below the watermark
	DefaultNumaFreeBelowWatermarkTimesThreshold = 4
	// DefaultSystemKswapdRateThreshold is the default threshold for the rate of kswapd reclaiming rate
	DefaultSystemKswapdRateThreshold = 2000
	// DefaultSystemKswapdRateExceedTimesThreshold is the default threshold for the number of times
	// that the kswapd reclaiming rate exceeds the threshold
	DefaultSystemKswapdRateExceedDurationThreshold = 120
	// DefaultGracePeriod is the default value of grace period
	DefaultGracePeriod int64 = -1
	// DefaultEnableRssOveruseDetection is the default value of whether enable pod-level rss overuse detection
	DefaultEnableRssOveruseDetection = false
	// DefaultRSSOveruseRateThreshold is the default threshold for the rate of rss
	DefaultRSSOveruseRateThreshold = 1.05
)

Variables

View Source
var (
	// FakeEvictionRankingMetrics is fake metrics to rank pods
	FakeEvictionRankingMetrics = []string{FakeMetricQoSLevel, FakeMetricPriority}
	// DefaultNumaEvictionRankingMetrics is the default metrics used to rank pods for eviction at the NUMA level
	DefaultNumaEvictionRankingMetrics = append(FakeEvictionRankingMetrics, consts.MetricsMemTotalPerNumaContainer)
	// DefaultSystemEvictionRankingMetrics is the default metrics used to rank pods for eviction at the system level
	DefaultSystemEvictionRankingMetrics = append(FakeEvictionRankingMetrics, consts.MetricMemUsageContainer)
)

Functions

This section is empty.

Types

type CPUPressureEvictionConfiguration

type CPUPressureEvictionConfiguration struct {
	EnableLoadEviction              bool
	LoadUpperBoundRatio             float64
	LoadThresholdMetPercentage      float64
	LoadMetricRingSize              int
	LoadEvictionCoolDownTime        time.Duration
	EnableSuppressionEviction       bool
	MaxSuppressionToleranceRate     float64
	MinSuppressionToleranceDuration time.Duration
	GracePeriod                     int64
}

func NewCPUPressureEvictionConfiguration

func NewCPUPressureEvictionConfiguration() *CPUPressureEvictionConfiguration

func (*CPUPressureEvictionConfiguration) ApplyConfiguration

func (c *CPUPressureEvictionConfiguration) ApplyConfiguration(conf *crd.DynamicConfigCRD)

type EvictionConfiguration

type EvictionConfiguration struct {
	// Dryrun plugins is the list of plugins to dryrun
	// '*' means "all dryrun by default"
	// 'foo' means "dryrun 'foo'"
	// first item for a particular name wins
	DryRun []string

	*CPUPressureEvictionConfiguration
	*MemoryPressureEvictionConfiguration
	*ReclaimedResourcesEvictionConfiguration
}

func NewEvictionConfiguration

func NewEvictionConfiguration() *EvictionConfiguration

func (*EvictionConfiguration) ApplyConfiguration

func (c *EvictionConfiguration) ApplyConfiguration(conf *crd.DynamicConfigCRD)

type MemoryPressureEvictionConfiguration

type MemoryPressureEvictionConfiguration struct {
	EnableNumaLevelEviction                 bool
	EnableSystemLevelEviction               bool
	NumaFreeBelowWatermarkTimesThreshold    int
	SystemKswapdRateThreshold               int
	SystemKswapdRateExceedDurationThreshold int
	NumaEvictionRankingMetrics              []string
	SystemEvictionRankingMetrics            []string
	EnableRSSOveruseEviction                bool
	RSSOveruseRateThreshold                 float64
	GracePeriod                             int64
}

func NewMemoryPressureEvictionPluginConfiguration

func NewMemoryPressureEvictionPluginConfiguration() *MemoryPressureEvictionConfiguration

func (*MemoryPressureEvictionConfiguration) ApplyConfiguration

func (c *MemoryPressureEvictionConfiguration) ApplyConfiguration(conf *crd.DynamicConfigCRD)

ApplyConfiguration applies dynamic.DynamicConfigCRD to MemoryPressureEvictionConfiguration

type ReclaimedResourcesEvictionConfiguration

type ReclaimedResourcesEvictionConfiguration struct {
	EvictionThreshold native.ResourceThreshold
	GracePeriod       int64
}

func NewReclaimedResourcesEvictionConfiguration

func NewReclaimedResourcesEvictionConfiguration() *ReclaimedResourcesEvictionConfiguration

func (*ReclaimedResourcesEvictionConfiguration) ApplyConfiguration

func (c *ReclaimedResourcesEvictionConfiguration) ApplyConfiguration(conf *crd.DynamicConfigCRD)

Jump to

Keyboard shortcuts

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