vmware-tanzu / velero

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

remove .velero folder after restic restore #2722

Closed vinayus closed 3 years ago

vinayus commented 4 years ago

i have been using velero(with restic) for my local backup and restore purposes. I did observe that during restore a folder named .velero is created in the volumes of every statefulset that is restored back.

can we have an enhancement where we can remove .velero as a cleanup?

why would this cause an issue even though it doesn't contain any data is because statefulset like kafka would parse the folder and complain them if it is not part of their topic partition table.

as a workaround i manually delete it and restart the pod but would love to have this minor enhancement included in newer release

[supreme@worker-16070 kafka-data]$ ls -a
----trimmed----
__consumer_offsets-8
__consumer_offsets-9
.lock
log-start-offset-checkpoint
meta.properties
recovery-point-offset-checkpoint
replication-offset-checkpoint
.velero
nrb commented 4 years ago

Thanks for the report @vinayus! This seems like a fairly low effort fix, so I'll add it to the backlog.

ashish-amarnath commented 4 years ago

There are a couple of things that make this change non-trivial.

The solution to this is to have the restic daemon-set pod to delete the .velero directory once restic-wait init container has completed. But this requires the restic-wait init container to communicate w/ the restic daemon set pod that it has "finished" waiting and has completed. The deletion of the doneFile can be used to signal this.

ashish-amarnath commented 4 years ago

@nrb removing this from the 1.5 milestone.

eleanor-millman commented 3 years ago

Closing because duplicate of #2812