Bird
0
0

Which of the following is the correct way to specify a Pod Disruption Budget that allows at most 1 pod disruption at a time for pods with label app=web?

easy📝 Configuration Q12 of 15
Kubernetes - Production Best Practices
Which of the following is the correct way to specify a Pod Disruption Budget that allows at most 1 pod disruption at a time for pods with label app=web?
AapiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: maxUnavailable: 1 selector: matchLabels: app: web minReadySeconds: 10
BapiVersion: v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: minAvailable: 1 selector: matchLabels: app: web
CapiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: maxUnavailable: 1 selector: matchLabels: app: web strategy: RollingUpdate
DapiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: maxUnavailable: 1 selector: matchLabels: app: web
Step-by-Step Solution
Solution:
  1. Step 1: Check API version and kind

    The correct API version for PDB is policy/v1 and kind is PodDisruptionBudget.
  2. Step 2: Validate spec fields for maxUnavailable and selector

    apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: maxUnavailable: 1 selector: matchLabels: app: web correctly uses maxUnavailable: 1 and a selector matching label app: web. Other options either use wrong API version, extra unsupported fields, or wrong spec keys.
  3. Final Answer:

    apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: maxUnavailable: 1 selector: matchLabels: app: web -> Option D
  4. Quick Check:

    Correct API and maxUnavailable syntax = apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: pdb-web spec: maxUnavailable: 1 selector: matchLabels: app: web [OK]
Quick Trick: Use policy/v1 and maxUnavailable with correct selector [OK]
Common Mistakes:
  • Using wrong API version like v1
  • Adding unsupported fields like strategy
  • Confusing minAvailable with maxUnavailable

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes