Configuring your Pods using ConfigMaps
In this section, we will learn how to list, create, delete, and read ConfigMaps. Then, we will learn how to attach them to our Pods so that their values are injected into our Pods in the form of environment variables or volumes.
Listing ConfigMaps
Listing the ConfigMaps that were created in your cluster is fairly straightforward and can be accomplished using kubectl , just like any other object in Kubernetes. You can do this by using the full resource name, which is configmaps:
$ kubectl get configmaps
Alternatively, you can use the shorter alias, which is cm:
$ kubectl get cm
Both of these commands have the same effect. When executed, kubectl might display a few default ConfigMaps or issue an error stating that no configmaps were found. This discrepancy arises because certain cloud services generate default ConfigMaps for internal processes, while others do not. The presence or absence of these default ConfigMaps depends on the environment...