From 9b1872b15cdf94d8c1439662655a9e7ee3b639ac Mon Sep 17 00:00:00 2001 From: rakeshgm Date: Tue, 3 Sep 2024 20:18:22 +0530 Subject: [PATCH] exclude PV and PVC in velero backups Signed-off-by: rakeshgm --- docs/krp.md | 3 ++- internal/controller/kubeobjects/velero/requests.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/krp.md b/docs/krp.md index 06cd9e6ea..abf549c05 100644 --- a/docs/krp.md +++ b/docs/krp.md @@ -96,7 +96,8 @@ The VRG enables Kubernetes resources to be captured(backed up) and recovered as part of disaster protection. This is accomplished through the kubeObjectProtection section of the VRG spec. If kubeObjectProtection is not included in a VRG, then Kubernetes resources are not protected as part of the -VRG disaster protection. +VRG disaster protection. PVCs and PVs are protected by Ramen and all resources +are protected and backed by kubeObjectProtection. The kubeObjectProtection section contains two sub-sections, captureOrder and recoverOrder. This captureOrder section provides instructions on how to backup diff --git a/internal/controller/kubeobjects/velero/requests.go b/internal/controller/kubeobjects/velero/requests.go index a0dbbfb30..4c46e1eb3 100644 --- a/internal/controller/kubeobjects/velero/requests.go +++ b/internal/controller/kubeobjects/velero/requests.go @@ -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"), LabelSelector: objectsSpec.LabelSelector, OrLabelSelectors: objectsSpec.OrLabelSelectors, TTL: metav1.Duration{}, // TODO: set default here