Exposing ConfigMap as files#
Instead of injecting a ConfigMap as environment variables as we have done so far, we can also expose it as files that are mounted into the container.
This can be useful when we are storing things like config files (for example, a nginx.conf file) in a ConfigMap that can then be mounted in the correct place in the container.
Here’s an example of a manifest that creates one file for each value in our ConfigMap in the /config directory inside the container: