I am currently getting into Kubernetes.
When creating configmaps is it posible to create a configmap with key-value pairs from inside the file.
As per
$kubectl create cm --help
[...]
# Create a new configmap named my-config from the key=value pairs in the file
kubectl create configmap my-config --from-file=path/to/bar
This should be possible in my understanding.
From a file with content
permission:true
reset-counter:4
some-value:string
I expect a config-map such as
data:
permission: "true"
reset-counter: "4"
some-value: "string"
kind: ConfigMap
Instead it creates a config-map with one key (=file-name) and value (=file-content)
How does kubernetes differentiate between the two uses in the examples?
Examples:
# Create a new configmap named my-config based on folder bar
kubectl create configmap my-config --from-file=path/to/bar
# Create a new configmap named my-config from the key=value pairs in the file
kubectl create configmap my-config --from-file=path/to/bar
Thx
Cluster information:
Kubernetes version: v.1.21.1+k3s1
Cloud being used: bare-metal
Installation method: k3s