Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Component Priority Class Configuration in Karmada Operator #6068

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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