Free — no signup required

Reclaim Policies: What Happens When You Delete?

2 min read

The Data Lifecycle Question

When a developer deletes a PVC, what happens to the actual data on the underlying storage? This is determined by the PV's Reclaim Policy — a critical setting that has caused both data loss and runaway cloud storage costs in production environments.

There are three policies:

1. Retain — The safest option. When the PVC is deleted, the PV remains in the cluster with a status of Released. The underlying storage (e.g., the EBS volume) is untouched. The data is preserved. However, the PV cannot be automatically rebound to a new PVC — an administrator must manually inspect the data, decide what to do with it, and either delete the PV or manually edit it to make it available again. Use Retain for anything you cannot afford to lose accidentally.

2. Delete — The most common option for dynamically provisioned volumes. When the PVC is deleted, Kubernetes deletes the PV object and calls the storage provider's API to delete the underlying physical storage (e.g., the AWS EBS volume is destroyed). The data is permanently gone. This is the default for most cloud StorageClasses because it prevents orphaned volumes from accumulating and incurring costs.

3. Recycle — Deprecated. It performed a basic rm -rf /thevolume/* on the volume and made the PV available for a new claim. It's been removed from most modern Kubernetes versions in favor of dynamic provisioning.

A PV's reclaim policy can be patched after creation, which is a common emergency move — switching a volume from Delete to Retain before deleting its PVC, to make sure the underlying data survives even though the original StorageClass was configured to destroy it.

The Orphaned Volume Problem

A common production mistake: a team uses Delete reclaim policy, a developer accidentally deletes a PVC thinking it's safe to recreate, and the underlying database volume — along with all its data — is permanently destroyed. Always audit your StorageClass reclaim policies. For production databases, Retain is almost always the right choice, even if it means paying for storage of released volumes until an admin cleans them up.

Interview Tip

A common interview question is: "A developer accidentally deleted a PVC in production. How do you recover?" The answer depends on the reclaim policy. With Retain, the PV and data still exist — you can create a new PVC that manually binds to the released PV by setting volumeName in the PVC spec. With Delete, the data is gone unless you have external backups or volume snapshots. This is why the interview follow-up is always: "What backup strategy do you have for persistent volumes?"

This is one of 18 chapters

Every chapter is free — Kubernetes, Terraform, SRE, distributed systems, and more — with fast daily review built in.

Sign up free