Skip to content

Commit

Permalink
Merge pull request #36 from zzzzhhb/system_load_conf
Browse files Browse the repository at this point in the history
enhancement(eviction): system load eviction configuration
  • Loading branch information
waynepeking348 authored Sep 19, 2023
2 parents ed4b485 + 5789b45 commit 3a915f2
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,52 @@ spec:
format: int64
type: integer
type: object
systemLoadPressureEvictionConfig:
description: SystemLoadPressureEvictionConfig is the config
for system load eviction
properties:
coolDownTime:
description: CoolDownTime is the cool-down time of the
plugin evict pods
format: int64
minimum: 1
type: integer
gracePeriod:
description: GracePeriod is the grace period of pod deletion
format: int64
type: integer
hardThreshold:
description: HardThreshold is the hard threshold of system
load pressure, it should be an integral multiple of
100, which means the real threshold is (SoftThreshold
/ 100) * CoreNumber
format: int64
type: integer
historySize:
description: HistorySize is the size of the load metric
ring, which is used to calculate the system load
format: int64
minimum: 1
type: integer
softThreshold:
description: SoftThreshold is the soft threshold of system
load pressure, it should be an integral multiple of
100, which means the real threshold is (SoftThreshold
/ 100) * CoreNumber
format: int64
type: integer
syncPeriod:
description: SyncPeriod is the interval in seconds of
the plugin fetch the load information
format: int64
minimum: 1
type: integer
thresholdMetPercentage:
description: the plugin considers the node is facing load
pressure only when the ratio of load history which is
greater than threshold is greater than this percentage
type: number
type: object
type: object
reclaimedResourceConfig:
description: ReclaimedResourceConfig is a configuration for reclaim
Expand Down
40 changes: 40 additions & 0 deletions pkg/apis/config/v1alpha1/adminqos.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ type EvictionConfig struct {
// +optional
CPUPressureEvictionConfig *CPUPressureEvictionConfig `json:"cpuPressureEvictionConfig,omitempty"`

// SystemLoadPressureEvictionConfig is the config for system load eviction
// +optional
SystemLoadPressureEvictionConfig *SystemLoadPressureEvictionConfig `json:"systemLoadPressureEvictionConfig,omitempty"`

// MemoryPressureEvictionConfig is the config for memory pressure eviction
// +optional
MemoryPressureEvictionConfig *MemoryPressureEvictionConfig `json:"memoryPressureEvictionConfig,omitempty"`
Expand Down Expand Up @@ -320,6 +324,42 @@ type MemoryPressureEvictionConfig struct {
GracePeriod *int64 `json:"gracePeriod,omitempty"`
}

type SystemLoadPressureEvictionConfig struct {
// SoftThreshold is the soft threshold of system load pressure, it should be an integral multiple of 100, which means
// the real threshold is (SoftThreshold / 100) * CoreNumber
// +optional
SoftThreshold *int64 `json:"softThreshold,omitempty"`

// HardThreshold is the hard threshold of system load pressure, it should be an integral multiple of 100, which means
// the real threshold is (SoftThreshold / 100) * CoreNumber
// +optional
HardThreshold *int64 `json:"hardThreshold,omitempty"`

// HistorySize is the size of the load metric ring, which is used to calculate the system load
// +kubebuilder:validation:Minimum=1
// +optional
HistorySize *int64 `json:"historySize,omitempty"`

// SyncPeriod is the interval in seconds of the plugin fetch the load information
// +kubebuilder:validation:Minimum=1
// +optional
SyncPeriod *int64 `json:"syncPeriod,omitempty"`

// CoolDownTime is the cool-down time of the plugin evict pods
// +kubebuilder:validation:Minimum=1
// +optional
CoolDownTime *int64 `json:"coolDownTime,omitempty"`

// GracePeriod is the grace period of pod deletion
// +optional
GracePeriod *int64 `json:"gracePeriod,omitempty"`

// the plugin considers the node is facing load pressure only when the ratio of load history which is greater than
// threshold is greater than this percentage
// +optional
ThresholdMetPercentage *float64 `json:"thresholdMetPercentage,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
Expand Down
56 changes: 56 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.

0 comments on commit 3a915f2

Please sign in to comment.