Skip to content

Commit 6fcacd6

Browse files
committed
feat(agent): support cpu burst
Signed-off-by: caohe <caohe9603@gmail.com>
1 parent ae613a8 commit 6fcacd6

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

config/crd/bases/config.katalyst.kubewharf.io_adminqosconfigurations.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,26 @@ spec:
527527
type: number
528528
type: object
529529
type: object
530+
fineGrainedResourceConfig:
531+
description: FineGrainedResourceConfig stores configurations related
532+
to fine-grained resource management
533+
properties:
534+
cpuBurstConfig:
535+
description: CPUBurstConfig stores cpu burst related configurations
536+
properties:
537+
cpuBurstPercent:
538+
description: CPUBurstPercent identifies the upper limit
539+
of the allowed burst percent optional
540+
format: int64
541+
minimum: 0
542+
type: integer
543+
cpuBurstPolicy:
544+
description: 'CPUBurstPolicy indicates which policy to
545+
enable the cpu burst feature. Optional values: none/static/dynamic
546+
Default value: none optional'
547+
type: string
548+
type: object
549+
type: object
530550
reclaimedResourceConfig:
531551
description: ReclaimedResourceConfig is a configuration for reclaim
532552
resource

pkg/apis/config/v1alpha1/adminqos.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ type AdminQoSConfig struct {
7575

7676
// +optional
7777
AdvisorConfig *AdvisorConfig `json:"advisorConfig,omitempty"`
78+
79+
// FineGrainedResourceConfig stores configurations related to fine-grained resource management
80+
// +optional
81+
FineGrainedResourceConfig *FineGrainedResourceConfig `json:"fineGrainedResourceConfig,omitempty"`
7882
}
7983

8084
type ReclaimedResourceConfig struct {
@@ -128,6 +132,12 @@ type AdvisorConfig struct {
128132
MemoryAdvisorConfig *MemoryAdvisorConfig `json:"memoryAdvisorConfig,omitempty"`
129133
}
130134

135+
type FineGrainedResourceConfig struct {
136+
// CPUBurstConfig stores cpu burst related configurations
137+
// +optional
138+
CPUBurstConfig *CPUBurstConfig `json:"cpuBurstConfig,omitempty"`
139+
}
140+
131141
type CPUAdvisorConfig struct {
132142
// AllowSharedCoresOverlapReclaimedCores is a flag, when enabled,
133143
// we will rely on kernel features to ensure that shared_cores pods can suppress and preempt reclaimed_cores pods.
@@ -621,3 +631,16 @@ type NumaEvictionRankingMetric string
621631
// system level
622632
// +kubebuilder:validation:Enum=qos.pod;priority.pod;mem.usage.container;native.qos.pod;owner.pod
623633
type SystemEvictionRankingMetric string
634+
635+
type CPUBurstConfig struct {
636+
// CPUBurstPolicy indicates which policy to enable the cpu burst feature.
637+
// Optional values: none/static/dynamic
638+
// Default value: none
639+
// optional
640+
CPUBurstPolicy string `json:"cpuBurstPolicy,omitempty"`
641+
642+
// CPUBurstPercent identifies the upper limit of the allowed burst percent
643+
// +kubebuilder:validation:Minimum=0
644+
// optional
645+
CPUBurstPercent *int64 `json:"cpuBurstPercent,omitempty"`
646+
}

pkg/apis/config/v1alpha1/zz_generated.deepcopy.go

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/consts/qos.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ const (
107107
//
108108
// - this enhancement is only supported for shared-cores, for now and foreseeable future
109109
PodAnnotationCPUEnhancementSuppressionToleranceRate = "suppression_tolerance_rate"
110+
111+
// PodAnnotationCPUEnhancementCPUBurstPolicy indicates which policy to enable the cpu burst feature.
112+
// Optional values: none/static/dynamic
113+
// Default value: none
114+
PodAnnotationCPUEnhancementCPUBurstPolicy = "cpu_burst_policy"
115+
116+
// PodAnnotationCPUEnhancementCPUBurstPolicyNone is the value of cpu burst policy none
117+
PodAnnotationCPUEnhancementCPUBurstPolicyNone = "none"
118+
119+
// PodAnnotationCPUEnhancementCPUBurstPolicyStatic is the value of cpu burst policy static
120+
PodAnnotationCPUEnhancementCPUBurstPolicyStatic = "static"
121+
122+
// PodAnnotationCPUEnhancementCPUBurstPolicyDynamic is the value of cpu burst policy dynamic
123+
PodAnnotationCPUEnhancementCPUBurstPolicyDynamic = "dynamic"
124+
125+
// PodAnnotationCPUEnhancementCPUBurstPercent identifies the upper limit of the allowed burst percent
126+
PodAnnotationCPUEnhancementCPUBurstPercent = "cpu_burst_percent"
110127
)
111128

112129
// const variables for pod annotations about qos level enhancement in network

0 commit comments

Comments
 (0)