Skip to content

allow configuring deleted volume retention time #5830

@juliantaylor

Description

@juliantaylor

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions