CKA Practice Question 7: PV Reclaim Policy Retain
Certified Kubernetes Administrator (CKA) · Test 1 · question 7 of 10
A developer deleted a PersistentVolumeClaim that was bound to a dynamically provisioned PersistentVolume. The PersistentVolume disappeared along with the underlying cloud disk, and the data was lost.
You need future volumes provisioned by this StorageClass to keep their data when the claim is deleted, so it can be recovered manually. What should you configure?
Show answer and explanation
Answer:
Dynamically provisioned PersistentVolumes inherit their reclaim policy from the StorageClass that created them, and that field defaults to Delete, which is why the disk vanished with the claim. Setting reclaimPolicy: Retain on the StorageClass means new PersistentVolumes move to the Released state instead of being deleted when their claim goes away, keeping the underlying storage and its data until an administrator reclaims it manually.
Note that this affects newly provisioned volumes. The policy of an existing PersistentVolume can be changed in place by patching its persistentVolumeReclaimPolicy field.
Option B puts the field on the wrong object. A PersistentVolumeClaim has no persistentVolumeReclaimPolicy field; the policy lives on the PersistentVolume, and on the StorageClass for volumes yet to be provisioned.
Option C confuses access modes with lifecycle. ReadWriteMany controls how many nodes may mount the volume simultaneously and has no bearing on what happens when the claim is deleted.
Option D names a policy that no longer applies. Recycle is deprecated, is not supported by dynamic provisioning, and in any case its behaviour was to scrub the volume's data, the exact outcome you are trying to avoid.
Reference: Reclaiming PersistentVolumes