Skip to content

Commit

Permalink
Merge pull request #6068 from jabellard/control-plane-priority-class
Browse files Browse the repository at this point in the history
Add Support for Component Priority Class Configuration in Karmada Operator
  • Loading branch information
karmada-bot authored Jan 26, 2025
2 parents 5599b22 + 954ee76 commit 162cda4
Show file tree
Hide file tree
Showing 18 changed files with 273 additions and 83 deletions.
60 changes: 60 additions & 0 deletions charts/karmada-operator/crds/operator.karmada.io_karmadas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ spec:
items:
type: string
type: array
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2465,6 +2471,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2625,6 +2637,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2776,6 +2794,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2900,6 +2924,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3024,6 +3054,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3156,6 +3192,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3280,6 +3322,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3404,6 +3452,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3574,6 +3628,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down
60 changes: 60 additions & 0 deletions operator/config/crds/operator.karmada.io_karmadas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ spec:
items:
type: string
type: array
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2465,6 +2471,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2625,6 +2637,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2776,6 +2794,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -2900,6 +2924,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3024,6 +3054,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3156,6 +3192,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3280,6 +3322,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3404,6 +3452,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down Expand Up @@ -3574,6 +3628,12 @@ spec:
and services.
More info: http://kubernetes.io/docs/user-guide/labels
type: object
priorityClassName:
default: system-node-critical
description: |-
PriorityClassName specifies the priority class name for the component.
If not specified, it defaults to "system-node-critical".
type: string
replicas:
description: |-
Number of desired pods. This is a pointer to distinguish between explicit
Expand Down
6 changes: 6 additions & 0 deletions operator/pkg/apis/operator/v1alpha1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,12 @@ type CommonSettings struct {
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`

// PriorityClassName specifies the priority class name for the component.
// If not specified, it defaults to "system-node-critical".
// +kubebuilder:default="system-node-critical"
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`
}

// Image allows to customize the image used for components.
Expand Down
2 changes: 2 additions & 0 deletions operator/pkg/controlplane/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func installKarmadaAPIServer(client clientset.Interface, cfg *operatorv1alpha1.K
}

patcher.NewPatcher().WithAnnotations(cfg.Annotations).WithLabels(cfg.Labels).
WithPriorityClassName(cfg.CommonSettings.PriorityClassName).
WithExtraArgs(cfg.ExtraArgs).WithExtraVolumeMounts(cfg.ExtraVolumeMounts).
WithExtraVolumes(cfg.ExtraVolumes).WithResources(cfg.Resources).ForDeployment(apiserverDeployment)

Expand Down Expand Up @@ -143,6 +144,7 @@ func installKarmadaAggregatedAPIServer(client clientset.Interface, cfg *operator
}

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

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

0 comments on commit 162cda4

Please sign in to comment.