-
Notifications
You must be signed in to change notification settings - Fork 591
Description
ceph supports moving volumes into the trash to be deleted at a configurable time later.
This is very useful to recover from accidentally deleted images
It appears ceph-csi does not allow to configure retention time for deleted volumes, it is hardcoded to 0 seconds
https://github.com/ceph/ceph-csi/blob/devel/internal/rbd/rbd_util.go#L710
tested with v3.14.1
rbd ls | grep csi-vol-f3c2954b-1ede-40b4-aada-215719a2fafe
csi-vol-f3c2954b-1ede-40b4-aada-215719a2fafe
kubectl delete pvc name
rbd trash ls
# empty
It would be nice if volumes created by ceph-csi could always have a retention time on deleted volumes. Having a single global value for all managed volumes would be sufficient.
What is the value to the end user?
It is easy to accidentally delete a persistentvolumeclaim with a volume with reclaimpolicy: delete, directly or indirectly via e.g. namespace deletion.
It would be valuable that this could be recovered by restoring the volume on the ceph store from the trash and restoring the persistentvolume object that that has been backed up via other means.
reclaimpolicy: retain provides this option but in multitenant clusters retaining persistentvolumes introduces additional complexity in handling permissions for reclaiming and cleanup of old volumes.
It also does not protect from accidentally deleting the persistentvolume itself (though that is less likely to happen on accident).