I have multiple configuration files in two directories. For example,
- conf.d/parentconf1.conf
- con.d/node1/child1.conf
- conf.d/node2/child2.conf
I need to mount these configuration files in the same directory structure to kubernetes pod using ConfigMap
.
Tried using the
kubectl create configmap --from-file=./conf.d --from-file=./conf.d/node1/child1.conf --from-file=./conf.d/node2/child2.conf.
Config map created, as expected, cannot express the nested directory structure.
Is it possible to create ConfigMap recursively from folders and still retain the folder structure in the name of the key entry for the ConfigMap - since the intention is to mount these ConfigMaps into pods?