Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibility to backup resources in namespaces matching a label #8340

Closed
lorenzofelletti opened this issue Oct 23, 2024 · 6 comments
Closed

Comments

@lorenzofelletti
Copy link

lorenzofelletti commented Oct 23, 2024

Describe the problem/challenge you have
On thing I need to do is to backup all resources in namespaces matching a certain label, e.g. all the namespaces having label backup: true, or something like that.

Describe the solution you'd like
New version of Schedule/Backup spec supporting this option. Something like:

apiVersion: velero.io/v2alpha1
kind: Backup
metadata:
  name: a
  namespace: velero
spec:
  namespaceSelector:
    matchLabels:
      backup: "true"

Changing the BackupSpec type to something like:

type BackupSpec struct {
    // ...
    NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
    // ...
}

Anything else you would like to add:

Environment:

  • Velero version (use v1.14.0):
  • Kubernetes version (use v1.30.2):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):

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.

  • 👍 for "The project would be better with this feature added"
  • 👎 for "This feature will not enhance the project in a meaningful way"
@kaovilai
Copy link
Member

@kaovilai
Copy link
Member

if the documentation are unclear please list the pages needing updating.

@lorenzofelletti
Copy link
Author

So labelSelector will backup any resource in the namespace with backup: true, regardless if individual resources in that namespace have such label in turn? If that's the current labelSelector field then I didn't know it

@lorenzofelletti
Copy link
Author

As per the docs here:

  # Individual objects must match this label selector to be included in the backup. Optional.
  labelSelector:

To be clear, that is not the behaviour I want to achieve. I'd like to set the label on the namespace object, and have all resources in that namespace backed up (regardless of individual objects labels)

@kaovilai
Copy link
Member

dupe of #7492 requirements then. We're saying the said requirements are not met?

@lorenzofelletti
Copy link
Author

lorenzofelletti commented Oct 23, 2024

Yes, it looks like it is. Closing this one.

Thank you for the quick reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants