vmware-tanzu / velero

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

velero.io/exclude-from-backup as annotation #7320

Open pschichtel opened 10 months ago

pschichtel commented 10 months ago

Describe the problem/challenge you have

Quite a few operators and helm charts do not easily support setting labels on pods or PVCs, but make it very simple to set annotations on the same objects. This makes it difficult to exclude PVCs from these deployments from velero's backups using velero.io/exclude-from-backup: "true" as a label.

Describe the solution you'd like

In additional to the velero.io/exclude-from-backup label, also support it as an annotation.

Anything else you would like to add:

Upon thinking about it, I even think that an annotation would be a better fit than a label. Labels are meant for filtering objects when querying, annotations are for generic metadata.

Environment:

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.

pschichtel commented 10 months ago

My latest example of this issue is the official opensearch helm chart, which allows adding annotations to the StatefulSet's volumeClaimTemplate, but it only allows to add the "default labels", which include other stuff which is not wanted on the PVCs.

Adding the label to the "default labels" also adds the annotation to all other objects, which don't need the label. Annotations can be configured freely.

reasonerjt commented 10 months ago

Quite a few operators and helm charts do easily support setting labels on pods or PVCs, but make it very simple to set annotations on the same objects.

Do you mean Quite a few operators and helm charts "do not" xxx?

I think this is opinionated, given velero already supports the label approach in this scenario, I don't think it's a high priority to additionally support annotation.

Let's keep this open and see if there's strong request. I'm putting this into "ice-box"

pschichtel commented 10 months ago

Do you mean Quite a few operators and helm charts "do not" xxx?

ops, yes, I corrected that.

I think this is opinionated, given velero already supports the label approach in this scenario, I don't think it's a high priority to additionally support annotation.

If a PR were to appear that implements this, would it be accepted?

reasonerjt commented 10 months ago

If a PR were to appear that implements this, would it be accepted?

That will be a collective decision after discussion with other maintainers. TBH, I personally would be a little reluctant to give a "+1"

pschichtel commented 10 months ago

TBH, I personally would be a little reluctant to give a "+1"

could you elaborate? If this has no chance of getting implemented then we might as well close this issue now.