home-assistant: Manage YAML files with ConfigMap

Editing `configuration.yaml` et al. using `vi` via `kubectl exec` is
rather tedious, since the version of `vi` in the *home-assistant*
container image is very rudimentary.  Thus, I think it would be better
to use a ConfigMap to store the manually-edited YAML files, so I can
edit them with my regular editor on my desktop.  For this to work, the
ConfigMap has to be mounted as a directory rather than as individual
files (using `subPath`), as otherwise the pod would have to be restarted
every time one of the files is updated.
This commit is contained in:
2023-12-27 14:11:51 -06:00
parent 8d796a7c01
commit e56526600d
6 changed files with 368 additions and 0 deletions

View File

@@ -50,6 +50,22 @@ exposed by a Service resource, which in turn is proxied by an Ingress resource.
[Home Assistant]: https://www.home-assistant.io/
#### ConfigMaps
Although most Home Assistant configuration is managed by its web UI, some
settings and integrations are read from manually-managed YAML files. Some
notable examples include the [Shell Command] and [Group] integrations. To make
it easier to edit these files, they are stored in a ConfigMap which is mounted
into the Home Assistant container. Since the Kublet will not automatically
update mounted ConfigMaps when files are mounted individually, the entire
ConfigMap has to be mounted as a directory. Files that must exist within the
configuration directory (i.e. `/config`) need symbolic links pointing to the
respective files in the ConfigMap mount point.
[Shell Command]: https://www.home-assistant.io/integrations/shell_command
[Group]: https://www.home-assistant.io/integrations/group
### PostgreSQL
Although Home Assistant stores all of its internal state in JSON files on the