Skip to content

Commit

Permalink
helm: ability to specify security context for pod (#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
victorgs and a7i authored Dec 5, 2023
1 parent 4d37ec9 commit f0f7ebb
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 @@ -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:
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 f0f7ebb

Please sign in to comment.