Bird
0
0

Which of the following is the correct YAML syntax to add an annotation named build-date with value 2024-06-01 to a pod?

easy📝 Configuration Q3 of 15
Kubernetes - Labels and Selectors
Which of the following is the correct YAML syntax to add an annotation named build-date with value 2024-06-01 to a pod?
Ametadata:\n annotations:\n build-date: '2024-06-01'
Bmetadata:\n labels:\n build-date: '2024-06-01'
Cmetadata:\n annotations:\n build-date = '2024-06-01'
Dmetadata:\n annotations:\n 'build-date': 2024-06-01
Step-by-Step Solution
Solution:
  1. Step 1: Review YAML syntax for annotations

    Annotations are under metadata.annotations with key: value pairs using colon and indentation.
  2. Step 2: Check each option's correctness

    metadata:\n annotations:\n build-date: '2024-06-01' uses correct YAML syntax with quotes for string value; others have syntax errors or wrong fields.
  3. Final Answer:

    Correct YAML syntax for annotation is in option A. -> Option A
  4. Quick Check:

    Annotations syntax = key: value under metadata.annotations [OK]
Quick Trick: Annotations use colon, not equals, under metadata.annotations [OK]
Common Mistakes:
  • Using '=' instead of ':'
  • Placing annotations under labels
  • Missing quotes for string values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes