Skip to content

Commit

Permalink
helm: ability to specify security context for pod (kubernetes-sigs#1311)
Browse files Browse the repository at this point in the history
* helm: ability to specify security context for pod

* Update charts/descheduler/templates/cronjob.yaml

Co-authored-by: Amir Alavi <amiralavi7@gmail.com>

* Update charts/descheduler/templates/deployment.yaml

Co-authored-by: Amir Alavi <amiralavi7@gmail.com>

---------

Co-authored-by: Amir Alavi <amiralavi7@gmail.com>
  • Loading branch information
2 people authored and knelasevero committed Jan 26, 2024
1 parent 61b8b3a commit 910f4c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/descheduler/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/descheduler/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/descheduler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""

Expand Down

0 comments on commit 910f4c1

Please sign in to comment.