Restore from a backup
What you’ll accomplish
Section titled “What you’ll accomplish”You’ll restore specific namespaces from a completed Velero backup and confirm the restored state matches expectations.
Prerequisites
Section titled “Prerequisites”- UDS CLI installed
- Access to a Kubernetes cluster with UDS Core deployed
- A completed Velero backup to restore from (see Perform a manual backup)
Before you begin
Section titled “Before you begin”Before restoring, identify the backup you want to restore from:
uds zarf tools kubectl get backup -n velero --sort-by=.status.startTimestampOnly backups with a Completed phase can be used for a restore.
-
Restore a namespace
Create a restore for specific namespace(s) from a completed backup:
Terminal window uds zarf tools kubectl apply -f - <<EOFapiVersion: velero.io/v1kind: Restoremetadata:name: uds-restore-$(date +%s)namespace: velerospec:backupName: <backup-name>includedNamespaces:- <namespace>EOFAlternatively, if you have the Velero CLI installed:
Terminal window velero restore create uds-restore-$(date +%s) \--from-backup <backup-name> \--include-namespaces <namespace> --wait -
Verify the restore
Check the restore status:
Terminal window uds zarf tools kubectl get restore -n veleroInspect the restored namespace to confirm resources are present:
Terminal window uds zarf tools kubectl get pods -n <namespace>uds zarf tools kubectl get pvc -n <namespace>
Verification
Section titled “Verification”To run a full end-to-end disaster recovery drill:
- Create a test namespace with a deployment and ConfigMap.
- Trigger a manual backup (see Perform a manual backup).
- Delete the test namespace.
- Restore from the backup (step 1 above).
- Verify the namespace, deployment, and ConfigMap are restored.
Success criteria:
- Restore phase is
Completed - All expected resources exist in the restored namespace
- If volume snapshots were included, PVC data matches the pre-backup state
Troubleshooting
Section titled “Troubleshooting”Problem: Restore completed but resources are missing
Section titled “Problem: Restore completed but resources are missing”Symptoms: The restore phase shows Completed but expected resources are not present.
Solution: Verify the --include-namespaces scope matches the namespace you want to restore. Check that the backup actually captured the target namespace by inspecting the backup details:
uds zarf tools kubectl describe backup -n velero <backup-name>Look at the Included Namespaces and Excluded Namespaces fields to confirm scope, and check Items Backed Up to verify the resource count. Also confirm the backup was taken after the resources were created.
Problem: Volume restore fails
Section titled “Problem: Volume restore fails”Symptoms: PersistentVolumeClaims are recreated but contain no data.
Solution: Ensure the original PVC was deleted before running the restore. Verify that VolumeSnapshotContent resources exist for the backup:
uds zarf tools kubectl get volumesnapshotcontentIf VolumeSnapshotContents are missing, the backup may not have included volume snapshots. See Enable volume snapshots (AWS EBS) or Enable volume snapshots (vSphere CSI) to configure snapshot support.
Related documentation
Section titled “Related documentation”- Velero: Restore Reference — restore configuration and behavior
- Velero: How Velero Works — backup lifecycle and garbage collection
- Backup & restore concepts — how Velero fits into UDS Core
Next steps
Section titled “Next steps”These guides and concepts may be useful to explore next: