Someone deleted a Kubernetes namespace in production, including PVCs. How do you recover, and how should you prepare for this?

IntermediateScenarioData and databases
Answer

Situation read → GitOps can recreate the objects, but the data in the volumes depends on the reclaim policy and on backups.

What I'd do →

  1. Check whether the PVs survived: with reclaimPolicy: Retain the PV and EBS volume still exist in Released state.
kubectl get pv | grep Released
  1. If retained, clear the old claimRef on the PV and rebind it to a recreated PVC with the same name.
  2. If not retained, restore from Velero (which snapshots volumes):
velero restore create --from-backup daily-20261109 --include-namespaces payments
  1. Let Argo CD resync the rest (Deployments, Services, ConfigMaps).
  2. Prepare: Retain for stateful StorageClasses, scheduled Velero backups with restore tests, RBAC so few people can delete namespaces, and an admission policy or Argo CD setting that blocks namespace deletion for critical ones.

Why → Objects are cheap to recreate from Git; data is not. Protect data separately.

Interview tip → Mention reclaimPolicy: Retain; the default Delete is how data disappears with the namespace.

All Real-World Interview questions Roadmap: Interview readiness

More on Data and databases