Bird
0
0

You wrote this PDB YAML but it fails to apply:

medium📝 Debug Q6 of 15
Kubernetes - Production Best Practices
You wrote this PDB YAML but it fails to apply:
spec:
  minAvailable: 2
  selector:
    app: backend
What is the error?
AMissing 'matchLabels' under selector
BminAvailable must be a string
Cselector cannot be used in PDB
DminAvailable must be greater than 5
Step-by-Step Solution
Solution:
  1. Step 1: Check selector syntax

    Selector must use 'matchLabels' or 'matchExpressions' under spec.selector.
  2. Step 2: Identify missing matchLabels

    The YAML uses 'selector: app: backend' directly, which is invalid syntax.
  3. Final Answer:

    Missing 'matchLabels' under selector -> Option A
  4. Quick Check:

    Selector requires matchLabels key = C [OK]
Quick Trick: Always use matchLabels under selector in PDB [OK]
Common Mistakes:
  • Using direct labels under selector without matchLabels
  • Using string for minAvailable
  • Assuming selector is optional

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes