Velero: Namespace with label velero.io/exclude-from-backup=true should exclude all resources within from backing up

Created on 10 Apr 2020  路  4Comments  路  Source: vmware-tanzu/velero

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 label velero.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 (use velero version):
Client:
    Version: v1.3.1
    Git commit: -
Server:
    Version: v1.3.1
  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:16:51Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:07:57Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
  • Kubernetes installer & version:
kubeadm version: &version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:14:19Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
EnhancemenUser Reviewed Q2 2021

Most helpful comment

馃憤 I think this is reasonable, too, since annotating everything in a namespace could be pretty tedious.

All 4 comments

@iblackman I think that could be reasonable behavior for when the velero.io/exclude-from-backup=true is applied to a Namespace resource. Right now, it results in just the Namespace resource itself being excluded, but any other resources in that namespace would still be backed up.

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.

@skriss

Do you have any interest in working on a PR for this, if we decide it makes sense to implement?

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.

Was this page helpful?
0 / 5 - 0 ratings