Bird
0
0

Which command correctly creates a ConfigMap named my-config with a literal key-value pair mode=production?

easy📝 Conceptual Q2 of 15
Kubernetes - ConfigMaps
Which command correctly creates a ConfigMap named my-config with a literal key-value pair mode=production?
Akubectl create configmap my-config --literal=mode=production
Bkubectl create configmap my-config --from-file=mode=production
Ckubectl create configmap my-config --from-literal=mode=production
Dkubectl create configmap my-config --from-env=mode=production
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct flag for literals

    The correct flag to create ConfigMap from literals is --from-literal.
  2. Step 2: Match command syntax

    kubectl create configmap my-config --from-literal=mode=production uses --from-literal with key=value format correctly.
  3. Final Answer:

    kubectl create configmap my-config --from-literal=mode=production -> Option C
  4. Quick Check:

    Correct flag for literals = --from-literal [OK]
Quick Trick: Use --from-literal=key=value to add literals [OK]
Common Mistakes:
  • Using --from-file instead of --from-literal
  • Using incorrect flag --literal
  • Confusing environment file flags

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes