Adding Support For VolumeAttributes in Resource Policy #8382
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for contributing to Velero!
Summary of your changes
Currently Velero Resource policies are only supporting "Driver" to be filtered in CSI volume conditions
We are adding support for filtering Persistent Volumes (PVs) based on additional VolumeAttributes properties under CSI PVs.
Use Case:
Customers asked to back up AFS (Azure file shares) and want to only backup SMB type of file share volumes and not NFS file share volumes.
How Provisioning happens:
Define the Storage class with
protocol: nfs
under storage class parameters to provision CSI NFS Azure File Shares.Link: https://learn.microsoft.com/en-us/azure/aks/azure-files-csi#nfs-file-shares
The same
protocol:nfs
property will be floated to the PersistentVolumes as part of CSI VolumeAttributes.Constraints with current Velero Resource Policies:
As the current resource policies only offer to filter based on the driver type, we are bringing an additional filter VolumeAttributes to extend and allow customer to skip/snapshot only certain types of persistent volumes for the same driver.
Sample AFS NFS PV attached below:
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.