Skip to content

Commit 55a99e6

Browse files
authored
Merge pull request #32570 from deepakkinni/pv_doc_up_v1
Docs for changes related to HonorPVReclaimPolicy feature
2 parents 9ce963a + 5d0146b commit 55a99e6

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

content/en/docs/concepts/storage/persistent-volumes.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,66 @@ spec:
175175
176176
However, the particular path specified in the custom recycler Pod template in the `volumes` part is replaced with the particular path of the volume that is being recycled.
177177

178+
### PersistentVolume deletion protection finalizer
179+
{{< feature-state for_k8s_version="v1.24" state="beta" >}}
180+
181+
Finalizers can be added on a PersistentVolume to ensure that PersistentVolumes
182+
having `Delete` reclaim policy are deleted only after the backing storage are deleted.
183+
184+
The finalizer `kubernetes.io/pv-controller` is added to in-tree plugin volumes. The following is an example
185+
186+
```shell
187+
kubectl describe pv task-pv-volume
188+
Name: task-pv-volume
189+
Labels: type=local
190+
Annotations: <none>
191+
Finalizers: [kubernetes.io/pv-protection, kubernetes.io/pv-controller]
192+
StorageClass: standard
193+
Status: Bound
194+
Claim:
195+
Reclaim Policy: Delete
196+
Access Modes: RWO
197+
Capacity: 1Gi
198+
Message:
199+
Source:
200+
Type: HostPath (bare host directory volume)
201+
Path: /tmp/data
202+
HostPathType:
203+
Events: <none>
204+
```
205+
206+
The finalizer `external-provisioner.volume.kubernetes.io/finalizer` is added for CSI volumes.
207+
The following is an example:
208+
```shell
209+
Name: pvc-2f0bab97-85a8-4552-8044-eb8be45cf48d
210+
Labels: <none>
211+
Annotations: pv.kubernetes.io/provisioned-by: csi.vsphere.vmware.com
212+
Finalizers: [kubernetes.io/pv-protection external-provisioner.volume.kubernetes.io/finalizer]
213+
StorageClass: fast
214+
Status: Bound
215+
Claim: demo-app/nginx-logs
216+
Reclaim Policy: Delete
217+
Access Modes: RWO
218+
VolumeMode: Filesystem
219+
Capacity: 200Mi
220+
Node Affinity: <none>
221+
Message:
222+
Source:
223+
Type: CSI (a Container Storage Interface (CSI) volume source)
224+
Driver: csi.vsphere.vmware.com
225+
FSType: ext4
226+
VolumeHandle: 44830fa8-79b4-406b-8b58-621ba25353fd
227+
ReadOnly: false
228+
VolumeAttributes: storage.kubernetes.io/csiProvisionerIdentity=1648442357185-8081-csi.vsphere.vmware.com
229+
type=vSphere CNS Block Volume
230+
Events: <none>
231+
```
232+
233+
Enabling the `CSIMigration` feature for a specific in-tree volume plugin will remove
234+
the `kubernetes.io/pv-controller` finalizer, while adding the `external-provisioner.volume.kubernetes.io/finalizer`
235+
finalizer. Similarly, disabling `CSIMigration` will remove the `external-provisioner.volume.kubernetes.io/finalizer`
236+
finalizer, while adding the `kubernetes.io/pv-controller` finalizer.
237+
178238
### Reserving a PersistentVolume
179239

180240
The control plane can [bind PersistentVolumeClaims to matching PersistentVolumes](#binding) in the

0 commit comments

Comments
 (0)