Bird
0
0

A StatefulSet named db uses volumeClaimTemplates for storage. What happens to the PVCs when the StatefulSet is scaled down from 5 to 3 replicas?

hard📝 Application Q9 of 15
Kubernetes - Persistent Storage
A StatefulSet named db uses volumeClaimTemplates for storage. What happens to the PVCs when the StatefulSet is scaled down from 5 to 3 replicas?
APVCs for db-3 and db-4 are deleted automatically
BPVCs for pods db-3 and db-4 remain but pods are deleted
CAll PVCs are deleted when scaling down
DPVCs are renamed to match new pod names
Step-by-Step Solution
Solution:
  1. Step 1: Understand PVC lifecycle with StatefulSet

    PVCs created by volumeClaimTemplates are retained even if pods are deleted.
  2. Step 2: Apply to scaling down scenario

    When scaling down, pods db-3 and db-4 are deleted but their PVCs remain for data safety.
  3. Final Answer:

    PVCs for pods db-3 and db-4 remain but pods are deleted -> Option B
  4. Quick Check:

    PVCs persist after pod deletion [OK]
Quick Trick: PVCs stay after pod deletion in StatefulSet [OK]
Common Mistakes:
  • Assuming PVCs delete with pods
  • Thinking PVCs rename automatically
  • Believing all PVCs delete on scale down

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes