Bird
0
0

You want to create a ConfigMap from all files in the directory config/. Which command will correctly create a ConfigMap named dir-config with all files inside?

hard📝 Application Q9 of 15
Kubernetes - ConfigMaps
You want to create a ConfigMap from all files in the directory config/. Which command will correctly create a ConfigMap named dir-config with all files inside?
Akubectl create configmap dir-config --from-file=config
Bkubectl create configmap dir-config --from-file=config/*
Ckubectl create configmap dir-config --from-file=config/
Dkubectl create configmap dir-config --from-file=./config
Step-by-Step Solution
Solution:
  1. Step 1: Understand directory loading

    Using --from-file=directory/ loads all files inside the directory into the ConfigMap.
  2. Step 2: Analyze options

    kubectl create configmap dir-config --from-file=config/ uses the directory path with trailing slash, which is the correct syntax.
  3. Final Answer:

    kubectl create configmap dir-config --from-file=config/ -> Option C
  4. Quick Check:

    Directory with trailing slash loads all files [OK]
Quick Trick: Add trailing slash to directory path to load all files [OK]
Common Mistakes:
  • Using wildcard * which is not supported
  • Omitting trailing slash
  • Using relative path without ./

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes