Files
helm-charts/homeassistant/templates/homeassistant.sfs.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

95 lines
3.4 KiB
YAML

apiVersion: apps/v1
kind: StatefulSet
metadata:
name: "{{ .Release.Name }}-{{ .Chart.Name }}-sfs"
labels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
spec:
serviceName: "{{ .Release.Name }}-{{ .Chart.Name }}-service"
replicas: 1
selector:
matchLabels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
template:
metadata:
labels:
app: "{{ .Release.Name }}-{{ .Chart.Name }}"
name: "{{ .Release.Name }}-{{ .Chart.Name }}-sfs"
spec:
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.securityContext.pod | nindent 8 }}
containers:
- name: "{{ .Release.Name }}-{{ .Chart.Name }}"
image: "ghcr.io/home-assistant/home-assistant:{{ .Chart.AppVersion }}"
imagePullPolicy: IfNotPresent
securityContext:
{{- toYaml .Values.securityContext.container | nindent 12 }}
env:
- name: TZ
value: "{{ .Values.core.timezone }}"
ports:
- name: http
containerPort: 8123
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
startupProbe:
{{- toYaml .Values.startupProbe | nindent 12 }}
resources:
limits:
cpu: {{ .Values.resources.limits.cpu }}
memory: {{ .Values.resources.limits.memory }}
ephemeral-storage: {{ .Values.resources.limits.ephemeralStorage }}
requests:
cpu: {{ .Values.resources.requests.cpu }}
memory: {{ .Values.resources.requests.memory }}
ephemeral-storage: {{ .Values.resources.requests.ephemeralStorage }}
volumeMounts:
- mountPath: /config/configuration.yaml
subPath: configuration.yaml
name: core-config
- mountPath: /config/http-config.yaml
subPath: http-config.yaml
name: http-config
- mountPath: /config/recorder-config.yaml
subPath: recorder-config.yaml
name: recorder-config
- mountPath: /config
name: hass-volume
subPath: hass-config
# Writable emptyDirs so the root filesystem can stay read-only:
# s6-overlay needs /run, Home Assistant writes temp files to /tmp.
- mountPath: /tmp
name: tmp
- mountPath: /run
name: run
volumes:
- name: tmp
emptyDir: {}
- name: run
emptyDir: {}
- name: core-config
secret:
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-config-secret
items:
- key: config
path: configuration.yaml
- name: http-config
secret:
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-config-secret
items:
- key: http-config
path: http-config.yaml
- name: recorder-config
secret:
secretName: {{ .Release.Name }}-{{ .Chart.Name }}-config-secret
items:
- key: recorder-config
path: recorder-config.yaml
- name: hass-volume
persistentVolumeClaim:
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc
# TODO: bind to local nodes