diff --git a/charts/descheduler/templates/cronjob.yaml b/charts/descheduler/templates/cronjob.yaml index 25d323eb6c..73e3714b9f 100644 --- a/charts/descheduler/templates/cronjob.yaml +++ b/charts/descheduler/templates/cronjob.yaml @@ -92,6 +92,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 bc16eb5ea5..ff90a6602f 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 9e968bbd08..5c91432db2 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: ""