Taking a backup of an entire namespace

When you take backups, you can use different types of selectors or even complete sources in a selected namespace. In this recipe, we will include resources in a namespace by performing the following steps:

  1. Take a backup of the entire namespace using the following command. This example includes the backup-example namespace. Replace this namespace if needed. The namespace and resources should exist before you can execute the following command:
$ velero backup create fullnamespace --include-namespaces backup-example
  1. If you need to exclude specific resources from the backup, add the backup: "false" label to them and run the following command:
$ velero backup create fullnamespace --selector 'backup notin (false)'

With that, you've learned how to create backups of resources in a given namespace using Velero.