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.
81 lines
2.7 KiB
YAML
81 lines
2.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
|
|
labels:
|
|
app: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
|
|
template:
|
|
metadata:
|
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
|
|
labels:
|
|
app: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
|
|
spec:
|
|
automountServiceAccountToken: false
|
|
securityContext:
|
|
{{- toYaml .Values.patchmon.frontend.securityContext.pod | nindent 8 }}
|
|
containers:
|
|
- name: {{ .Release.Name }}-{{ .Chart.Name }}-frontend
|
|
image: "ghcr.io/patchmon/patchmon-frontend:{{ .Chart.AppVersion }}"
|
|
imagePullPolicy: IfNotPresent
|
|
securityContext:
|
|
{{- toYaml .Values.patchmon.frontend.securityContext.container | nindent 12 }}
|
|
ports:
|
|
- containerPort: 3000
|
|
protocol: TCP
|
|
name: http
|
|
env:
|
|
- name: BACKEND_URL
|
|
value: "{{ .Release.Name }}-{{ .Chart.Name }}-backend-service"
|
|
- name: BACKEND_PORT
|
|
value: "80"
|
|
{{- with .Values.patchmon.frontend.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
# The startup probe gates liveness/readiness. Startup budget = 5s * 30 = 150s.
|
|
startupProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 3000
|
|
periodSeconds: 5
|
|
timeoutSeconds: 5
|
|
failureThreshold: 30
|
|
volumeMounts:
|
|
- name: patchmon-volume
|
|
mountPath: /usr/share/nginx/html/assets
|
|
subPath: patchmon-assets
|
|
# nginx-unprivileged keeps its pid file and temp dirs in /tmp, and
|
|
# its entrypoint renders config templates into /etc/nginx/conf.d;
|
|
# both must be writable with a read-only root filesystem.
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
- name: nginx-conf-d
|
|
mountPath: /etc/nginx/conf.d
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|
|
- name: nginx-conf-d
|
|
emptyDir: {}
|
|
- name: patchmon-volume
|
|
persistentVolumeClaim:
|
|
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc |