fix homeassistant configuration.yaml not being writable

This commit is contained in:
Roger Oriol
2026-07-28 00:31:23 +02:00
parent 707ec39291
commit d3798f47ac
2 changed files with 131 additions and 3 deletions

View File

@@ -66,9 +66,6 @@ spec:
volumeMounts:
- name: config
mountPath: /config
- name: configuration
mountPath: /config/configuration.yaml
subPath: configuration.yaml
- name: localtime
mountPath: /etc/localtime
readOnly: true
@@ -82,6 +79,28 @@ spec:
- NET_ADMIN
- NET_RAW
- SYS_ADMIN
# Seed configuration.yaml from the ConfigMap onto the writable PVC so that
# Home Assistant has a writable configuration.yaml (required for the UI to
# create/save scripts, helpers, reloads, etc.). The ConfigMap stays the
# GitOps source of truth: it is re-copied on every pod start. UI-managed
# entities (scripts, automations, integrations) live in /config/.storage
# on the PVC and are never overwritten by this step.
initContainers:
- name: seed-config
image: busybox:1.36
command: ["/bin/sh", "-c"]
args:
- |
set -e
echo "Seeding /config/configuration.yaml from ConfigMap..."
cp /config-cm/configuration.yaml /config/configuration.yaml
echo "Done."
volumeMounts:
- name: config
mountPath: /config
- name: configuration
mountPath: /config-cm
readOnly: true
hostNetwork: true
volumes:
- name: config