All ConfigMaps we created so far were done through kubectl create cm commands. Everything in Kubernetes can be defined as YAML, and that includes ConfigMaps as well.

Looking into the YAML

Even though we have not yet specified ConfigMaps as YAML, we have seen the format quite a few times throughout this chapter. Since we cannot be sure whether we can create a ConfigMap YAML file from memory, let’s make things easy for ourselves and use kubectl to output our existing my-config ConfigMap in YAML format.

Get hands-on with 1200+ tech skills courses.