Files
helm-charts/matrix-synapse/templates/matrix-delegation-nginx.deployment.yaml
T
jklein b5eba4cbf1 Harden pod and container security contexts across all workloads
Add securityContext hardening (runAsNonRoot, readOnlyRootFilesystem,
capabilities drop ALL, allowPrivilegeEscalation false) to the 10 workloads
that lacked it: apache-tika, cyberchef, gotenberg, homeassistant,
matrix-delegation-nginx, paperless-server, paperless-consume cronjob
(plus automountServiceAccountToken false), patchmon-frontend,
urlaubsverwaltung and zipline. All contexts are configurable via
securityContext.pod / securityContext.container in values.yaml; writable
paths are provided as emptyDirs. Image-forced deviations (Home Assistant
root start for s6-overlay + NET_RAW for discovery, paperless root init
container for /run ownership) are documented in the charts' values.yaml.
Major version bump for every changed published chart.
2026-08-21 21:49:05 +02:00

81 lines
2.9 KiB
YAML

{{- if .Values.matrix.delegation.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
spec:
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.matrix.delegation.securityContext.pod | nindent 8 }}
containers:
- name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx
image: "nginx:1.28.3"
securityContext:
{{- toYaml .Values.matrix.delegation.securityContext.container | nindent 12 }}
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
# The mounted nginx.conf points the pid file and all temp paths to
# /tmp, so a single writable emptyDir suffices with a read-only
# root filesystem.
- name: tmp
mountPath: /tmp
resources:
limits:
memory: "{{ .Values.matrix.delegation.resources.limits.memory }}"
cpu: "{{ .Values.matrix.delegation.resources.limits.cpu }}"
ephemeral-storage: "{{ .Values.matrix.delegation.resources.limits.ephemeralStorage }}"
requests:
memory: "{{ .Values.matrix.delegation.resources.requests.memory }}"
cpu: "{{ .Values.matrix.delegation.resources.requests.cpu }}"
ephemeral-storage: "{{ .Values.matrix.delegation.resources.requests.ephemeralStorage }}"
readinessProbe:
httpGet:
path: /.well-known/matrix/server
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
livenessProbe:
httpGet:
path: /.well-known/matrix/server
port: http
scheme: HTTP
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
# The startup probe gates liveness/readiness. Startup budget = 5s * 30 = 150s.
startupProbe:
httpGet:
path: /.well-known/matrix/server
port: http
scheme: HTTP
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 30
volumes:
- name: tmp
emptyDir: {}
- name: nginx-config
configMap:
name: {{ .Release.Name }}-{{ .Chart.Name }}-delegation-nginx-config
items:
- key: nginx.conf
path: nginx.conf
{{- end }}