Bird
0
0

You run this command:

medium📝 Troubleshoot Q14 of 15
Kubernetes - ConfigMaps
You run this command:
kubectl create configmap my-config --from-literal=key1=value1 key2=value2

But it fails with an error. What is the likely cause?
AThe command does not support any literals
BMissing '=' after --from-literal for the second key-value pair
CConfigMap name 'my-config' is invalid
DYou must use --from-file instead of --from-literal
Step-by-Step Solution
Solution:
  1. Step 1: Analyze command syntax

    The command uses --from-literal=key1=value1 correctly but then adds key2=value2 without --from-literal=.
  2. Step 2: Understand correct usage

    Each literal must be preceded by its own --from-literal= option. Omitting it causes a syntax error.
  3. Final Answer:

    Missing '=' after --from-literal for the second key-value pair -> Option B
  4. Quick Check:

    Each literal needs its own --from-literal= [OK]
Quick Trick: Repeat --from-literal= for each key=value pair [OK]
Common Mistakes:
  • Passing multiple literals without repeating --from-literal
  • Assuming one --from-literal can take multiple pairs
  • Confusing --from-literal with --from-file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes