Kubernetes CKA sample exam question 41 with answer

Question
Create a file called config.txt with 2 values:

key1=value1
key2=value2
Now create a ConfigMap named newcfgmap and read data from the file config.txt and verify that ConfigMap is created correctly.

Answer
Create config.txt:
key1=value1
key2=value2
Create ConfigMap from this file:
kubectl create cm newcfgmap --from-file=config.txt
Verify:
kubectl get cm
kubectl get cm newcfgmap -o yaml
You should have in ConfigMap data encoded in base64:
binaryData:
  config.txt: ...