Bird
0
0

You run:

medium📝 Troubleshoot Q7 of 15
Kubernetes - ConfigMaps
You run:
kubectl create configmap config1 --from-literal=key1=value1 --from-literal=key1=value2

What will be the value of key1 in the ConfigMap?
Avalue2
BError due to duplicate keys
CBoth values concatenated
Dvalue1
Step-by-Step Solution
Solution:
  1. Step 1: Understand duplicate key behavior

    When duplicate keys are provided, the last one wins and overwrites previous.
  2. Step 2: Identify final value

    Since key1=value2 is last, value2 will be stored.
  3. Final Answer:

    value2 -> Option A
  4. Quick Check:

    Duplicate keys overwrite previous, last wins [OK]
Quick Trick: Last duplicate key value overwrites previous [OK]
Common Mistakes:
  • Expecting error on duplicate keys
  • Thinking values concatenate
  • Assuming first value is kept

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes