-
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
Namespace with label velero.io/exclude-from-backup=true should exclude all resources within from backing up #2413
Comments
@iblackman I think that could be reasonable behavior for when the Let's see what other maintainers think (cc @nrb @carlisia @ashish-amarnath). Do you have any interest in working on a PR for this, if we decide it makes sense to implement? |
👍 I think this is reasonable, too, since annotating everything in a namespace could be pretty tedious. |
I can try to if you decide it makes sense, even though I don't have much experience with Go. |
👍 from me. Excluding namespace resources when the namespace is excluded is very intuitive. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This would be great! We have transient namespaces in our environment. |
velero/pkg/backup/item_backupper.go Line 79 in e9c9978
|
in the doc: https://velero.io/docs/v1.9/resource-filtering/#veleroioexclude-from-backuptrue
Is this label a generic way to exclude some k8s resources from backup? |
@euclidsun Yes -- this label is applied at the resource level, and any resource with it won't be included, whether it's a pod, a secret, etc. The feature request in this issue is to treat this label on a namespace as a special case -- if a namespace has exclude-from-backup=true, then exclude everything in the namespace. Essentially, adding this label to a namespace would be equivalent to setting |
Describe the problem/challenge you have
I want to have an option to exclude a namespace (all resources) without needing to edit velero config every time I create a new namespace. The actual option of
--exclude-namespaces
isn't enough because I don't want to create a naming pattern because of velero and since it already accept the labelvelero.io/exclude-from-backup=true
to exclude resources dynamically why not treat everything from a namespace with that label as if all have that label? It just doesn't make sense for me to only skip the resource namespace backup but backup all the resources within it.Describe the solution you'd like
A namespace with label
velero.io/exclude-from-backup=true
should be enough to exclude all resources in that namespace from velero backup without the need to add that label to all of them.Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
velero version
):kubectl version
):/etc/os-release
):The text was updated successfully, but these errors were encountered: