diff --git a/apis/slo/v1alpha1/nodeslo_types.go b/apis/slo/v1alpha1/nodeslo_types.go index d52645e0f..113311e56 100644 --- a/apis/slo/v1alpha1/nodeslo_types.go +++ b/apis/slo/v1alpha1/nodeslo_types.go @@ -165,7 +165,6 @@ type ResourceThresholdStrategy struct { // +kubebuilder:validation:Maximum=100 // +kubebuilder:validation:Minimum=0 CPUSuppressThresholdPercent *int64 `json:"cpuSuppressThresholdPercent,omitempty"` - // CPUSuppressPolicy CPUSuppressPolicy CPUSuppressPolicy `json:"cpuSuppressPolicy,omitempty"` @@ -174,11 +173,22 @@ type ResourceThresholdStrategy struct { // +kubebuilder:validation:Maximum=100 // +kubebuilder:validation:Minimum=0 MemoryEvictThresholdPercent *int64 `json:"memoryEvictThresholdPercent,omitempty"` - // lower: memory release util usage under MemoryEvictLowerPercent, default = MemoryEvictThresholdPercent - 2 // +kubebuilder:validation:Maximum=100 // +kubebuilder:validation:Minimum=0 MemoryEvictLowerPercent *int64 `json:"memoryEvictLowerPercent,omitempty"` + + // cpu evict threshold percentage (0,100), default = 70 + // +kubebuilder:default=70 + // +kubebuilder:validation:Maximum=100 + // +kubebuilder:validation:Minimum=0 + CPUEvictThresholdPercent *int64 `json:"cpuEvictThresholdPercent,omitempty"` + // if be CPU RealLimit/allocatedLimit > CPUEvictBESatisfactionUpperPercent, then stop evict BE pods + CPUEvictBESatisfactionUpperPercent *int64 `json:"cpuEvictBESatisfactionUpperPercent,omitempty"` + // if be CPU (RealLimit/allocatedLimit < CPUEvictBESatisfactionLowerPercent and usage nearly 100%) continue CPUEvictTimeWindowSeconds,then start evict + CPUEvictBESatisfactionLowerPercent *int64 `json:"cpuEvictBESatisfactionLowerPercent,omitempty"` + // cpu evict start after continue avg(cpuusage) > CPUEvictThresholdPercent in seconds + CPUEvictTimeWindowSeconds *int64 `json:"cpuEvictTimeWindowSeconds,omitempty"` } // ResctrlQoSCfg stores node-level config of resctrl qos diff --git a/apis/slo/v1alpha1/zz_generated.deepcopy.go b/apis/slo/v1alpha1/zz_generated.deepcopy.go index 68be5468f..ed0bbd0c4 100644 --- a/apis/slo/v1alpha1/zz_generated.deepcopy.go +++ b/apis/slo/v1alpha1/zz_generated.deepcopy.go @@ -656,6 +656,26 @@ func (in *ResourceThresholdStrategy) DeepCopyInto(out *ResourceThresholdStrategy *out = new(int64) **out = **in } + if in.CPUEvictThresholdPercent != nil { + in, out := &in.CPUEvictThresholdPercent, &out.CPUEvictThresholdPercent + *out = new(int64) + **out = **in + } + if in.CPUEvictBESatisfactionUpperPercent != nil { + in, out := &in.CPUEvictBESatisfactionUpperPercent, &out.CPUEvictBESatisfactionUpperPercent + *out = new(int64) + **out = **in + } + if in.CPUEvictBESatisfactionLowerPercent != nil { + in, out := &in.CPUEvictBESatisfactionLowerPercent, &out.CPUEvictBESatisfactionLowerPercent + *out = new(int64) + **out = **in + } + if in.CPUEvictTimeWindowSeconds != nil { + in, out := &in.CPUEvictTimeWindowSeconds, &out.CPUEvictTimeWindowSeconds + *out = new(int64) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceThresholdStrategy. diff --git a/config/crd/bases/slo.koordinator.sh_nodeslos.yaml b/config/crd/bases/slo.koordinator.sh_nodeslos.yaml index e32dac50f..79f59d648 100644 --- a/config/crd/bases/slo.koordinator.sh_nodeslos.yaml +++ b/config/crd/bases/slo.koordinator.sh_nodeslos.yaml @@ -809,6 +809,30 @@ spec: resourceUsedThresholdWithBE: description: BE pods will be limited if node resource usage overload properties: + cpuEvictBESatisfactionLowerPercent: + description: if be CPU (RealLimit/allocatedLimit < CPUEvictBESatisfactionLowerPercent + and usage nearly 100%) continue CPUEvictTimeWindowSeconds,then + start evict + format: int64 + type: integer + cpuEvictBESatisfactionUpperPercent: + description: if be CPU RealLimit/allocatedLimit > CPUEvictBESatisfactionUpperPercent, + then stop evict BE pods + format: int64 + type: integer + cpuEvictThresholdPercent: + default: 70 + description: cpu evict threshold percentage (0,100), default = + 70 + format: int64 + maximum: 100 + minimum: 0 + type: integer + cpuEvictTimeWindowSeconds: + description: cpu evict start after continue avg(cpuusage) > CPUEvictThresholdPercent + in seconds + format: int64 + type: integer cpuSuppressPolicy: description: CPUSuppressPolicy type: string