Bird
0
0

Which of the following is the correct syntax to specify a Pod Disruption Budget that allows at most 2 pods to be unavailable?

easy📝 Configuration Q3 of 15
Kubernetes - Production Best Practices
Which of the following is the correct syntax to specify a Pod Disruption Budget that allows at most 2 pods to be unavailable?
Aspec:\n maxUnavailable: 2\n selector:\n matchLabels:\n app: myapp
Bspec:\n minAvailable: 2\n selector:\n matchLabels:\n app: myapp
Cspec:\n maxUnavailable: 'two'\n selector:\n matchLabels:\n app: myapp
Dspec:\n maxUnavailable: 2\n selector:\n app: myapp
Step-by-Step Solution
Solution:
  1. Step 1: Understand maxUnavailable syntax

    maxUnavailable must be an integer or percentage under spec, with a selector using matchLabels.
  2. Step 2: Check each option syntax

    spec:\n maxUnavailable: 2\n selector:\n matchLabels:\n app: myapp uses correct YAML with maxUnavailable: 2 and proper selector.matchLabels. spec:\n minAvailable: 2\n selector:\n matchLabels:\n app: myapp uses minAvailable which is different. spec:\n maxUnavailable: 'two'\n selector:\n matchLabels:\n app: myapp uses string 'two' which is invalid. spec:\n maxUnavailable: 2\n selector:\n app: myapp misses matchLabels key.
  3. Final Answer:

    Correct syntax with maxUnavailable: 2 and matchLabels selector -> Option A
  4. Quick Check:

    Correct maxUnavailable syntax = A [OK]
Quick Trick: maxUnavailable uses integer or percentage with matchLabels selector [OK]
Common Mistakes:
  • Using string instead of integer for maxUnavailable
  • Omitting matchLabels key in selector
  • Confusing minAvailable with maxUnavailable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes