vmware-tanzu / velero

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

(GCP): Add an ability to change the destination AZ while restoring. #8247

Open tuusberg opened 1 month ago

tuusberg commented 1 month ago

Describe the problem/challenge you have

We are using Velero to restore volumes from our production cluster that spans across multiple AZs to our dev cluster which is single-AZ for costs reasons. We tried using a StorageClass with topology constraints but it didn't work because the plugin always uses the source AZ when it creates volumes from volume snapshots. We need a way to override the default AZ for restores to dev cluster.

More than happy to open a PR as I believe I know how to add this functionality to the plugin with a few lines of code.

Describe the solution you'd like

A possible solution would be:

  1. Configure the AZ override via plugin configuration.
  2. Check for the override inside CreateVolumeFromSnapshot method and replace volumeAZ value with the one provided by user.

Anything else you would like to add:

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.