Managing ConfigMaps

Once you have created a ConfigMap, you can’t overwrite it with another ConfigMap using the kubectl create command. You can delete it and recreate it, although a more effective option would be managing the configuration declarations like other Kubernetes resources, updating it with the kubectl apply command.

If you created an initial ConfigMap using the kubectl create command while you’re trying out some ideas, you can start managing that configuration using the kubectl apply command in the same fashion we used previously with deployments: exporting the YAML and then using kubectl apply from within that file.

For example, to get and store the configuration we created earlier in a deploy directory, you might use the following ...

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.