Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude PV and PVC in velero backups #1543

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

rakeshgm
Copy link
Member

@rakeshgm rakeshgm commented Sep 4, 2024

fixes #1540 - used Option 2 from the issue description to disable PV and PVC backup.

@@ -371,7 +371,8 @@ func getBackupSpecFromObjectsSpec(objectsSpec kubeobjects.Spec) velero.BackupSpe
IncludedResources: objectsSpec.IncludedResources,
// exclude VRs from Backup so VRG can create them: see https://github.com/RamenDR/ramen/issues/884
ExcludedResources: append(objectsSpec.ExcludedResources, "volumereplications.replication.storage.openshift.io",
"replicationsources.volsync.backube", "replicationdestinations.volsync.backube"),
"replicationsources.volsync.backube", "replicationdestinations.volsync.backube",
"PersistentVolumeClaims", "PersistentVolumes"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may break user depending on velero backing up pvcs and pvs that ramen does not manage.

Option 1 (using the special velero lable) is little more work, but avoids this issue.
At the point we add and remove the ramen finalizer, we can also add the special velero label.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exclude and include resources here are per backup(esp. backup-name) and does not effect cluster wide. And our backups are uniquely named. So, ramen manages only this backup and not the others.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ramen backup is used by recipes that may want to backup other pvcs and pvs that ramen is not protecting. Using the label we can ensure that velero will not backup up or restore the pvs and pvcs we manage, without affecting other pvs and pvcs.

@rakeshgm
Copy link
Member Author

rakeshgm commented Sep 9, 2024

I ran e2e-tests locally and they did not fail.

@ShyamsundarR ShyamsundarR merged commit 9b1872b into RamenDR:main Sep 12, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable the backup of PVC through velero
3 participants