Skip to main content

Backup & Restore with Velero

This tutorial describes how to backup and restore a namespace with Velero. In this tutorial we'll use the tenant-demo namespace for this procedure.

be aware that CSI snapshotting doesn't work on the local Kind environment. On cloud environments this should actually be supported by the concerning CSI driver.

Prerequisites

  • Ensure you have installed the velero-cli.

1. Create a backup

velero backup create demo-backup --include-namespace tenant-demo

2. Verify the backup has been created successfully without errors

velero backup describe demo-backup

3. (optional) verify backup folder in your Object Storage

In case you're running this on a local Kind cluster, set-up a port-forward to Minio and check the Velero bucket in Minio's UI.

kubectl -n minio-generic-tenant port-forward svc/minio-generic-tenant-console 9090:9090

# Browse to http://localhost:9090 and login with `minio/minio123`. You should see a `velero` bucket with data in it.

4. Simulate a disaster by destroying the tenant-demo namespace

kubectl delete namespace tenant-demo

# Wait for the namespace to be deleted

5. Restore tenant-demo's lost resources

velero restore create --from-backup demo-backup