[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-16。"],[],[],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)."]]