Recall & Review
beginner
What is a ConfigMap in Kubernetes?
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: <br>
kubectl create configmap <name> --from-literal=key1=value1 --from-literal=key2=value2<br>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?
✗ Incorrect
The correct syntax to create a ConfigMap from literals is 'kubectl create configmap --from-literal=key=value'.
What does the command 'kubectl create configmap my-config --from-literal=env=dev --from-literal=debug=true' do?
✗ Incorrect
This command creates a new ConfigMap with two key-value pairs from literals.
How can you view the contents of a ConfigMap named 'settings'?
✗ Incorrect
The command 'kubectl get configmap -o yaml' shows the full details of the ConfigMap.
If you want to add a new key-value pair to an existing ConfigMap created from literals, what should you do?
✗ Incorrect
ConfigMaps created from literals cannot be updated directly; you must recreate them with all desired data.
What is the main benefit of using ConfigMaps in Kubernetes?
✗ Incorrect
ConfigMaps help keep configuration data separate from container images, making apps easier to manage and update.
Explain how to create a ConfigMap from literals and why you might choose this method.
Think about creating small config data directly from the command line.
You got /4 concepts.
Describe how to check the contents of a ConfigMap and how to update it if needed.
Viewing is easy, but updating literals requires a special approach.
You got /4 concepts.