diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index cbfeca75b7..0970473451 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -91,8 +91,10 @@ spec: {{- toYaml .Values.livenessProbe | nindent 16 }} resources: {{- toYaml .Values.resources | nindent 16 }} + {{- if .Values.securityContext }} securityContext: {{- toYaml .Values.securityContext | nindent 16 }} + {{- end }} volumeMounts: - mountPath: /policy-dir name: policy-volume diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index 7820a2733b..01609fe7fa 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -67,8 +67,10 @@ spec: {{- toYaml .Values.livenessProbe | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- if .Values.securityContext }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} + {{- end }} volumeMounts: - mountPath: /policy-dir name: policy-volume