Backup and Restore
Explore this Page
- Overview
- Supported Backup Storages
- Requirements
- Installing Velero for Backup and Restore
- Backup Process
- Creating a Backup
- Restoring from a Backup
- Uninstalling Velero Components
- Benefits of Backup and Restore
Overview
The Backup and Restore feature in DataCore Puls8 helps you protect your persistent volume data in Kubernetes environments. By enabling backup and restore operations, you can recover from node failures, crashes, or accidental deletions, and ensure that your data remains portable and compliant. DataCore Puls8 integrates with certified solutions like Velero to support snapshot-based backups for selected storage engines.
This document describes how you can enable, configure, and perform backup and restore operations for supported volumes in DataCore Puls8.
Supported Backup Storages
DataCore Puls8 supports multiple storages:
- Local Storage: Local PV ZFS.
- Replicated Storage: Replicated PV Mayastor
To simplify backup operations, DataCore Puls8 bundles Velero as a chart dependency. You can enable Velero using the kubectl-puls8
CLI to streamline operations such as creating and restoring backups.
Requirements
Before you enable Velero using the kubectl-puls8
command, ensure the following requirements are met:
- Velero CLI: You must install the Velero CLI version 1.14.x on your local system. You can download the appropriate binary from the Velero GitHub releases page.
- DataCore Puls8 Helm Chart: Ensure that the DataCore Puls8 Helm chart is already installed on your cluster.
Installing Velero for Backup and Restore
Create a Cloud Provider Secret
Create a secret containing credentials for the cloud provider that hosts your S3-compatible bucket.
kubectl create secret generic velero-gcp-creds \
--from-file=cloud=/path/to/secret_file \
-n puls8
cloud
is the key name used inside the secret object.
Install Velero with DataCore Puls8 Integration
Install Velero along with a default backup bucket hosted on a cloud provider.
kubectl-puls8 velero install \
--release-name puls8 \
--chart-name oci://registry-1.docker.io/datacoresoftware/puls8 \
--namespace puls8 \
--credential velero-gcp-creds=cloud \
--backup-bucket gcp-bucket \
--provider gcp
--credential
: Format assecretName=dataKey
. This maps the Kubernetes Secret and its internal key used for cloud authentication.--backup-bucket
: S3-compatible bucket where your backup data is stored.--provider
: The cloud provider where your bucket is hosted (gcp
,aws
, orazure
).
Optional: Additional S3 Configuration
You can pass advanced S3 configurations using the --config
flag. For example, if your AWS bucket is located in the ap-south-1
region:
kubectl-puls8 velero install \
--release-name puls8 \
--chart-name oci://registry-1.docker.io/datacoresoftware/puls8 \
--namespace puls8 \
--credential velero-aws-creds=cloud \
--backup-bucket aws-bucket \
--config region=ap-south-1 \
--provider aws
"region",
"s3ForcePathStyle",
"s3Url",
"kmsKeyId",
"resourceGroup",
"subscriptionId",
"storageAccount",
"publicUrl",
"serviceAccount",
"insecureSkipTLSVerify",
After the installation, Velero server components and node agents will be deployed to your cluster.
Backup Process
When you create a Velero Backup custom resource (CR), a volume snapshot is created. Depending on whether you use the --snapshot-move-data
flag, the backup behavior changes:
If --snapshot-move-data
is used:
- Velero restores the snapshot into a new volume.
- The volume is attached to a data mover pod.
- The pod streams the volume’s contents to the configured S3-compatible object store.
- After the transfer, the snapshot and temporary volume are deleted.
- The final backup resides only in object storage (off-cluster).
If --snapshot-move-data
is not used:
- The snapshot remains in the local cluster.
- No data is uploaded to the S3 bucket.
- This allows for faster restores within the same cluster.
Snapshots created without --snapshot-move-data
are not portable and can only be restored on the same cluster.
If TTL (Time-to-Live) and backup frequency are not properly configured, excessive snapshots may accumulate on your volume, leading to:
- Increased storage usage
- Potential degradation of read performance
The TTL flag allows you to specify the backup retention period with the value specified in hours, minutes and seconds in the form --ttl 24h0m0s
. If not specified, a default TTL value of 30 days will be applied. Refer to the Official Velero Documentation for more information.
Recommended Backup Approach
You should evaluate your backup requirements before deciding whether to use --snapshot-move-data
.
- Use
--snapshot-move-data
if you want to restore workload and its associated data to a different cluster. - Avoid using
--snapshot-move-data
if you prefer local snapshot retention for faster, intra-cluster restores, but ensure TTL and schedule intervals are well-defined to prevent snapshot buildup and performance issues.
Creating a Backup
Create a backup of volumes from a specific namespace.
kubectl-puls8 velero backup create backup-1 -n puls8 --include-namespaces=default
If you need to use additional Velero flags, pass them using the --extra-flags
option.
For example, to back up only resources labeled with backup=true
:
kubectl-puls8 velero backup create backup-1 \
-n puls8 \
--include-namespaces default \
--extra-flags --selector backup=true
This ensures that only the labeled resources from the namespace are included in the backup.
You can also schedule backups using a cron expression. For example, to run a backup every minute:
kubectl-puls8 velero schedule create schdule-backup-1 \
--schedule "*/1 * * * *" \
-n puls8 \
--extra-flags --include-namespaces=default
If a node reboot occurs while one or more dataupload
CRs are still in progress, the backup operation may result in a Failed or PartiallyFailed state. However, if all dataupload
CRs have completed prior to the node reboot, the backup operation will successfully complete once the node becomes available again.
Adding New Backup Locations and Plugins
In certain scenarios, you may want to add new backup locations for storing your data. For example, to add an AWS bucket as a backup location:
Verify if the required Velero plugin is installed:
If the AWS plugin is not listed, you can add it using the following command:
Then, create the new backup location:
kubectl-puls8 velero backup-location create newbb \
--provider aws \
--config region=ap-south-1 \
--credential aws-velero-secret=cloud \
--bucket aws-bucket \
--namespace puls8
This enables you to back up data to the newly defined location using the specified AWS bucket.
Restoring from a Backup
Restore a backup.
kubectl-puls8 velero restore create restore-1 --from-backup my-fs-backup-3 -n puls8
If you want to restore the data to a different namespace than the one it was backed up from, specify a namespace mapping:
kubectl-puls8 velero restore create restore-1 \
--from-backup my-fs-backup-3 \
--restore-volumes=true \
-n puls8 \
--extra-flags --namespace-mappings default:restore
You can also restore from a scheduled backup instead of referencing a specific backup name:
kubectl-puls8 velero restore create restore-1 \
--from-schedule my-schedule \
-n puls8 \
--extra-flags --allow-partially-failed
The latest backup created by the given schedule is considered for the restore. If you do not pass the --allow-partially-failed
flag, the restore will only proceed from the latest backup with a Completed status.
Refer to the Velero Documentation for more advanced options and configuration details.
If a node reboot occurs while one or more datadownload
CRs are still in progress, the restore operation may result in a Failed or PartiallyFailed state. However, if all datadownload
CRs have completed before the node reboot, the restore operation will successfully complete once the node is back online.
Uninstalling Velero Components
If you no longer need backup and restore functionality, you can uninstall Velero and its associated components using the following command:
kubectl-puls8 velero uninstall \
--release-name puls8 \
--chart-name oci://registry-1.docker.io/datacoresoftware/puls8 \
-n puls8
This command removes all Velero-related components deployed in the specified namespace as part of the Puls8 chart.
Benefits of Backup and Restore
- Data Protection: You can recover from node failures, crashes, or accidental deletions.
- Application Portability: You can move applications and volumes across clusters or namespaces.
- Scheduled Backups: You can automate regular backups to meet compliance and retention goals.
- Environment Cloning: You can replicate production data into development or staging environments for testing.
- Simplified Operations: You can manage backup and restore workflows using the intuitive
kubectl-puls8
CLI.
Learn More