Backup and Restore TopoLVM Filesystem PVCs with Velero
Velero enables backup and restoration of Persistent Volume Claims (PVCs) and Persistent Volumes (PVs) for TopoLVM filesystems. This functionality is integrated into the platform.
This guide applies specifically to TopoLVM filesystem PVCs.
TOC
Prerequisites
- Deploy the "Alauda Container Platform Data Backup for Velero" via the Marketplace/Cluster Plugins.
- Configure an S3-compatible storage for Velero's
BackupStorageLocation. Use platform-provided Ceph or MinIO object storage.
Limitations
- The S3 storage must have sufficient free space to store all PV data from the target cluster.
- During restoration, the namespace quota and storage class must support the total capacity of all PVCs.
Procedure
- Ensure an S3-compatible storage is available.
- Navigate to Administrator > Cluster Management > Backup and Restore > Backup Repository.
- Create a backup repository using the object storage credentials.
-
Label the PVCs and associated pods to be backed up:
Velero needs a pod to restore a Filesystem PVC. The pod mounts the PVC for Velero to import data; without a pod, the PVC remains Pending. For complex apps, pause the application and attach the PVC to a lightweight pod (e.g., Nginx) for backup/restore, then restore the original app configuration post-restoration.
kubectl label pvc -n <namespace> <pvc-name> velero-backup=true
kubectl label pod -n <namespace> <pod-name> velero-backup=true
-
Go to Backup and Restore and create a new backup:
-
Select Backup Kubernetes Resources and PVC Data Volumes.
-
Choose the namespaces containing the data to back up.
-
Configure the backup with the following settings:
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: <backup-name>
namespace: cpaas-system
annotations:
cpaas.io/description: ''
spec:
template:
includedNamespaces:
- <namespace>
includedResources:
- '*'
labelSelector:
matchLabels:
velero-backup: 'true'
excludedNamespaces: []
excludedResources: []
defaultVolumesToFsBackup: true
storageLocation: default
ttl: 720h
schedule: '@every 876000h'
skipImmediately: false
status:
phase: Enabled
-
After the backup completes, verify the data in the S3 bucket (e.g., MinIO):
mc ls <minio-alias>/<bucket-name>/<backup-path>/<namespace>/
Example output:
[2025-03-14 00:18:33 CST] 155B STANDARD config
[2025-03-14 09:04:56 CST] 0B data/
[2025-03-14 09:04:56 CST] 0B index/
[2025-03-14 09:04:56 CST] 0B keys/
[2025-03-14 09:04:56 CST] 0B snapshots/
Step 3: Restore Cluster
- In the target cluster, configure the same S3 bucket as used for the backup. Velero will automatically detect the existing backup.
- Navigate to Backup and Restore and create a restore task:
- Select the namespace(s) to restore.
- In the advanced configuration, map the original namespace to the target namespace if needed.
- Execute the restore operation.
- After restoration, verify:
- PVC names match the original cluster.
- Application data in the PVCs is intact and accessible.