Bird
0
0

You applied this Pod Disruption Budget:

medium📝 Troubleshoot Q14 of 15
Kubernetes - Production Best Practices
You applied this Pod Disruption Budget:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: pdb-db
spec:
  maxUnavailable: 2
  selector:
    matchLabels:
      app: database
But Kubernetes reports an error: "spec.maxUnavailable: Invalid value: "2": must be less than the number of pods selected by the label selector". What is the likely cause?
AThere are fewer than 3 pods with label app=database
BmaxUnavailable must be a percentage, not a number
CThe selector label is incorrect syntax
DPodDisruptionBudget requires minAvailable, not maxUnavailable
Step-by-Step Solution
Solution:
  1. Step 1: Understand maxUnavailable validation

    maxUnavailable must be less than the total number of pods matched by the selector.
  2. Step 2: Analyze error message meaning

    The error says "must be less than the number of pods" meaning the number of pods with label app=database is less than or equal to 2.
  3. Final Answer:

    There are fewer than 3 pods with label app=database -> Option A
  4. Quick Check:

    maxUnavailable < total pods = error if not [OK]
Quick Trick: maxUnavailable must be less than pod count [OK]
Common Mistakes:
  • Using maxUnavailable as percentage incorrectly
  • Miswriting selector labels
  • Thinking minAvailable is mandatory

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes