Administrators can create a restore policy to specify the rules a restore job has to comply with when it performs a restore operation.
Create Restore Policy¶
Follow below steps to create a restore policy for your clusters:
- From web console, navigate to Backup/Restore -> Policies menu to add "New Policy"
- Enter a name and an optional description
- Select Type "Restore"
- In the Restore Policy Settings page > Config section, check/uncheck "Restore PVs" checkbox to enable/disable restore persistent volume data.
Example: Control Plane and PVs¶
Here is an example of a policy to restore both cluster control plane and persistent volumes data
Example: Only Control Plane¶
Here is an example of a policy to restore only cluster control plane data and no persistent volumes.
In a manner similar to a backup policy, administrators can specify fine-grained controls for the restore policy. You can optionally use "target selectors" to refine the scope of the backup policy. You have three options
- Include namespaces (restores performed only from the selected namespaces)
- Exclude namespaces (skip these namespaces for restore operations)
- Specify label selectors (restore resources that match the labels)
Here is an example of a restore policy where the administrator only wishes to restore the cluster data for the "apache" namespace
RCTL for Restore Policy¶
Administrators can also create a restore policy through RCTL using the below commands to specify the rules a restore job has to comply with when it performs a restore operation
Create Restore Policy
./rctl create dp-policy <name> --type <restore> --restore-pvs --include-namespace <include-ns> --exclude-namespace <exclude-ns> --label-selector <key:value,key:"",key:value>
./rctl delete dp-policy <name>
./rctl get dp-policy <name>
Update Restore Policy