...

/

Injecting Configurations from Multiple Files

Injecting Configurations from Multiple Files

Learn how to inject configurations from multiple files and directories.

Creating a ConfigMap from multiple files

Let's see what happens when we execute the following commands:

Press + to interact
kubectl create cm my-config \
--from-file=cm/prometheus-conf.yml \
--from-file=cm/prometheus.yml
kubectl create -f cm/alpine.yml
#Run the following command separately
kubectl exec -it alpine -- \
ls /etc/config

We create a ConfigMap with two files and the same Pod based on the alpine.yml definition. Finally, we output the list of files from the /etc/config directory inside the Pod’s only container. ...

Access this course and 1400+ top-rated courses and projects.