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 from multiple files
What is the output of the following command when run in a directory containing
app.properties and db.properties files?Kubernetes
kubectl create configmap app-config --from-file=app.properties --from-file=db.propertiesAttempts:
2 left
💡 Hint
The command creates a ConfigMap named 'app-config' from the specified files if they exist.
✗ Incorrect
The command creates a ConfigMap named 'app-config' using the contents of the two files. If successful, it outputs 'configmap/app-config created'.
❓ Configuration
intermediate2:00remaining
Correct syntax to create ConfigMap from directory
Which command correctly creates a ConfigMap named
my-config from all files in the directory config-dir/?Attempts:
2 left
💡 Hint
Use the correct flag to include all files in a directory.
✗ Incorrect
The correct flag is '--from-directory' with a directory path to include all files inside that directory as key-value pairs in the ConfigMap.
❓ Troubleshoot
advanced2:00remaining
Error when creating ConfigMap from non-existent file
What error will occur when running this command if
missing.conf does not exist?Kubernetes
kubectl create configmap missing-config --from-file=missing.confAttempts:
2 left
💡 Hint
Check if the file path exists before creating a ConfigMap from it.
✗ Incorrect
kubectl will fail with an error if the specified file does not exist, stating the path does not exist.
🔀 Workflow
advanced2:00remaining
Steps to update ConfigMap from updated files
You have updated files in
config-updates/. Which sequence of commands correctly updates the existing ConfigMap app-config with these files?Attempts:
2 left
💡 Hint
Use dry-run to generate YAML and then apply it to update without deleting.
✗ Incorrect
First generate the updated ConfigMap YAML with dry-run and output to a file, then apply that file to update the ConfigMap safely.
✅ Best Practice
expert3:00remaining
Best practice for managing ConfigMaps from multiple files in CI/CD
In a CI/CD pipeline, what is the best practice to manage ConfigMaps created from multiple configuration files to ensure consistency and traceability?
Attempts:
2 left
💡 Hint
Think about how to keep track of changes and have reproducible deployments.
✗ Incorrect
Generating YAML manifests and storing them in version control ensures changes are tracked and deployments are reproducible and auditable.