Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cpu system pressure eviction dynamic config #74

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,78 @@ spec:
be triggered
type: string
type: object
cpuSystemPressureEvictionConfig:
description: CPUSystemPressureEvictionConfig is the config
for cpu system pressure eviction at node level
properties:
RankingLabels:
additionalProperties:
items:
type: string
type: array
type: object
checkCPUManager:
type: boolean
enableCPUSystemPressureEviction:
type: boolean
evictionCoolDownTime:
description: EvictionCoolDownTime is the cool down duration
of pod eviction
type: string
evictionRankingMetrics:
description: EvictionRankingMetrics is the metric list
for ranking eviction pods
items:
type: string
type: array
gracePeriod:
format: int64
type: integer
loadLowerBoundRatio:
description: LoadLowerBoundRatio is the lower bound ratio
of node, if the load of the node is greater than the
load lower bound repeatedly, the cordon will be triggered
maximum: 1
minimum: 0
type: number
loadUpperBoundRatio:
description: LoadUpperBoundRatio is the upper bound ratio
of node, if the load of the node is greater than the
load upper bound repeatedly, the eviction will be triggered
maximum: 1
minimum: 0
type: number
metricRingSize:
description: MetricRingSize is the size of the load metric
ring
minimum: 1
type: integer
thresholdMetPercentage:
description: ThresholdMetPercentage is the percentage
of the number of times the metric over the upper bound
to the total number of times the metric is measured,
if the percentage is greater than the threshold met
percentage, the eviction or node tainted will be triggered
maximum: 1
minimum: 0
type: number
usageLowerBoundRatio:
description: UsageLowerBoundRatio is the lower bound ratio
of node, if the cpu usage of the node is greater than
the usage lower bound repeatedly, the cordon will be
triggered
maximum: 1
minimum: 0
type: number
usageUpperBoundRatio:
description: UsageUpperBoundRatio is the upper bound ratio
of node, if the cpu usage of the node is greater than
the usage upper bound repeatedly, the eviction will
be triggered
maximum: 1
minimum: 0
type: number
type: object
dryRun:
description: DryRun is the list of eviction plugins to dryRun
'*' means "all dry-run by default" 'foo' means "dry-run
Expand Down Expand Up @@ -228,6 +300,8 @@ spec:
- qos.pod
- priority.pod
- mem.usage.container
- native.qos.pod
- owner.pod
type: string
minItems: 1
type: array
Expand Down Expand Up @@ -341,8 +415,10 @@ spec:
type: string
type: object
systemLoadPressureEvictionConfig:
description: SystemLoadPressureEvictionConfig is the config
for system load eviction
description: "SystemLoadPressureEvictionConfig is the config
for system load eviction \n Deprecated: Please use CPUSystemPressureEvictionConfig
instead to configure params for CPU eviction plugin at node
level"
properties:
coolDownTime:
description: CoolDownTime is the cool-down time of the
Expand Down
76 changes: 75 additions & 1 deletion pkg/apis/config/v1alpha1/adminqos.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,14 @@ type EvictionConfig struct {

// SystemLoadPressureEvictionConfig is the config for system load eviction
// +optional
//
// Deprecated: Please use CPUSystemPressureEvictionConfig instead to configure params for CPU eviction plugin at node level
SystemLoadPressureEvictionConfig *SystemLoadPressureEvictionConfig `json:"systemLoadPressureEvictionConfig,omitempty"`

// CPUSystemPressureEvictionConfig is the config for cpu system pressure eviction at node level
// +optional
CPUSystemPressureEvictionConfig *CPUSystemPressureEvictionConfig `json:"cpuSystemPressureEvictionConfig,omitempty"`

// MemoryPressureEvictionConfig is the config for memory pressure eviction
// +optional
MemoryPressureEvictionConfig *MemoryPressureEvictionConfig `json:"memoryPressureEvictionConfig,omitempty"`
Expand Down Expand Up @@ -466,12 +472,80 @@ type RootfsPressureEvictionConfig struct {
GracePeriod *int64 `json:"gracePeriod,omitempty"`
}

type CPUSystemPressureEvictionConfig struct {
// +optional
EnableCPUSystemPressureEviction *bool `json:"enableCPUSystemPressureEviction,omitempty"`

// LoadUpperBoundRatio is the upper bound ratio of node, if the load
// of the node is greater than the load upper bound repeatedly, the
// eviction will be triggered
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
// +optional
LoadUpperBoundRatio *float64 `json:"loadUpperBoundRatio,omitempty"`

// LoadLowerBoundRatio is the lower bound ratio of node, if the load
// of the node is greater than the load lower bound repeatedly, the
// cordon will be triggered
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
// +optional
LoadLowerBoundRatio *float64 `json:"loadLowerBoundRatio,omitempty"`

// UsageUpperBoundRatio is the upper bound ratio of node, if the cpu usage
// of the node is greater than the usage upper bound repeatedly, the
// eviction will be triggered
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
// +optional
UsageUpperBoundRatio *float64 `json:"usageUpperBoundRatio,omitempty"`

// UsageLowerBoundRatio is the lower bound ratio of node, if the cpu usage
// of the node is greater than the usage lower bound repeatedly, the
// cordon will be triggered
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
// +optional
UsageLowerBoundRatio *float64 `json:"usageLowerBoundRatio,omitempty"`

// ThresholdMetPercentage is the percentage of the number of times the metric
// over the upper bound to the total number of times the metric is measured, if the
// percentage is greater than the threshold met percentage, the eviction or
// node tainted will be triggered
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=1
// +optional
ThresholdMetPercentage *float64 `json:"thresholdMetPercentage,omitempty"`

// MetricRingSize is the size of the load metric ring
// +kubebuilder:validation:Minimum=1
// +optional
MetricRingSize *int `json:"metricRingSize,omitempty"`

// EvictionCoolDownTime is the cool down duration of pod eviction
// +optional
EvictionCoolDownTime *metav1.Duration `json:"evictionCoolDownTime,omitempty"`

// EvictionRankingMetrics is the metric list for ranking eviction pods
// +optional
EvictionRankingMetrics []string `json:"evictionRankingMetrics,omitempty"`

// +optional
GracePeriod *int64 `json:"gracePeriod,omitempty"`

// +optional
CheckCPUManager *bool `json:"checkCPUManager,omitempty"`

// +optional
RankingLabels map[string][]string `json:"RankingLabels,omitempty"`
}

// NumaEvictionRankingMetric is the metrics used to rank pods for eviction at the
// NUMA level
// +kubebuilder:validation:Enum=qos.pod;priority.pod;mem.total.numa.container
type NumaEvictionRankingMetric string

// SystemEvictionRankingMetric is the metrics used to rank pods for eviction at the
// system level
// +kubebuilder:validation:Enum=qos.pod;priority.pod;mem.usage.container
// +kubebuilder:validation:Enum=qos.pod;priority.pod;mem.usage.container;native.qos.pod;owner.pod
type SystemEvictionRankingMetric string
91 changes: 91 additions & 0 deletions pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/client/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading