Velero Demo – Perform Backup and Restore

In this article, we will perform a backup of the TKGi cluster with Velero and then delete a namespace. We will then use the backup to restore the cluster to its original state.

Below screenshot is a recap of what’s deployed in the cluster.

Below screenshot confirms that the S3 bucket (velero-test) is empty.

We will now perform two sets of backup. One that includes the entire cluster and one with just the sara-test-2 namespace and nothing else.

Cluster Backup

Execute the following command to perform a cluster backup and monitor the bucket for artifacts.

velero backup create cluster-backup-1

Namespace Backup

Execute the following command to perform a namespace backup and monitor the bucket for artifacts.

velero backup create sara-test-2-namespace-backup --include-namespaces=sara-test-2

We will now proceed to delete both the namespaces (which will recursively delete all objects within the namespace).

We will now perform a restore from “sara-test-2-namespace-backup” using the following command.

velero restore create --from-backup sara-test-2-namespace-backup

If you look at the dates, the deletion happened at 9:20 PST and restoration happened at 9:22 PST on 21st December.

The Result? Only Namespace sara-test-2 would have got restored, since we used the namespace backup for restoration. Below is a screenshot to confirm that.

We will again delete the sara-test-2 namespace and perform the restore from the cluster backup using the following command.

velero restore create --from-backup cluster-backup-1

Now, we should see both the namespaces restored and the pods and services all back.

That’s it. You can do a lot more with Velero backups. This demo is just to give you an idea or overview of what Velero is capable of.

Happy Learning!

Please follow and like my content:

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Enjoy this blog? Please spread the word :)