kubernetes backup best practices-and solutions

by Josh Biggs in Software on 3rd December 2020

Traditional data backup solutions designed for monolithic applications are unable to provide the granularity and scalability required to backup and restore Kubernetes based apps.

For modern container-based architecture – solutions should work well for distributed environments and provide features such as advanced disaster recovery, multi zonal migration, and support for various backup environments.

Since each enterprise is different, the underlying infrastructure to manage backups across various clusters can be complex and dependent on various factors. So it is impossible to implement a singular approach that can provide resilient backups across different environments.

However, when backing up your Kubernetes environment using a solution, you can implement the following best practices for secure backup of your Kubernetes apps.

Understand Data Backup Requirements

An organization must determine its Kubernetes backup requirements before backing up the data using a particular solution.

Suppose the Kubernetes environment is set up in the multi-hybrid cloud. In that case, A backup solution should provide support for multiple distributions and offer capabilities that allow seamless recovery of workloads and applications across all environments in case of a data loss and outage.

Similarly, if the environment is set up on-premises and has multiple clusters, a backup solution should provide cross-cluster restoration capabilities.

Also, many backup solutions can consume excess storage when they backup whole volumes. This can easily hog up resources and increases expenses if the organization is set up on the cloud. Choosing a backup solution that provides a subsetted backup of volumes helps in this context.

Secure Backups from vulnerabilities

Depending upon the scale of business and requirements of the organization. Backup and recovery of various Kubernetes components can grow rapidly raising concerns on monitoring and securing these large amounts of backups from threats and vulnerabilities.

Implementing a backup solution that provides operations teams the flexibility to search through backups while figuring out the desired recovery state is best in these situations.

Recovery states are connected to snapshots which should be scanned thoroughly before restoring to eradicate malware.

Recovery time should also be minimized as a longer recovery window may provide more attack surface to introduce additional risks and vulnerabilities in the environment.

Backup teams must implement encryption at rest and in transit recovery data to ensure the security of data. Granular control at data components will provide per component backup capabilities making restoration fast while reducing vulnerabilities.

Implement a Disaster Recovery(DR) Strategy

It is always considered a best practice to implement a robust disaster recovery and backup system that allows proper restoration of Kubernetes components to a previously working state in case of a complete failure or data loss.

A proper disaster recovery (DR) strategy must consider the different Kubernetes objects, configuration, data which makes the entire Kubernetes application and recover them as a single entity while minimizing data loss and downtime.

Data loss and downtime data are calculated through RPO(Recovery point time) and RTO(recovery time objective), which describes how downtime has impacted the organization’s business operations. (RPO) measures how frequently an organization can take backups while (RTO) determines the downtime a business can tolerate.

Depending upon the cost and business requirements, organizations can opt for Zero RPO backup solutions to incur zero data loss. There are also 5-10 minute RPO solutions for budget-conscious businesses that can tolerate a little bit of downtime.

The Disaster Recovery (DR) system should also understand how the application is configured at the retrieval site for recovery. Improper configuration of labels and replicas can lead to disjointed recovery increasing recovery window and errors.

Make use of Kubernetes native Backup Solution.

Traditional backup solutions do not take the semantics of Kubernetes application into account and back them up as individual resources, whereas Kubernetes components comprise a central key database known as etcd, which includes cluster configuration and persistent volumes states.

Any changes made to the Kubernetes environment directly gets reflected in the etcd. So, It is always considered a best practice to implement a backup solution that can take the robust backup of the entire etcd and have the ability to automatically discover all the Kubernetes components.

Kubernetes components such as secrets, config maps, and CRD’s are made to work together as an entire Kubernetes application, and backing up these components as a single unit is essential for optimal recovery later on.

Comparing Kubernetes Backup Solutions

Now that we have understood the best practices for backing up the Kubernetes Environment, Let’s take a look at some of the popular Kubernetes backup solutions and how they implement these best practices.

PX-Backup

PX-Backup by Portworx is an enterprise-grade data management solution for Kubernetes, providing a backup of Kubernetes components at pods and namespace levels. With Portworx, organizations can benefit from 1-click on-demand backups, granular backup control, and support for multi-cloud migrations to Amazon, Microsoft, and Google Cloud.

Portworx also supports zero RPO Disaster Recovery initiatives in case admins have to restore the backup from databases spanned across various regions.

Overall, Portworx provides enough features to support complex backup workflows for enterprises and small businesses irrespective of whether they are deployed on-premises or on hybrid cloud.

Kasten K10

Kasten K10 data management platform is purposely built for enterprises who require easy-to-use backup and disaster recovery systems for their Kubernetes applications. K10 makes use of underlying data storage systems such as EBS or RBD, which supports all the major Kubernetes distributions.

Kasten GUI based dashboard simplifies the integration of various backup services such as Cassandra, PostgreSQL, and AWS RDS. RBAC and backup encryption is provided out of the box for tighter access control

Coming to disaster recovery RPO, Kasten does not provide a zero RPO solution, but its storage for backups is supported by various vendors and providers for seamless integration.

Velero

Velero is an open-source Kubernetes data backup tool that enables admins to safely perform scheduled backups on Kubernetes cluster resources and volumes.

Velero supports pluggable architecture for backup of persistent volume snapshots, which is usually supported by Restic. With Restic and Velero, admins can perform disaster recovery and asynchronous backup for individual labels.

Velero does not guarantee Zero RPO, although its hooks feature provides admins with the ability to perform custom batch commands before/after backups, which helps users select volumes for backup without having to freeze that volume.

Categories: Software