feat: add opt-in schedulerName and runtimeClassName to the Helm chart

This commit is contained in:
somaz
2026-07-02 16:06:02 +09:00
parent 7d2b28bf2b
commit 0614367253
6 changed files with 74 additions and 0 deletions
+2
View File
@@ -69,6 +69,8 @@ The following table lists the configurable parameters of the _descheduler_ chart
| `podDisruptionBudget.annotations` | Annotations to add to the PodDisruptionBudget | `{}` |
| `cmdOptions` | The options to pass to the _descheduler_ command | _see values.yaml_ |
| `priorityClassName` | The name of the priority class to add to pods | `system-cluster-critical` |
| `schedulerName` | The name of the scheduler used to schedule the descheduler cronjob/deployment pods | `""` |
| `runtimeClassName` | The RuntimeClass applied to the descheduler cronjob/deployment pods | `""` |
| `rbac.create` | If `true`, create & use RBAC resources | `true` |
| `resources` | Descheduler container CPU and memory requests/limits | _see values.yaml_ |
| `serviceAccount.create` | If `true`, create a service account for the cron job | `true` |
@@ -87,6 +87,12 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName }}
{{- end }}
{{- if .Values.runtimeClassName }}
runtimeClassName: {{ .Values.runtimeClassName }}
{{- end }}
serviceAccountName: {{ template "descheduler.serviceAccountName" . }}
{{- if kindIs "bool" .Values.automountServiceAccountToken }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
@@ -41,6 +41,12 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: {{ .Values.priorityClassName }}
{{- end }}
{{- if .Values.schedulerName }}
schedulerName: {{ .Values.schedulerName }}
{{- end }}
{{- if .Values.runtimeClassName }}
runtimeClassName: {{ .Values.runtimeClassName }}
{{- end }}
serviceAccountName: {{ template "descheduler.serviceAccountName" . }}
{{- if kindIs "bool" .Values.automountServiceAccountToken }}
automountServiceAccountToken: {{ .Values.automountServiceAccountToken }}
@@ -15,3 +15,29 @@ tests:
asserts:
- isKind:
of: CronJob
- it: sets schedulerName when provided
set:
schedulerName: custom-scheduler
template: templates/cronjob.yaml
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.schedulerName
value: custom-scheduler
- it: sets runtimeClassName when provided
set:
runtimeClassName: gvisor
template: templates/cronjob.yaml
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.runtimeClassName
value: gvisor
- it: omits schedulerName and runtimeClassName by default
template: templates/cronjob.yaml
asserts:
- notExists:
path: spec.jobTemplate.spec.template.spec.schedulerName
- notExists:
path: spec.jobTemplate.spec.template.spec.runtimeClassName
@@ -47,3 +47,29 @@ tests:
- contains:
path: spec.template.spec.containers[0].args
content: --leader-elect-resource-namespace=typo
- it: sets schedulerName when provided
set:
schedulerName: custom-scheduler
template: templates/deployment.yaml
asserts:
- equal:
path: spec.template.spec.schedulerName
value: custom-scheduler
- it: sets runtimeClassName when provided
set:
runtimeClassName: gvisor
template: templates/deployment.yaml
asserts:
- equal:
path: spec.template.spec.runtimeClassName
value: gvisor
- it: omits schedulerName and runtimeClassName by default
template: templates/deployment.yaml
asserts:
- notExists:
path: spec.template.spec.schedulerName
- notExists:
path: spec.template.spec.runtimeClassName
+8
View File
@@ -164,6 +164,14 @@ deschedulerPolicy:
priorityClassName: system-cluster-critical
# schedulerName is the name of the scheduler used to schedule the descheduler pods.
# Leave empty to use the cluster default scheduler.
schedulerName: ""
# runtimeClassName is the RuntimeClass applied to the descheduler pods.
# Leave empty to use the cluster default runtime.
runtimeClassName: ""
nodeSelector: {}
# foo: bar