Bird
0
0

Which of the following is the correct syntax to specify a nodeSelector in a Pod YAML manifest?

easy📝 Configuration Q12 of 15
Kubernetes - Scheduling
Which of the following is the correct syntax to specify a nodeSelector in a Pod YAML manifest?
AnodeSelector: disktype=ssd
BnodeSelector: - disktype: ssd
CnodeSelector: disktype: ssd
DnodeSelector: [disktype=ssd]
Step-by-Step Solution
Solution:
  1. Step 1: Recall nodeSelector YAML format

    nodeSelector is a map of key-value pairs under the nodeSelector field, indented properly.
  2. Step 2: Check each option's syntax

    nodeSelector: disktype: ssd uses correct YAML mapping with key and value properly indented. Options B, C, and D use invalid YAML or wrong formats.
  3. Final Answer:

    nodeSelector: disktype: ssd -> Option C
  4. Quick Check:

    nodeSelector uses key: value map in YAML [OK]
Quick Trick: Use key: value under nodeSelector with proper indentation [OK]
Common Mistakes:
  • Using list syntax instead of map
  • Writing nodeSelector as a string
  • Incorrect indentation causing YAML errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes