-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Select namespace to include by its labelSelector #7492
Comments
@kaovilai |
Ok. I think we can make it work within 7105. If user label a namespace to backup, I think they would want everything in it.. thus it should behave equivalently to includedNamespaces. No need for new flag. |
The PR #7697 addresses this requirement. |
Re closing as completed per 7697. |
tbh after checking that PR, I still don't get how to backup selected namespaces upon their label. |
@muellerfabi
|
Which is equivalent to |
Say there is a namespace |
reports in #8340 say resources under labeled namespaces that are itself not labeled are not included. |
reopening for
|
Personally, I see two ways for implementing this – slightly different semantically – and I don't have a strong preference for one or the other. Either way, is a feature I'd really like to have when defining backups. Approach 1One way is the one proposed in #8342, i.e. if a matching label selector is put on the namespace this means that we want all resources in that namespace to be backed up also, thus treating them as "subresources of the namespace". Pros
Cons
Approach 2Another way to approach the problem, which is consistent with the current way backups work, is to have a separate selector, say Pros
Cons
|
#8342 way is chosen because I believe overall sentiment is to not "introduce new filter". And I think expectations of most users when trying to label NS is like approach 1. but approach 2 is ok too and was the original proposal.
|
@lorenzofelletti @shubham-pampattiwar please help list scenarios where you may find ability to use label to choose includedNamespaces better than writing individual namespaces into backup spec. From what I'm gathering, it appears so user don't have to motify their backup yaml and reuse the same backup as their need changes by labeling namespaces needed via other tools like kubectl or even argocd. I need to double check the implementation that backup describe lists the namespaces included by label. |
A use case in which that would be a nice feature to have is to define the Schedule once, and then don't have to worry about keeping it in sync every time you add a new namespace. |
Thanks for the input, but I didn't quite understand your point. |
Sorry I didn't explain my point clearly enough in the previous message. This is a scenario I encountered that would improve with such a feature:
One invariant we know is that all namespaces we care to backup will have a specific label. Such a feature would allow us to define the Schedule once, then deploy it on each cluster, and never having to update it (unless for functional changes). Right now, on the other hand, we need to tailor the Schedule to each cluster it will be deployed on (because each cluster will have its own list of namespaces), and also whenever someone adds a new namespace need to make sure that the new namespace is added to the list of included namespaces. |
Describe the problem/challenge you have
User expect when specifying backup selector to match a namespace labelselector that all content of that namespace is included in backup.
When we are saying 'namespace backup' we mean backup of the namespace content. Similarly as it works when using spec.includedNamespaces
old request prior to #8342
includedNamespacesByLabelSelector
Equivalent toincludedNamespaces
in Backup/Restore CR but not by name, but namespace's labelSelector.User would not have to label each item inside the namespace, they can update which namespaces have this label, which on a future run manually or via schedule, could desirably result in different list of namespaces being included.
Not to be confused with #7105 which wants to exclude namespaces not containing backup items selected by label.
Describe the solution you'd like
#8342
old solutions prior to #8342
includedNamespacesByLabelSelector
Equivalent toincludedNamespaces
in Backup/Restore CR but not by name, but namespace's labelSelector.User would not have to label each item inside the namespace, they can update which namespaces have this label, which on a future run manually or via schedule, could desirably result in different list of namespaces being included.
Not to be confused with #7105 which wants to exclude namespaces not containing backup items selected by label.
Anything else you would like to add:
Environment:
velero version
):kubectl version
):/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.
Hackaround
and if you need this to be a schedule, can probably also wrap this into a kubernetes cronjob
The text was updated successfully, but these errors were encountered: