Injecting Configuration from a Single File
Learn to inject a configuration from a single file using the ConfigMap volume.
Creating a ConfigMap
In its purest (and probably the most common) form, a ConfigMap takes a single file. For example, we can create one from the prometheus-conf.yml file.
We create a ConfigMap (cm) called my-config. The data of the map is the content of the prometheus-conf.yml file.
Looking into the description
Let’s describe it and see what we get.
The output is as follows:
The important part is located below Data. We can see the key which, in this case, is the name of the file (prometheus-conf.yml). Further down, we can see the contents of the file. ...