Bird
0
0

Which of the following YAML snippets correctly defines an immutable ConfigMap named app-config?

easy📝 Syntax Q3 of 15
Kubernetes - ConfigMaps
Which of the following YAML snippets correctly defines an immutable ConfigMap named app-config?
AapiVersion: v1 kind: ConfigMap metadata: name: app-config immutable: true data: key: value
BapiVersion: v1 kind: ConfigMap metadata: name: app-config immutable: true data: key: value
CapiVersion: v1 kind: ConfigMap metadata: name: app-config data: key: value immutable: true
DapiVersion: v1 kind: ConfigMap metadata: name: app-config spec: immutable: true data: key: value
Step-by-Step Solution
Solution:
  1. Step 1: Locate the correct placement of immutable: true

    The immutable field is a top-level field in the ConfigMap, placed alongside apiVersion, kind, and metadata.
  2. Step 2: Verify YAML structure

    apiVersion: v1 kind: ConfigMap metadata: name: app-config immutable: true data: key: value places immutable: true correctly at the top level, outside metadata and data.
  3. Final Answer:

    apiVersion: v1 kind: ConfigMap metadata: name: app-config immutable: true data: key: value -> Option B
  4. Quick Check:

    Immutable field location = top-level in ConfigMap [OK]
Quick Trick: Place immutable at top-level, not inside metadata [OK]
Common Mistakes:
  • Putting immutable under metadata or spec
  • Placing immutable inside data section
  • Incorrect YAML indentation for immutable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes