I am in the process of learning Kubernetes and trying to set up my own pod. After doing lots of reading, it seems that the generally accepted best practice for managing configuration for my containers is through the use of configuration maps. Is this true?
I am having a hard time understanding the benefits of configuration maps. Maybe I am missing something. When I try to create a configuration map from a file, it basically creates the object and the object is static; that is, if I go and change the configuration file on disk, it does not change the configuration map. I can then map the files into my containers. The problem is, what if I need to update the configuration and then restart the service/pod? For example in my pod I have squid running with an icap service connected to it. If I need to update the whitelist for example, what I would do in a normal setup is update the file, and then restart the squid service. With a configuration map it seems like I would have to create a new configuration map, update the pod to point to that one, then restart the pod.
In the documentation and tutorial for configuration maps, I didn’t see this scenario covered.
Furthermore, the ConfigMaps documentation does not even give a real world example, just a seemingly made up one (game-config). Most of the other Kubernetes documentation/tutorials use the nginx example, which is much more useful and helps in understanding the concepts since you can apply them directly.
Can someone help me understand? I am tempted to just use another route (like shared volumes) but I wanted to make sure I am understanding the problem before I depart from a best practice.