Challenge - 5 Problems
ConfigMap Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of creating ConfigMap with literals
What is the output of the following command when creating a ConfigMap from literals?
Kubernetes
kubectl create configmap app-config --from-literal=key1=value1 --from-literal=key2=value2Attempts:
2 left
💡 Hint
Check the standard success message for kubectl create commands.
✗ Incorrect
The command creates a ConfigMap named 'app-config' with two key-value pairs. The success message is 'configmap/app-config created'.
🧠 Conceptual
intermediate1:30remaining
Purpose of --from-literal flag in ConfigMap creation
What does the --from-literal flag do when creating a ConfigMap in Kubernetes?
Attempts:
2 left
💡 Hint
Think about how you can provide data without using files.
✗ Incorrect
The --from-literal flag allows you to specify key-value pairs directly in the command line to create a ConfigMap without needing external files.
❓ Troubleshoot
advanced2:00remaining
Error when creating ConfigMap with duplicate keys
What error will occur if you run this command?
kubectl create configmap test-config --from-literal=key1=value1 --from-literal=key1=value2
Attempts:
2 left
💡 Hint
Keys in ConfigMaps must be unique.
✗ Incorrect
Using the same key twice with --from-literal causes an error because keys must be unique in a ConfigMap.
🔀 Workflow
advanced2:30remaining
Correct sequence to update a ConfigMap from literals
What is the correct sequence of commands to update an existing ConfigMap named 'app-config' with new literals?
Attempts:
2 left
💡 Hint
Use dry-run and apply to update ConfigMaps safely.
✗ Incorrect
To update a ConfigMap from literals, generate the YAML with dry-run, then apply it. Direct create will fail if ConfigMap exists.
✅ Best Practice
expert2:00remaining
Why prefer --from-literal over manual YAML for small ConfigMaps?
Which is the best reason to use --from-literal when creating small ConfigMaps instead of writing YAML files manually?
Attempts:
2 left
💡 Hint
Think about convenience and error reduction.
✗ Incorrect
Using --from-literal is quick and less error-prone for small ConfigMaps compared to writing YAML by hand.