Add init containers support to Helm chart (#1826)

This commit adds support for init containers in the descheduler Helm chart,
allowing users to run initialization tasks before the main descheduler
container starts.

Changes:
- Add initContainers field to values.yaml with example usage
- Update deployment.yaml template to render init containers
- Update cronjob.yaml template to render init containers
- Bump chart version from 0.34.0 to 0.34.1

Init containers can be used for various purposes such as:
- Pre-loading configuration from external sources
- Waiting for dependencies to be ready
- Setting up required files or permissions
- Running security scans or compliance checks

Example usage in values.yaml:
initContainers:
  - name: init-config
    image: busybox:1.28
    command: ['sh', '-c', 'echo Initializing && sleep 5']

Signed-off-by: kjoshi <kjoshi@egnyte.com>
This commit is contained in:
Kamlesh Joshi
2026-02-21 08:03:39 +05:30
committed by GitHub
parent 9e9595357a
commit 9bfdbe92e9
3 changed files with 15 additions and 0 deletions
@@ -96,6 +96,10 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 12 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
@@ -49,6 +49,10 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
+7
View File
@@ -233,6 +233,13 @@ livenessProbe:
periodSeconds: 20
timeoutSeconds: 5
# Init containers to run before the main descheduler container
initContainers: []
# Example:
# - name: init-myservice
# image: busybox:1.28
# command: ['sh', '-c', 'echo The app is running! && sleep 10']
service:
enabled: false
# @param service.ipFamilyPolicy [string], support SingleStack, PreferDualStack and RequireDualStack