diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index a149b8d9d..7ab688a8c 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -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) }}" diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index b124f9bed..86a331062 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -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) }}" diff --git a/charts/descheduler/values.yaml b/charts/descheduler/values.yaml index 3ba1097e4..f98a8cf13 100644 --- a/charts/descheduler/values.yaml +++ b/charts/descheduler/values.yaml @@ -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