diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index 6a7a6b662..6fb116b10 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -88,6 +88,10 @@ spec: volumeMounts: - mountPath: /policy-dir name: policy-volume + {{- if .Values.podSecurityContext }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 12 }} + {{- end }} volumes: - name: policy-volume configMap: diff --git a/charts/descheduler/templates/deployment.yaml b/charts/descheduler/templates/deployment.yaml index a00ab7bc6..73e1e2109 100644 --- a/charts/descheduler/templates/deployment.yaml +++ b/charts/descheduler/templates/deployment.yaml @@ -68,6 +68,10 @@ spec: volumeMounts: - mountPath: /policy-dir name: policy-volume + {{- if .Values.podSecurityContext }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- end }} volumes: - name: policy-volume configMap: diff --git a/charts/descheduler/values.yaml b/charts/descheduler/values.yaml index 0500c3462..afc3b8ca3 100644 --- a/charts/descheduler/values.yaml +++ b/charts/descheduler/values.yaml @@ -32,6 +32,10 @@ securityContext: runAsNonRoot: true runAsUser: 1000 +# podSecurityContext -- [Security context for pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) +podSecurityContext: {} + # fsGroup: 1000 + nameOverride: "" fullnameOverride: ""