I am creating a config map as below
kubectl create configmap testconfigmap --from-file=testkey=testfile.txt
As I am using helm charts, I would like to create the config map using YAML file instead of running kubectl, so something like:
apiVersion: v1
kind: ConfigMap
metadata:
name: testconfigmap
data:
fromfile: testkey=testfile.txt
The --from-file
allows me to pass the key and the value I read from the testfile.txt. But the fromfile
doesn't work if I create configMap as YAML file.