If you want to use the Google Cloud CLI for this task,
install and then
initialize the
gcloud CLI. If you previously installed the gcloud CLI, get the latest
version by running gcloud components update.
Enable the Backup for GKE API
The Backup for GKE service is automatically enabled in any project where the
GKE API is enabled. This lets you to improve the data protection
posture of your GKE clusters by making use of the
Backup for GKE service.
Enabling the Backup for GKE API alone doesn't modify any existing GKE
cluster configurations or affect the running workloads. Also, it doesn't
automatically create backups or incur additional costs. Costs are only incurred
when you create and store backups using the Backup for GKE service.
If you manually disabled the Backup for GKE
service, you can enable the Backup for GKE service by using the
Google Cloud CLI, Google Cloud console, or Terraform.
gcloud
To enable the Backup for GKE service, run the following command:
gcloudservicesenablegkebackup.googleapis.com
Console
In the Google Cloud console, enable the Backup for GKE API:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-29 UTC."],[],[],null,["# Enable Backup for GKE API\n\nAutopilot Standard\n\n*** ** * ** ***\n\nThis page describes how to enable\n[Backup for GKE](/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke).\n\nBefore you begin\n----------------\n\nBefore you start, make sure that you have performed the following tasks:\n\n- Enable the Google Kubernetes Engine API.\n[Enable Google Kubernetes Engine API](https://console.cloud.google.com/flows/enableapi?apiid=container.googleapis.com)\n- If you want to use the Google Cloud CLI for this task, [install](/sdk/docs/install) and then [initialize](/sdk/docs/initializing) the gcloud CLI. If you previously installed the gcloud CLI, get the latest version by running `gcloud components update`. **Note:** For existing gcloud CLI installations, make sure to set the `compute/region` [property](/sdk/docs/properties#setting_properties). If you use primarily zonal clusters, set the `compute/zone` instead. By setting a default location, you can avoid errors in the gcloud CLI like the following: `One of [--zone, --region] must be supplied: Please specify location`. You might need to specify the location in certain commands if the location of your cluster differs from the default that you set.\n\nEnable the Backup for GKE API\n-----------------------------\n\nThe Backup for GKE service is automatically enabled in any project where the\nGKE API is enabled. This lets you to improve the data protection\nposture of your GKE clusters by making use of the\nBackup for GKE service.\n\nEnabling the Backup for GKE API alone doesn't modify any existing GKE\ncluster configurations or affect the running workloads. Also, it doesn't\nautomatically create backups or incur additional costs. Costs are only incurred\nwhen you create and store backups using the Backup for GKE service.\n\nIf you manually disabled the Backup for GKE\nservice, you can enable the Backup for GKE service by using the\nGoogle Cloud CLI, Google Cloud console, or Terraform. \n\n### gcloud\n\nTo enable the Backup for GKE service, run the following command: \n\n gcloud services enable gkebackup.googleapis.com\n\n### Console\n\nIn the Google Cloud console, enable the Backup for GKE API:\n\n[Enable the API](https://console.cloud.google.com/apis/library/gkebackup.googleapis.com)\n\n### Terraform\n\nCreate an appropriate `\"google_project_service\"` resource to\nenable the `gkebackup.googleapis.com` service: \n\n resource \"google_project_service\" \"my_service\" {\n project = \"my_project\"\n service = \"gkebackup.googleapis.com\"\n }\n\nFor more information, see [google_project_service](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_service).\n\nWhat's next\n-----------\n\n- Learn more about [defining custom backups](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/protected-application).\n- Learn more about [planning a set of backups](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/backup-plan)."]]