Create a recovery plan
Describes how to create a recovery plan on the console.
This topic describes how to create a recovery plan on the console.
Prerequisites
- You have created a backup plan and the backup job is successfully executed.
- You have enabled the KubeSphere Backup component.
Create a recovery plan
Log in to the KubeSphere Cloud platform with your account.
In the upper-right corner, hover your cursor over the username area and click Console from the drop-down list.
In the navigation pane on the left, click Backup and Recovery > Recovery Plans, and then click Create Recovery Plan.
common:NOTE
You can also click Create under Recovery Plans on the Overview page.
On the Create Recovery Plan page, set the following parameters.
Parameter Required Description Name Yes User-defined name of the recovery plan. The name can contain only lowercase letters, numbers, and hyphens (-), and must start and end with a lowercase letter or number. The maximum length is 63 characters. Backup Jobs Yes Select the backup job to be used for the recovery plan. You can specify the backup job from the existing executed ones or by filtering them: - Click the
Specify backup time
box and select one day or a period in the pop-up menu to specify the time when the backup job was executed. - Click the search box, select
Name
orNamespace
, enter the name of the backup plan or the name of the source namespace, and press Enter to search for the backup job.
Description No User-defined description of the recovery plan. Recovered To Yes - Target Cluster: Select an imported Kubernetes cluster from the drop-down list as the target cluster for the recovery plan.
If you have not imported the target cluster, click Import to import it. After the target cluster is imported, click and then select it from the drop-down list. - Namespace Mapping: Set the mapping relationship between the source and target namespaces.
Volumes No If you select Copy Volumes or select Export snapshot when choosing Use CSI Snapshot, the following parameters are displayed. - Source Storage Class: Name of the source storage class.
- Target Storage Class: When there is a storage class on the target cluster, the system automatically matches the source and the storage class, and you can also change the mapping relationship. When there is no storage class on the target cluster, the value of Target Storage Class is Unmatched. Then, you need to click "No storage class available for recovery in the target cluster?" and create a storage class as prompted. For more information, please refer to Create a storage class.
- Click the
After setting the parameters, click OK. The created recovery plan is displayed in the list.
common:NOTE
Each recovery plan uses 1 protected application. On the Overview page, click Usage Records in Subscription to view the protected applications used by recovery plans.
Create a storage class
When there is no storage class on the target cluster, perform the following steps to create one.
Create a YAML file, for example,
sc.yaml
.apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: standard provisioner: kubernetes.io/aws-ebs parameters: type: gp3 reclaimPolicy: Retain allowVolumeExpansion: true mountOptions: - debug volumeBindingMode: Immediate
common:NOTE
Content in the YAML file is for reference only, and you need to customize it based on your actual situation. For more information, please refer to Kubernetes Documentation.
Run the following command to create a storage class:
kubectl apply -f sc.yaml
Run the following command to check whether the storage class has been successfully created:
$ kubectl get storageclass NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE local (default) openebs.io/local Delete WaitForFirstConsumer false 24h standard kubernetes.io/aws-ebs Retain Immediate true 21s