Exposing the configuration into your container images

There are two primary ways to expose configuration data into your container:

  • Connecting the keys from one or more ConfigMaps into environment variables that are set for your Pod
  • Kubernetes can map the data from one or more ConfigMaps into volumes that are mounted in your Pod

The primary difference is that environment variables are typically set once at the start of invoking your container and are generally simple string values, where as ConfigMaps mounted as data in volumes can be more complex and will get updated if you update the ConfigMap resource.

Note that no mechanism exists to explicitly tells your container that a ConfigMap value has been updated. As of version 1.9, Kubernetes ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.