Bird
0
0

Which of the following is the correct syntax to specify a selector in a Service YAML?

easy📝 Configuration Q3 of 15
Kubernetes - Services
Which of the following is the correct syntax to specify a selector in a Service YAML?
Aselect: - app: myapp
Bselector: app: myapp
Cselector = app: myapp
Dselect: app: myapp
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct YAML syntax for selectors

    The correct key is selector with a map of key-value pairs under it.
  2. Step 2: Identify syntax errors in other options

    Options A and B use select which is invalid. selector = app: myapp uses equals sign which is not YAML syntax.
  3. Final Answer:

    selector: app: myapp -> Option B
  4. Quick Check:

    Use 'selector:' with key-value pairs in YAML [OK]
Quick Trick: Use 'selector:' with indented key-value pairs in YAML [OK]
Common Mistakes:
  • Using 'select' instead of 'selector'
  • Using '=' instead of ':' in YAML
  • Incorrect indentation or list syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes