libopenstorage / stork

Stork - Storage Orchestration Runtime for Kubernetes
Apache License 2.0
392 stars 89 forks source link

pb-8713: Added support for ExcludeResourceType option for applicationBackup #1873

Closed siva-portworx closed 4 days ago

siva-portworx commented 4 days ago

What type of PR is this?

Uncomment only one and also add the corresponding label in the PR: bug

What this PR does / why we need it:

pb-8713: Added support for ExcludeResourceType option for applicationBackup. Does this PR change a user-facing CRD or CLI?:

Is a release note needed?:

It is an improvement.

Does this change need to be cherry-picked to a release branch?: Yes, stork version, that is planned for px-backup 2.8.1 release.

Testing: Used mysql app namespace, which had PVC, PV, Deployment, ReplicaSet Case1: Exclude PersistentVolumeClaim: Expected : backup only the Deployment

ash-4.4$ cd pxbackupctl/linux/ bash-4.4$ ./pxbackupctl create backup --orgID default --backup-location-name minio --backup-location-uid ecfe4841-2507-4483-9669-3d3cff06c1ca --cluster self --cluster-uid 3942983a-fec4-429e-a453-d509f10ed098 --name exclude-pvc --exclude-resourcetypes "PersistentVolumeClaim" --namespaces mysql -e "localhost:10002" --authtoken=$auth Backup exclude-pvc created successfully bash-4.4$ Screenshot 2024-11-13 at 9 36 13 AM Case2: Full namespace backup: Expected : backup deployment, pvc. pv Screenshot 2024-11-13 at 9 41 33 AM

Case3: Include PVC and ReplicaSet ResourceType Expected :backup PVC/PV/ReplicaSet.

Screenshot 2024-11-13 at 9 52 13 AM Case4: Exclude PVC and Deployment ResourceType Expected :backup ReplicaSet. Screenshot 2024-11-13 at 9 53 50 AM

Case5: Will return error from stork as well, if both the ResourceType and ExcludeResourceType is set in the applicationBackup CR. For px-backup, we will return error from gRPC validation itself.

Screenshot 2024-11-15 at 9 43 45 AM

Note: Similar changes need to be done for the nfs executor as well. Will raise the kdmp PR.