Kubernetes Disaster Recovery using Velero and Nirmata
Kubernetes is increasingly used by enterprises for mission critical applications. For such production applications, it is essential to regularly backup all the necessary data and configurations so that you can quickly recover from any unexpected disasters.
Applications deployed in Kubernetes can be fairly complex and are typically composed of several resources such as – Deployments, Statefulsets, ConfigMaps, Secrets, volumes etc. All of these resources need to be saved so that the application can be completely restored when needed.
Velero (previously known as ARK) is an open source tool that helps automate backup and restore of Kubernetes clusters, including any application and its data. The project was originally started by Heptio, which was acquired by VMware. Since its launch, Velero, has become the de-facto number tool for Kubernetes backup and recovery. Velero is also an incubator project in CNCF and has a vibrant community. To learn more about features and use cases supported by Velero, check out the latest release documentation.
Velero enables the following use cases:
- Disaster recovery – backup of cluster and restore in case of a disaster
- Application migration – migrate application along with its data from one cluster to another
- Application cloning – replicating production environments for testing and debugging
Also, Velero is fully integrated into the Nirmata Kubernetes management plane and available as add-on for every cluster in Nirmata, so that backups can be easily scheduled, and applications can be quickly recovered when needed. In this post, I will discuss how to use Velero with Nirmata.
Deploying the Velero add-on
There are a few different ways to deploy Velero to your cluster. For new clusters, you can configure the Velero add-on to be part of your Cluster Policy. This policy will ensure Velero is deployed each time a new cluster is created.
Velero can also be deployed after the cluster is created by selecting the Velero add-on from the Cluster-> Add-ons panel.
If the cluster is deployed on a public cloud (AWS, Azure, GCP), or if the cluster is created using a cloud managed Kubernetes service (EKS, AKS, GKE), you will need to provide cloud credentials when deploying Velero.
Once the add-on is deployed, you should see Velero in the Add-ons tab on your cluster.
Once Velero is deployed, you need to configure the backup location where all the cluster configuration will be stored. This is typically an S3 compatible storage service. After the schedule has been saved, you will start seeing backups listed in the Backup & Restore table.
Restoring from Backups
Now, to restore any backup, click on the restore button next to the backup in the Backup and Restore table.
You should see a confirmation dialog. Click on the Restore button to proceed with the restore.
In case you want to migrate your application from one cluster to another, you can follow the above steps to backup and restore the application across clusters. Once the application backup is successful, you need to install Velero on the target cluster and configure it to use the same Backup Storage Location. Once you do this, all the backups will be available on your target cluster and now you can proceed with restoring the application you want to migrate. The same approach can be used to clone an application to a different cluster.
Velero provides backup and restore for your Kubernetes applications. It is now fully integrated into Nirmata so that the process of backup and recovery is extremely simple. With a few clicks you can restore, clone or migrate any application.
Nirmata provides integrated Disaster Recovery capability for your clusters with Velero and you can manage your backups for your clusters deployed in any cloud from a single pane of glass. Cluster DR is one of the many cluster and application lifecycle management features Nirmata provides for your Kubernetes deployments. To learn more, [click here].
Try out Velero for free at try.nirmata.io, and do send us your feedback.
If you are interested in participating in the Velero community, check out the community page.