helm: refactor securityContext to support restricted pod security standard

Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2024-11-15 16:52:55 +01:00
parent f7de6f6704
commit cf6adc1075
16 changed files with 337 additions and 152 deletions

View file

@ -22,6 +22,18 @@ spec:
labels:
io.kompose.service: nextcloud-aio-talk
spec:
securityContext:
# The items below only work in pod context
fsGroup: 1000
fsGroupChangePolicy: "OnRootMismatch"
# The items below work in both contexts
runAsUser: 1000
runAsGroup: 1000
runAsNonRoot: true
{{- if eq .Values.RPSS_ENABLED "yes" }}
seccompProfile:
type: RuntimeDefault
{{- end }}
containers:
- env:
- name: TALK_MAX_STREAM_BITRATE
@ -42,7 +54,7 @@ spec:
value: "{{ .Values.TURN_SECRET }}"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: "nextcloud/aio-talk:20241106_101604"
image: nextcloud/aio-talk:20241106_101604
name: nextcloud-aio-talk
ports:
- containerPort: {{ .Values.TALK_PORT }}
@ -52,10 +64,13 @@ spec:
- containerPort: 8081
protocol: TCP
securityContext:
# The items below only work in container context
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop:
- NET_RAW
runAsUser: 1000
{{- if eq .Values.RPSS_ENABLED "yes" }}
drop: ["ALL"]
{{- else }}
drop: ["NET_RAW"]
{{- end }}
add: ["NET_BIND_SERVICE"]
{{- end }}