Interview Prep/Kubernetes/Configuration, Secrets and storage

You deleted a StatefulSet and its PVCs remain. Is this expected, and how do you control it?

IntermediateScenarioConfiguration, Secrets and storage
Answer

Situation read → Storage costs are growing from orphaned volumes.

What I'd do →

  1. Yes, StatefulSet PVCs are retained by default
  2. Use persistentVolumeClaimRetentionPolicy with whenDeleted: Delete and whenScaled: Retain where appropriate
  3. Check PV reclaimPolicy (Delete or Retain) on the StorageClass
  4. List orphaned volumes with kubectl get pvc -A and cloud tags
  5. Clean up deliberately

Why → The default favours data safety over cost.

Interview tip → Say you tag volumes by cluster to find orphans.

All Kubernetes questions Roadmap: Kubernetes core

More on Configuration, Secrets and storage