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?

  • Have you had the chance to look at Google Container Engine? Dynamic configuration for applications via ConfigMap API is supported since the 1.2.0 version release. More information is available here: cloud.google.com/container-engine – George Sep 22 '16 at 20:51
  • ConfigMaps don't support any sort of directory structure, which I unfortunately need for my configuration. – ConnorJC Sep 23 '16 at 0:33
  • Probably Redis with Flocker can help you accomplish what you are looking for? – George Sep 23 '16 at 19:51
  • 1
    Is your configuration read-only? "A feature of [GCE persistent disks] is that they can be mounted as read-only by multiple consumers simultaneously." kubernetes.io/docs/user-guide/volumes/#gcepersistentdisk – jwadsack Dec 6 '16 at 17:46

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.