Skip to content

Commit 162cda4

Browse files
authored
Merge pull request #6068 from jabellard/control-plane-priority-class
Add Support for Component Priority Class Configuration in Karmada Operator
2 parents 5599b22 + 954ee76 commit 162cda4

File tree

18 files changed

+273
-83
lines changed

18 files changed

+273
-83
lines changed

charts/karmada-operator/crds/operator.karmada.io_karmadas.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ spec:
153153
items:
154154
type: string
155155
type: array
156+
priorityClassName:
157+
default: system-node-critical
158+
description: |-
159+
PriorityClassName specifies the priority class name for the component.
160+
If not specified, it defaults to "system-node-critical".
161+
type: string
156162
replicas:
157163
description: |-
158164
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2465,6 +2471,12 @@ spec:
24652471
and services.
24662472
More info: http://kubernetes.io/docs/user-guide/labels
24672473
type: object
2474+
priorityClassName:
2475+
default: system-node-critical
2476+
description: |-
2477+
PriorityClassName specifies the priority class name for the component.
2478+
If not specified, it defaults to "system-node-critical".
2479+
type: string
24682480
replicas:
24692481
description: |-
24702482
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2625,6 +2637,12 @@ spec:
26252637
and services.
26262638
More info: http://kubernetes.io/docs/user-guide/labels
26272639
type: object
2640+
priorityClassName:
2641+
default: system-node-critical
2642+
description: |-
2643+
PriorityClassName specifies the priority class name for the component.
2644+
If not specified, it defaults to "system-node-critical".
2645+
type: string
26282646
replicas:
26292647
description: |-
26302648
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2776,6 +2794,12 @@ spec:
27762794
and services.
27772795
More info: http://kubernetes.io/docs/user-guide/labels
27782796
type: object
2797+
priorityClassName:
2798+
default: system-node-critical
2799+
description: |-
2800+
PriorityClassName specifies the priority class name for the component.
2801+
If not specified, it defaults to "system-node-critical".
2802+
type: string
27792803
replicas:
27802804
description: |-
27812805
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2900,6 +2924,12 @@ spec:
29002924
and services.
29012925
More info: http://kubernetes.io/docs/user-guide/labels
29022926
type: object
2927+
priorityClassName:
2928+
default: system-node-critical
2929+
description: |-
2930+
PriorityClassName specifies the priority class name for the component.
2931+
If not specified, it defaults to "system-node-critical".
2932+
type: string
29032933
replicas:
29042934
description: |-
29052935
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3024,6 +3054,12 @@ spec:
30243054
and services.
30253055
More info: http://kubernetes.io/docs/user-guide/labels
30263056
type: object
3057+
priorityClassName:
3058+
default: system-node-critical
3059+
description: |-
3060+
PriorityClassName specifies the priority class name for the component.
3061+
If not specified, it defaults to "system-node-critical".
3062+
type: string
30273063
replicas:
30283064
description: |-
30293065
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3156,6 +3192,12 @@ spec:
31563192
and services.
31573193
More info: http://kubernetes.io/docs/user-guide/labels
31583194
type: object
3195+
priorityClassName:
3196+
default: system-node-critical
3197+
description: |-
3198+
PriorityClassName specifies the priority class name for the component.
3199+
If not specified, it defaults to "system-node-critical".
3200+
type: string
31593201
replicas:
31603202
description: |-
31613203
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3280,6 +3322,12 @@ spec:
32803322
and services.
32813323
More info: http://kubernetes.io/docs/user-guide/labels
32823324
type: object
3325+
priorityClassName:
3326+
default: system-node-critical
3327+
description: |-
3328+
PriorityClassName specifies the priority class name for the component.
3329+
If not specified, it defaults to "system-node-critical".
3330+
type: string
32833331
replicas:
32843332
description: |-
32853333
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3404,6 +3452,12 @@ spec:
34043452
and services.
34053453
More info: http://kubernetes.io/docs/user-guide/labels
34063454
type: object
3455+
priorityClassName:
3456+
default: system-node-critical
3457+
description: |-
3458+
PriorityClassName specifies the priority class name for the component.
3459+
If not specified, it defaults to "system-node-critical".
3460+
type: string
34073461
replicas:
34083462
description: |-
34093463
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3574,6 +3628,12 @@ spec:
35743628
and services.
35753629
More info: http://kubernetes.io/docs/user-guide/labels
35763630
type: object
3631+
priorityClassName:
3632+
default: system-node-critical
3633+
description: |-
3634+
PriorityClassName specifies the priority class name for the component.
3635+
If not specified, it defaults to "system-node-critical".
3636+
type: string
35773637
replicas:
35783638
description: |-
35793639
Number of desired pods. This is a pointer to distinguish between explicit

