Let's perform the following steps to restore the application from its backup:
- Delete the application and its PVC to simulate a data loss scenario:
$ kubectl delete pvc pvc2backup -nbackup-example
$ kubectl delete pod myapp -nbackup-example
- Restore your application from your previous backup called myapp-backup:
$ velero restore create --from-backup myapp-backup
- Confirm your application is running:
$ kubectl get pod -nbackup-example
NAME READY STATUS RESTARTS AGE
myapp 1/1 Running 0 10m
- Confirm that our myapp pod writes data to the volume:
$ kubectl exec -it myapp cat /data/out.txt -nbackup-example
With that, you've learned how to restore an application and its volumes from its backup using Velero.