forked from roger/k3s-cluster
fix homeassistant configuration.yaml not being writable
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user