Backup & Restore Guide
1. Back Up a Cluster
To backup a cluster, ensure that Velero CLI is installed on your machine, to install velero CLI:
For MacOS:
brew install velero
For windows with Chocolatey
choco install velero
Back Up the Entire Cluster
Run the following command to back up all namespaces in the cluster (If you get an error saying it can’t find velero, add the flag --namespace <valero namespace>
):
velero backup create <BACKUP_NAME> --include-namespaces '*'
2. Restore a Cluster
Restore the Entire Cluster
To restore all namespaces from a backup:
velero restore create --from-backup <BACKUP_NAME>
Restore Specific Namespaces
To restore only specific namespaces:
velero restore create --from-backup <BACKUP_NAME> --include-namespaces <NAMESPACE_1>,<NAMESPACE_2>
Verify Restores
-
Describe a restore:
Terminal window velero restore describe <RESTORE_NAME> --details -
List all restores:
Terminal window velero restore get
3. Monitor Backup and Restore Operations
Logs for Backup Operations
kubectl logs deployment/velero -n velero
Logs for Restore Operations
kubectl logs deployment/velero -n velero
4. Schedule Automated Backups
Create a Recurring Backup Schedule
To schedule daily backups of all namespaces:
velero schedule create <SCHEDULE_NAME> \ --schedule="@every 24h" \ --include-namespaces '*'
Verify Schedules
To list all schedules:
velero schedule get