Kubernetes 101 : ConfigMaps - decoupling variables from images -
It gives us the flexibility of having replicas of the same application tied to different configMaps, instead of having to build different images with the variables built into them.
We could create a simple configMap using the below command:
We could list our configMaps using the below command:
If we have two configMaps for example in our "/path/to/config" directory, we could create the configMap in the same way as above, mentioning only the directory:
To have a detailed look at the configuration of our configMap we use the below command:
The output is written to the file "configMap.yaml".
Remark:
ConfigMaps are used to store non-sensitive information.
There is another kubernetes object that can hold passwords, keys, ..., called Secret.
Below a simple example of a configMap with two variables:
Comments