Bird
0
0

Given this YAML snippet for a ConfigMap with immutable: true:

medium📝 Command Output Q13 of 15
Kubernetes - ConfigMaps
Given this YAML snippet for a ConfigMap with immutable: true:
apiVersion: v1
kind: ConfigMap
metadata:
  name: example-config
immutable: true
data:
  setting: old_value
What happens if you try to update setting to new_value using kubectl apply?
AThe update fails with an error about immutable field
BThe update succeeds and the ConfigMap changes to new_value
CThe ConfigMap is deleted and recreated with new_value
DThe update is ignored silently, keeping old_value
Step-by-Step Solution
Solution:
  1. Step 1: Understand immutable ConfigMap behavior on update

    When immutable: true is set, Kubernetes rejects any update to the ConfigMap data.
  2. Step 2: Predict kubectl apply result

    Trying to change setting triggers an error indicating the ConfigMap is immutable and cannot be modified.
  3. Final Answer:

    The update fails with an error about immutable field -> Option A
  4. Quick Check:

    Immutable ConfigMap update = error [OK]
Quick Trick: Immutable ConfigMaps reject updates with error [OK]
Common Mistakes:
  • Expecting updates to succeed
  • Thinking ConfigMap auto-recreates on update
  • Assuming silent ignore of changes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes