vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.42k stars 1.37k forks source link

[RFE] Restore a single PV along with its FSB data. #7719

Open FredNass opened 2 months ago

FredNass commented 2 months ago

Hello,

I'm opening this issue as suggested here by @reasonerjt to discuss the ability for Velero to restore only a single PV along with its FSB data.

Currently, restoring a PV and its data implies restoring the original app as a whole with all its Kinds in a new mapped namespace otherwise files are not restored in the PV(s), and then set the restored PV persistentVolumeReclaimPolicy to Retain (if set to Delete), detach this PV from the restored PVC and then either:

Both tasks are a bit tedious and implies restoring many unneeded resources as of now.

It would be nice if Velero could allow the admin to restore a PV along with its data bound to a PVC created in original namespace (PVC's name would be suffixed by velero restore job's name for example). Velero could also provide a way to attach the restored PVC/PV to any pods (--attach-pv-to-pod) during the restoration and provide a way to detach it afterwards (--detach-pv-from-pod), if possible.

This could provide more fine grained control on PVs / files restoration with Velero. Also, PV selection by PVC/PV name would help the admin to restore a single PV instead of all PVs present in the backup.

reasonerjt commented 2 months ago

Thanks @FredNass A valid workaround may be to choose to restore the pod and pvc and use resource-modifier to change the image of a "dummy pod" like "pause".

Per discussion, this is probably a low priority for now, putting it in "icebox"