Skip to content

Commit

Permalink
chart: add customizable security-context (#716)
Browse files Browse the repository at this point in the history
drop all privileges and enforce user/group/fsgroup

Signed-off-by: Francesco Giudici <[email protected]>
  • Loading branch information
fgiudici authored May 2, 2024
1 parent 8038dc6 commit a147e8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .obs/chartfile/operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ spec:
labels:
app: elemental-operator
spec:
securityContext:
runAsUser: {{ .Values.securityContext.runAsUser }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
fsGroup: {{ .Values.securityContext.fsGroup }}
containers:
- env:
- name: NO_PROXY
Expand Down Expand Up @@ -39,6 +43,11 @@ spec:
- {{ template "registry_url" . }}{{ .Values.seedImage.repository }}:{{ .Values.seedImage.tag | default .Chart.AppVersion }}
- --seedimage-image-pullpolicy
- {{ .Values.seedImage.imagePullPolicy}}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
serviceAccountName: {{ .Release.Name }}
{{- with .Values.tolerations }}
tolerations:
Expand Down
5 changes: 5 additions & 0 deletions .obs/chartfile/operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ debug: false
nodeSelector:
kubernetes.io/os: linux

securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 2000

tolerations:
- key: cattle.io/os
operator: "Equal"
Expand Down

0 comments on commit a147e8a

Please sign in to comment.