Store persistent data outside config directory

Hi, I’m trying to migrate to a new deployment workflow but running into problems because the config folder contains both configuration and persistent data.

I’m running HA with Docker on a local Kubernetes instance.
At startup the config is pulled from Git and stored in a temporary config folder, so all information in this folder is refreshed during restarts. I’ve found I can relocate the database file to a different location so I can mount a hostpath to keep that information between restarts.

But the problem is with other persistent data, especially the following files/folders:

  • .storage/
  • .homekit.state
  • .ios.conf
  • .uuid

Is there a way to write those files to a different location?

Currently I don;t think this is possible.

You could force bind mounts on your container, and direct each of those locations to a location of your choice on the host.

Bind mounts won’t work in this situation. At startup I would like to replace the complete config in the directory with the config from Git. This ensures the Git config is correct and there are no local changes.

Seems like it would work to me.

Doing the git pull before the docker container starts would work, which means the bind mount would work

You’re right, the git pull might work. That would allow both versioned and unversioned files in the same directory. I’ll give that a try, thanks.