Reclaim Policies (Retain, Delete, Recycle)
Control what happens to underlying storage when a PVC is deleted.
In plain words
Reclaim policy is the office move checklist: delete the room, retain it for the former tenant, or perform an old unsupported scrub routine. The simple Kubernetes rule is: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
Think of it like…
Reclaim policy is the office move checklist: delete the room, retain it for the former tenant, or perform an old unsupported scrub routine.
Where you’ve seen it
Before approving a data-path change, the storage owner runs kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase. Expected evidence: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on. If the run instead shows this symptom, stop and restore the last known state: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process.
Words you’ll hear
- Retain
- For this lesson, Retain is the controlling idea: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Delete
- Delete is the checkpoint; run
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phaseand inspect the owner chain. Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process. - Reclaim
- Reclaim is the outcome to preserve; the cost is explicit: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.
- Verification evidence
- The evidence command is
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase. It connects the declaration to this behavior: Control what happens to underlying storage when a PVC is deleted.
Visual diagram
Theory & deep dive
How Retain reaches the intended state
Control what happens to underlying storage when a PVC is deleted. Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
The concrete checkpoint is kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase; compare the Retain owner, Delete state, and Reclaim outcome instead of treating YAML acceptance as proof.
Run kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase after the change and correlate the result with Events and the owning object. Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
Delete: failure boundary and production cost
Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process. The prerequisite contract is concrete: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous. A safe design limits blast radius, records the last good configuration, and uses kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase as a deterministic rollback checkpoint.
Capture the current state with kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process.
How it works, step by step
Step 1 of 41. Declare the data contract
State capacity, topology, access, and ownership in the claim or class: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Goal
- Control what happens to underlying storage when a PVC is deleted.
- Owner
- Retain
When to use it & trade-offs
What it is
Control what happens to underlying storage when a PVC is deleted. Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
Why it matters: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process. The invariant at risk is specific: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on. The quickest fact check before changing the design is kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase.
When to reach for it
- Use Retain to enforce this invariant: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Use Delete evidence from
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phasein reviews and incident timelines. Control what happens to underlying storage when a PVC is deleted. - Choose the managed external data plane route only when this cost is justified by governance or scale: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.
When to avoid or be careful
- Avoid assuming Retain is complete after YAML submission; the required behavior is concrete: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Avoid treating the next symptom as random; check the owner and state with
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phasefirst: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process. - Avoid adopting a heavier platform wrapper before measuring its cost: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.
Native, manual, and managed paths for Retain
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase.Strengths: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
Watch out: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous. Recovery must also recognize this signal: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process.
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase; the expected invariant is: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.Strengths: kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Retain, it does not make this symptom self-documenting: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process.
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
Watch out: The added platform ownership buys value at this cost: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Trace Retain to Reclaim through Delete; the invariant is: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Recognize the symptom: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process.
- Justify the cost: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.
- Verify with kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase instead of only inspecting YAML.
Benchmarks & rules of thumb
- 3
- documented policy names, with Recycle legacy
- 1
- Released PV generally needs manual handling before rebinding
- 0
- automatic backup is provided by a reclaim policy
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Retain owner contract: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on.
- Ignoring this telltale condition leads to unrelated changes: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process.
- Repeating
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phasewithout an owner for remediation wastes retry cost. Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on?
- Which owner object, logs, and Events would you inspect for this symptom-Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process-?
- At what threshold would this cost become unacceptable: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous?
kubectl patch pvc data -p '{"metadata":{"finalizers":[]}}' --dry-run=server; kubectl get pv -o custom-columns='NAME:.metadata.name,POLICY:.spec.persistentVolumeReclaimPolicy,STATUS:.status.phase, name the failure, then justify the cost. Invariant: Delete asks the provisioner to remove the backing volume after claim release, Retain leaves it for manual recovery, and Recycle is deprecated and should not be relied on. Failure: Deleting a PVC on Delete can permanently erase storage when snapshots or backups are absent, while Retain requires an explicit Released-volume cleanup and rebinding process. Cost: Retain favors safety but causes orphaned cost; Delete removes cost and forgotten data but makes accidental claim deletion more dangerous.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Reclaim Policies (Retain, Delete, Recycle) with generative AI interview Q&A and hands-on practice.