operator/config/crds/operator.karmada.io_karmadas.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ spec:
153153
items:
154154
type: string
155155
type: array
156+
priorityClassName:
157+
default: system-node-critical
158+
description: |-
159+
PriorityClassName specifies the priority class name for the component.
160+
If not specified, it defaults to "system-node-critical".
161+
type: string
156162
replicas:
157163
description: |-
158164
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2465,6 +2471,12 @@ spec:
24652471
and services.
24662472
More info: http://kubernetes.io/docs/user-guide/labels
24672473
type: object
2474+
priorityClassName:
2475+
default: system-node-critical
2476+
description: |-
2477+
PriorityClassName specifies the priority class name for the component.
2478+
If not specified, it defaults to "system-node-critical".
2479+
type: string
24682480
replicas:
24692481
description: |-
24702482
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2625,6 +2637,12 @@ spec:
26252637
and services.
26262638
More info: http://kubernetes.io/docs/user-guide/labels
26272639
type: object
2640+
priorityClassName:
2641+
default: system-node-critical
2642+
description: |-
2643+
PriorityClassName specifies the priority class name for the component.
2644+
If not specified, it defaults to "system-node-critical".
2645+
type: string
26282646
replicas:
26292647
description: |-
26302648
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2776,6 +2794,12 @@ spec:
27762794
and services.
27772795
More info: http://kubernetes.io/docs/user-guide/labels
27782796
type: object
2797+
priorityClassName:
2798+
default: system-node-critical
2799+
description: |-
2800+
PriorityClassName specifies the priority class name for the component.
2801+
If not specified, it defaults to "system-node-critical".
2802+
type: string
27792803
replicas:
27802804
description: |-
27812805
Number of desired pods. This is a pointer to distinguish between explicit
@@ -2900,6 +2924,12 @@ spec:
29002924
and services.
29012925
More info: http://kubernetes.io/docs/user-guide/labels
29022926
type: object
2927+
priorityClassName:
2928+
default: system-node-critical
2929+
description: |-
2930+
PriorityClassName specifies the priority class name for the component.
2931+
If not specified, it defaults to "system-node-critical".
2932+
type: string
29032933
replicas:
29042934
description: |-
29052935
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3024,6 +3054,12 @@ spec:
30243054
and services.
30253055
More info: http://kubernetes.io/docs/user-guide/labels
30263056
type: object
3057+
priorityClassName:
3058+
default: system-node-critical
3059+
description: |-
3060+
PriorityClassName specifies the priority class name for the component.
3061+
If not specified, it defaults to "system-node-critical".
3062+
type: string
30273063
replicas:
30283064
description: |-
30293065
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3156,6 +3192,12 @@ spec:
31563192
and services.
31573193
More info: http://kubernetes.io/docs/user-guide/labels
31583194
type: object
3195+
priorityClassName:
3196+
default: system-node-critical
3197+
description: |-
3198+
PriorityClassName specifies the priority class name for the component.
3199+
If not specified, it defaults to "system-node-critical".
3200+
type: string
31593201
replicas:
31603202
description: |-
31613203
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3280,6 +3322,12 @@ spec:
32803322
and services.
32813323
More info: http://kubernetes.io/docs/user-guide/labels
32823324
type: object
3325+
priorityClassName:
3326+
default: system-node-critical
3327+
description: |-
3328+
PriorityClassName specifies the priority class name for the component.
3329+
If not specified, it defaults to "system-node-critical".
3330+
type: string
32833331
replicas:
32843332
description: |-
32853333
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3404,6 +3452,12 @@ spec:
34043452
and services.
34053453
More info: http://kubernetes.io/docs/user-guide/labels
34063454
type: object
3455+
priorityClassName:
3456+
default: system-node-critical
3457+
description: |-
3458+
PriorityClassName specifies the priority class name for the component.
3459+
If not specified, it defaults to "system-node-critical".
3460+
type: string
34073461
replicas:
34083462
description: |-
34093463
Number of desired pods. This is a pointer to distinguish between explicit
@@ -3574,6 +3628,12 @@ spec:
35743628
and services.
35753629
More info: http://kubernetes.io/docs/user-guide/labels
35763630
type: object
3631+
priorityClassName:
3632+
default: system-node-critical
3633+
description: |-
3634+
PriorityClassName specifies the priority class name for the component.
3635+
If not specified, it defaults to "system-node-critical".
3636+
type: string
35773637
replicas:
35783638
description: |-
35793639
Number of desired pods. This is a pointer to distinguish between explicit

operator/pkg/apis/operator/v1alpha1/type.go

+6
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,12 @@ type CommonSettings struct {
648648
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
649649
// +optional
650650
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
651+
652+
// PriorityClassName specifies the priority class name for the component.
653+
// If not specified, it defaults to "system-node-critical".
654+
// +kubebuilder:default="system-node-critical"
655+
// +optional
656+
PriorityClassName string `json:"priorityClassName,omitempty"`
651657
}
652658

653659
// Image allows to customize the image used for components.

operator/pkg/controlplane/apiserver/apiserver.go

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func installKarmadaAPIServer(client clientset.Interface, cfg *operatorv1alpha1.K
7979
}
8080

8181
patcher.NewPatcher().WithAnnotations(cfg.Annotations).WithLabels(cfg.Labels).
82+
WithPriorityClassName(cfg.CommonSettings.PriorityClassName).
8283
WithExtraArgs(cfg.ExtraArgs).WithExtraVolumeMounts(cfg.ExtraVolumeMounts).
8384
WithExtraVolumes(cfg.ExtraVolumes).WithResources(cfg.Resources).ForDeployment(apiserverDeployment)
8485

@@ -143,6 +144,7 @@ func installKarmadaAggregatedAPIServer(client clientset.Interface, cfg *operator
143144
}
144145

145146
patcher.NewPatcher().WithAnnotations(cfg.Annotations).WithLabels(cfg.Labels).
147+
WithPriorityClassName(cfg.CommonSettings.PriorityClassName).
146148
WithExtraArgs(cfg.ExtraArgs).WithFeatureGates(featureGates).WithResources(cfg.Resources).ForDeployment(aggregatedAPIServerDeployment)
147149

148150
if err := apiclient.CreateOrUpdateDeployment(client, aggregatedAPIServerDeployment); err != nil {

0 commit comments

Comments
 (0)