vmware-tanzu / velero

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

Override current pv data with new restore #8047

Open TheCodingSheikh opened 1 month ago

TheCodingSheikh commented 1 month ago

the first restore creates the pv, pvc, pods etc.. when restoring a second time with a new backup, the new data is not restored in the pv. what i'm doing is deleting the pods so that they are created again with the initContainer (velero-restore-helper) and it will add the new data that was backed up from original pv. is there a better solution to this?

sseago commented 1 month ago

@TheCodingSheikh Currently, the workaround you describe is the only option. There's a design proposal to implement what you're asking for, though: https://github.com/vmware-tanzu/velero/pull/7481

TheCodingSheikh commented 1 month ago

@sseago thanks I read that using csi snapshot backup will make it work, is this claim true? I haven't honestly tried yet with csi, i just want to confirm. Im using rook ceph fyi

sseago commented 1 month ago

@TheCodingSheikh you will need to delete the PVC for restore from CSI snapshot, since snapshots can't update existing volumes. And you'll need to delete the pod since the PVC won't actually be removed until the mounting pod is gone.