all-in-one/nextcloud-aio-helm-chart/templates/nextcloud-aio-imaginary-deployment.yaml
Simon L. cf6adc1075 helm: refactor securityContext to support restricted pod security standard
Signed-off-by: Simon L. <szaimen@e.mail.de>
2024-11-21 22:16:00 +01:00

59 lines
1.8 KiB
YAML
Executable file

{{- if eq .Values.IMAGINARY_ENABLED "yes" }}
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml --namespace "{{ .Values.NAMESPACE }}"
kompose.version: 1.34.0 (cbf2835db)
labels:
io.kompose.service: nextcloud-aio-imaginary
name: nextcloud-aio-imaginary
namespace: "{{ .Values.NAMESPACE }}"
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: nextcloud-aio-imaginary
template:
metadata:
annotations:
kompose.cmd: kompose convert -c -f latest.yml --namespace "{{ .Values.NAMESPACE }}"
kompose.version: 1.34.0 (cbf2835db)
labels:
io.kompose.service: nextcloud-aio-imaginary
spec:
securityContext:
# The items below only work in pod context
fsGroup: 65534
fsGroupChangePolicy: "OnRootMismatch"
# The items below work in both contexts
runAsUser: 65534
runAsGroup: 65534
runAsNonRoot: true
{{- if eq .Values.RPSS_ENABLED "yes" }}
seccompProfile:
type: RuntimeDefault
{{- end }}
containers:
- env:
- name: IMAGINARY_SECRET
value: "{{ .Values.IMAGINARY_SECRET }}"
- name: TZ
value: "{{ .Values.TIMEZONE }}"
image: nextcloud/aio-imaginary:20241106_101604
name: nextcloud-aio-imaginary
ports:
- containerPort: 9000
protocol: TCP
securityContext:
# The items below only work in container context
allowPrivilegeEscalation: false
capabilities:
{{- if eq .Values.RPSS_ENABLED "yes" }}
drop: ["ALL"]
{{- else }}
drop: ["NET_RAW"]
{{- end }}
add:
- NET_BIND_SERVICE
{{- end }}