I've been looking into using Kubernetes on Google Compute Engine. I have pods with configuration that needs to be deployed to them. Currently, I'm using a persistent disk to do this. However, as a persistent disk cannot be mounted more than once it cannot be used to deploy configuration if I use more than 1 pod.
What is the best way to do this? ConfigMaps won't work as I need to deploy a directory structure as configuration. The only solution I can see is rebuilding my docker container every time I need to change my config. Is that really the best way?
Kubernetes supports several types of volumes that are appropriate for different applications. As jwadsack suggested in his comment you can use a
gcePersistentDisk
volume which can be mounted as read-only by multiple consumers simultaneously. NFS (nfs
volume) can also be mounted and used by multiple writers simultaneously.ConfigMaps
allow mapping from files and directories. The main doc provides info. You likely need only very little adaptation to what you are used to from static files. Also ConfigMaps are definitely the only way to go, since binding volumes for everything but data defeats the purposes of Kubernetes a little, imo.