liveBook · Manning

Reclaim policy

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A reclaim policy specifies what Kubernetes does with a persistent volume after its persistent volume claim is released.

A reclaim policy determines what happens to a persistent volume after its persistent volume claim is released. Kubernetes supports Retain, Recycle, and Delete; Retain is the default shown for the example volume. section 7.1.4

Choose the policy according to the required data lifecycle:

  • Retain preserves the volume and its data so another claim can use it. section 7.1.4
  • Recycle scrubs the volume, equivalent to rm -f, but is deprecated; prefer Retain or Delete. section 7.1.4
  • Delete removes both the persistent volume object and supported backing storage such as Amazon EBS, Azure Disk, GCE PD, OCI, or Cinder. section 7.1.4

Check a volume's reclaim policy

Run `kubectl describe pv vol02833` and inspect the `Reclaim Policy` field. The representative output shows `Retain` for a bound 100Mi HostPath volume at `/mnt/data`. section 7.1.4

root@kind-control-plane:/# kubectl describe pv vol02833
Name:            vol02833
Labels:          type=local
Annotations:     pv.kubernetes.io/bound-by-controller: yes
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:    manual
Status:          Bound
Claim:           default/claim-02833
Reclaim Policy:  Retain
Access Modes:    RWO
VolumeMode:      FileSystem
Capacity:        100Mi
Node Affinity:   <none>
Message:
Source:
    Type:          HostPath (bare host directory volume)
    Path:          /mnt/data
    HostPathType:
Events:            <none>

Use the command output to locate reclaim policy alongside claim, access modes, capacity, and storage source. section 7.1.4

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains three policy outcomes, identifies deprecated Recycle, and names supported Delete backends.
Examples
Uses kubectl describe output for vol02833 and a PV, PVC, and pod persistence exercise.
What it assumes
Assumes persistent-volume and claim basics while reinforcing how storage classes and claims relate to volume lifecycle.
What you can do after
Operate/configure PV lifecycle behavior and verify the selected policy with kubectl describe.
How it connects
Connects persistent volumes with persistent volume claims, storage classes, access modes, and volume modes.

Also explained in

Compare how 3 books explain reclaim policy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.