Backup using resource labels
Kubernetes allows you to selectively apply labels to the resources of a namespace in key-value format using the CLI. The Portworx Backup UI enables you to filter those labeled resources and then back up all such resources of the selected namespace.
For example, consider two namespaces, ns1 and ns2. Assume that ns1 has label x=y and ns2 has no label. Consider a resource called configmap1 in ns1 and configmap2 in ns2. When you apply a resource label a=b on configmap1 and configmap2 using the CLI, the resource label is applied to both resources regardless of which namespace they belong to.
If you filter a namespace in Portworx Backup with x=y and resource label a=b, only ns1 is displayed in the list. When you create a backup of ns1, Portworx Backup displays and fetches only configmap1 belonging to ns1 for the backup.
To filter and then back up the resources with preset labels:
-
Type the label name in the Add resource label field and press Enter.
-
Select the required namespace(s) and then click Backup:
noteThe label used to filter appears under the RESOURCE LABEL SELECTOR field of Create Backup window.
-
Click Create to back up only the labeled resources of the selected namespace(s).
note- If the selected namespace does not include resources with preset labels, then Portworx Backup ignores those resources for backup.
- For scheduled backup of resources, Portworx Backup checks for resources with preset labels in only those namespaces that were selected during the creation of backup.
- You can modify the resource labels for scheduled backups. For more information, refer to Manage Labels.