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

feat: add possibility to configure PriorityClassName #102

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
8 changes: 8 additions & 0 deletions apis/druid/v1alpha1/druid_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ type DruidSpec struct {
// +optional
PodLabels map[string]string `json:"podLabels,omitempty"`

// PriorityClassName Kubernetes native `priorityClassName` specification.
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`

// UpdateStrategy
// +optional
UpdateStrategy *appsv1.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"`
Expand Down Expand Up @@ -308,6 +312,10 @@ type DruidNodeSpec struct {
// +optional
PodDisruptionBudgetSpec *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudgetSpec,omitempty"`

// PriorityClassName Kubernetes native `priorityClassName` specification.
// +optional
PriorityClassName string `json:"priorityClassName,omitempty"`

// RuntimeProperties Additional runtime configuration for the specific workload.
// +required
RuntimeProperties string `json:"runtime.properties"`
Expand Down
8 changes: 8 additions & 0 deletions chart/templates/crds/druid.apache.org_druids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5548,6 +5548,10 @@ spec:
- containerPort
type: object
type: array
priorityClassName:
description: PriorityClassName Kubernetes native `priorityClassName`
specification.
type: string
readinessProbe:
description: ReadinessProbe Port is set to `druid.port` if not
specified with httpGet handler.
Expand Down Expand Up @@ -9032,6 +9036,10 @@ spec:
default: Parallel
description: PodManagementPolicy
type: string
priorityClassName:
description: PriorityClassName Kubernetes native `priorityClassName`
specification.
type: string
readinessProbe:
description: ReadinessProbe Port is set to `druid.port` if not specified
with httpGet handler.
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/druid.apache.org_druids.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5548,6 +5548,10 @@ spec:
- containerPort
type: object
type: array
priorityClassName:
description: PriorityClassName Kubernetes native `priorityClassName`
specification.
type: string
readinessProbe:
description: ReadinessProbe Port is set to `druid.port` if not
specified with httpGet handler.
Expand Down Expand Up @@ -9032,6 +9036,10 @@ spec:
default: Parallel
description: PodManagementPolicy
type: string
priorityClassName:
description: PriorityClassName Kubernetes native `priorityClassName`
specification.
type: string
readinessProbe:
description: ReadinessProbe Port is set to `druid.port` if not specified
with httpGet handler.
Expand Down
1 change: 1 addition & 0 deletions controllers/druid/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ func makePodSpec(nodeSpec *v1alpha1.DruidNodeSpec, m *v1alpha1.Druid, nodeSpecUn
Volumes: getVolume(nodeSpec, m, nodeSpecUniqueStr),
SecurityContext: firstNonNilValue(nodeSpec.PodSecurityContext, m.Spec.PodSecurityContext).(*v1.PodSecurityContext),
ServiceAccountName: m.Spec.ServiceAccount,
PriorityClassName: firstNonEmptyStr(nodeSpec.PriorityClassName, m.Spec.PriorityClassName),
}

addAdditionalContainers(m, nodeSpec, &spec)
Expand Down
3 changes: 2 additions & 1 deletion controllers/druid/testdata/broker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
nodeSpecUniqueStr: druid-druid-test-brokers
component: broker
annotations:
druidOpResourceHash: BWc+znXyJdW5P9aPZqT7929PtgA=
druidOpResourceHash: DYdfEwwDlLKgjTSZeuJb5nloe/w=
spec:
replicas: 2
selector:
Expand All @@ -34,6 +34,7 @@ spec:
spec:
tolerations: []
affinity: {}
priorityClassName: high-priority
containers:
- command:
- bin/run-druid.sh
Expand Down
3 changes: 2 additions & 1 deletion controllers/druid/testdata/broker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
nodeSpecUniqueStr: druid-druid-test-brokers
component: broker
annotations:
druidOpResourceHash: nm2DDc54TuljVernCmU6WJ6Lmi4=
druidOpResourceHash: lTyDduvMnbQ7O2Glf57R9c5bFtA=
spec:
podManagementPolicy: Parallel
replicas: 2
Expand All @@ -33,6 +33,7 @@ spec:
spec:
tolerations: []
affinity: {}
priorityClassName: high-priority
containers:
- command:
- bin/run-druid.sh
Expand Down
Loading
Loading