GCP Native GKE Backup Solution

Bhavishya Gupta
Google Cloud - Community
4 min readNov 29, 2022

Backup of GKE

GCP Native Backup Solution

Introduction

Backups for Kubernetes Cluster is always a hot topic to ensure a high availability and fault tolerance solution. While there are few third party software solutions present in market, a fully native solution is always a ask for enterprise customers who are looking to leverage on Cloud’s maturity.

Hence GCP has come up with a Backup for GKE feature which provides backups for GKE clusters . It integrates with GKE UI, gcloud CLI.

What is Backed up?

Backup for GKE captures

  1. Config Backup: Set of K’8 resource descriptions for the GKE Cluster (Apps). It Stores stateful data separately and also stores custom scripts for cluster data.
  2. Volume Backup: All the Persistent Volume Claims which have been created.

You can schedule the backup and restore from backup as and when required. More details can be found HERE.

Key Features of Backup for GKE:

  1. Google Cloud Native Solution: Fully Integrated with GKE Console.
  2. Fine Grained Control: Choose a specific application, namespace, or an entire cluster to backup or restore
  3. Operate with Flexibility: Backup of clone workloads in one region and restore to another region.
  4. Policy Management: Set backup schedules and data retention policies.

What’s not backed up?

  1. GKE Cluster Configuration such as node pools, enabled features, node configuration.
  2. Container images referenced by a backup.
  3. Configuration information or state of services outside of cluster, such Cloud sql or External Load balancers.

How to configure backup plan?

You need to have Workload identity enabled , to enable backup on GKE. I have a existing cluster here, for which i’ll enable backups.

  1. Enable Workload Identity on the GKE Cluster & Node Pools should also have a meta data server configured.

2. Scroll to Backup for GKE Service, and enable backup for GKE service.

3. Create a backup plan by clicking on “Create a Backup Plan”.

4. You can select the namespace or entire cluster, Persistent volume and the keys to encrypt backup.

5. You can specify the backup schedule using cron expression, and then select the number of days to retain the backup. Option to lock the backup from accidental deletion & audits. Finally review and create.

6. Once Backup plan is created, it will be listed under the Cluster name. You can start on demand backup (if needed).

How to configure restore plan?

  1. Similarly we can create a restore plan.

2. Select the namespace to be restored. We have 2 options to resolve conflict, either fail on conflict or rollback. Option to restore persistent volumes can be selected accordingly.

3. Exclude other options as they are optional. Click on create restore plan.

Finally the restore plan is created. You can use it to restore from any backup version available. In out case we don’t have any backup yet.

All the above configurations can be done via gcloud commands as well. That’s it for this blog. Happy Learning.

--

--