Application Backup¶
This article explains how to backup applications in DCE 5.0. The demo application used in this tutorial is called dao-2048 , which is a deployment.
Prerequisites¶
Before backing up a deployment, the following prerequisites must be met:
-
Integrate a Kubernetes cluster or create a Kubernetes cluster in the Container Management module, and be able to access the UI interface of the cluster.
-
The current operating user should have NS Editor or higher permissions, for details, please refer to Namespace Authorization.
-
Install the velero component, and ensure the velero component is running properly.
-
Create a deployment (the workload in this tutorial is named dao-2048 ), and label the deployment with app: dao-2048 .
Backup workload¶
Follow the steps below to backup the deployment dao-2048 .
-
Enter the Container Management module, click Backup Recovery -> Application Backup on the left navigation bar, and enter the Application Backup list page.
-
On the Application Backup list page, select the cluster where the velero and dao-2048 applications have been installed. Click Backup Plan in the upper right corner to create a new backup cluster.
-
Refer to the instructions below to fill in the backup configuration.
- Name: The name of the new backup plan.
- Source Cluster: The cluster where the application backup plan is to be executed.
- Object Storage Location: The access path of the object storage configured when installing velero on the source cluster.
- Namespace: The namespaces that need to be backed up, multiple selections are supported.
- Advanced Configuration: Back up specific resources in the namespace based on resource labels, such as an application, or do not back up specific resources in the namespace based on resource labels during backup.
-
Refer to the instructions below to set the backup execution frequency, and then click Next .
- Backup Frequency: Set the time period for task execution based on minutes, hours, days, weeks, and months. Support custom Cron expressions with numbers and
*
, after inputting the expression, the meaning of the current expression will be prompted. For detailed expression syntax rules, refer to Cron Schedule Syntax. - Retention Time (days): Set the storage time of backup resources, the default is 30 days, and will be deleted after expiration.
-
Backup Data Volume (PV): Whether to back up the data in the data volume (PV), support direct copy and use CSI snapshot.
- Direct Replication: directly copy the data in the data volume (PV) for backup;
- Use CSI snapshots: Use CSI snapshots to back up data volumes (PVs). Requires a CSI snapshot type available for backup in the cluster.
- Backup Frequency: Set the time period for task execution based on minutes, hours, days, weeks, and months. Support custom Cron expressions with numbers and
-
Click OK , the page will automatically return to the application backup plan list, find the newly created dao-2048 backup plan, and perform the Immediate Execution operation.
-
At this point, the Last Execution State of the cluster will change to in progress . After the backup is complete, you can click the name of the backup plan to view the details of the backup plan.