A ConfigMap is a Kubernetes object used to store non-confidential configuration data in key-value pairs. It helps separate configuration from container images, making apps easier to manage.
Click to reveal answer
beginner
How do you create a ConfigMap from literals using kubectl?
Use the command: kubectl create configmap <name> --from-literal=key1=value1 --from-literal=key2=value2 This creates a ConfigMap with keys and values directly from the command line.
Click to reveal answer
beginner
Why use literals to create ConfigMaps instead of files?
Literals let you quickly create small ConfigMaps without needing separate files. It's like writing a quick note instead of printing a whole page.
Click to reveal answer
beginner
What command shows the data inside a ConfigMap?
Use kubectl describe configmap <name> or kubectl get configmap <name> -o yaml to see the stored key-value pairs.
Click to reveal answer
intermediate
Can you update a ConfigMap created from literals directly with kubectl?
No, you cannot update literals directly. You must delete and recreate the ConfigMap or use kubectl edit configmap <name> to modify it.
Click to reveal answer
Which command creates a ConfigMap named 'app-config' with a key 'mode' set to 'production' using literals?
kubectl create configmap app-config --from-literal=mode=production --from-literal=debug=false uses --from-literal=mode=production and --from-literal=debug=false, which is the correct syntax.
Final Answer:
kubectl create configmap app-config --from-literal=mode=production --from-literal=debug=false -> Option A
Quick Check:
Correct literal syntax uses '=' after --from-literal [OK]
Hint: Use '=' immediately after --from-literal for each key=value pair [OK]
Common Mistakes:
Omitting '=' after --from-literal
Passing multiple literals without repeating --from-literal