Bird
0
0

Which of the following is the correct syntax to create an immutable ConfigMap in Kubernetes YAML?

easy📝 Configuration Q12 of 15
Kubernetes - ConfigMaps
Which of the following is the correct syntax to create an immutable ConfigMap in Kubernetes YAML?
AapiVersion: v1 kind: ConfigMap metadata: name: my-config spec: immutable: true data: key: value
BapiVersion: v1 kind: ConfigMap metadata: name: my-config immutable: true data: key: value
Cimmutable: true metadata: name: my-config data: key: value
Dspec: immutable: true data: key: value
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct placement of immutable: true

    In Kubernetes, immutable is a top-level field for ConfigMaps, at the same level as metadata and data.
  2. Step 2: Validate YAML structure

    apiVersion: v1 kind: ConfigMap metadata: name: my-config immutable: true data: key: value correctly places immutable: true at top-level with proper indentation and includes required fields like apiVersion, kind, and metadata.
  3. Final Answer:

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

    Immutable at top-level with metadata and data [OK]
Quick Trick: Immutable: true at top-level after metadata [OK]
Common Mistakes:
  • Adding unnecessary spec section
  • Putting immutable under metadata
  • Missing apiVersion or kind fields

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes