vmware-tanzu / velero

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

Request for Custom Configuration to Enhance Resource Filtering in Velero #7815

Open yuanqijing opened 5 months ago

yuanqijing commented 5 months ago

Describe the problem/challenge you have Current resource filtering in Velero lacks flexibility, as highlighted in previous discussions (issues #5152 and #5842). This issue suggests the development of a custom resource filter plugin framework that allows users define their own rules for what gets backed up. This plugin would evaluate resources based on user-defined conditions(via annotations or else), enabling more precise control over the backup process.

Describe the solution you'd like

Add a new custom plugin point during resource filtering process.

Anything else you would like to add:

Expected Benefits: Customization: Users can tailor backup rules to their specific needs. Efficiency: Avoid backing up unnecessary resources, saving storage and reducing overhead

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.

blackpiglet commented 5 months ago

https://velero.io/docs/main/resource-filtering/#resource-policies

Please check whether the resource policies can be the foundation of what you proposed.

yuanqijing commented 5 months ago

https://velero.io/docs/main/resource-filtering/#resource-policies

Please check whether the resource policies can be the foundation of what you proposed.

Thank you for your reply. Regarding my scenario, the challenge I am facing is as follows: I have several pods, such as Pod1, Pod2, and Pod3, along with associated PVCs, They all have the same label. Currently, Velero's resource filtering mechanism does not seem to allow for backing up a specific pod (like just backup Pod1) unless it is labeled (selected via a selector). We prefer not to label pods as we consider it an intrusive way. I have reviewed the relevant documentation, including Velero's resource filtering section, but it appears there are no existing capabilities that meet this requirement.

The resource policies seem to apply filter policies specifically to PVCs. If my understanding is incorrect, please correct me.

blackpiglet commented 5 months ago

You are right. The current resource policy only supports filtering on the volumes, because it only has a sub-resource called volume policy. My proposal was to extend the resource policy functionality to support your scenario.

yuanqijing commented 5 months ago

You are right. The current resource policy only supports filtering on the volumes, because it only has a sub-resource called volume policy. My proposal was to extend the resource policy functionality to support your scenario.

Understood, I will consider how to extend the resource policy. I'll update this issue with any developments.

reasonerjt commented 4 months ago

I think this is a valid requirement, but we may not have bandwidth to implement it in v1.15 timeframe.

Let me keep this in the backlog. If you are interested to contribute please write a design and I'm happy to discuss.