Si deseas usar Google Cloud CLI para esta tarea, instala y, luego, inicializa gcloud CLI. Si ya instalaste gcloud CLI, ejecuta gcloud components update para obtener la versión más reciente.
Habilita la API de Backup for GKE
El servicio de Copia de seguridad para GKE se habilita de forma automática en cualquier proyecto en el que esté habilitada la API de GKE. Esto te permite mejorar la postura de protección de datos de tus clústeres de GKE mediante el uso del servicio de Copia de seguridad para GKE.
Habilitar la API de Backup for GKE por sí sola no modifica ninguna configuración del clúster de GKE existente ni afecta las cargas de trabajo en ejecución. Además, no crea copias de seguridad de forma automática ni genera costos adicionales. Los costos solo se generan cuando creas y almacenas copias de seguridad con el servicio de Copia de seguridad para GKE.
Si inhabilitaste de forma manual el servicio de Copia de seguridad para GKE, puedes habilitarlo mediante Google Cloud CLI, la consola de Google Cloud o Terraform.
gcloud
A fin de habilitar el servicio de copia de seguridad para GKE, ejecuta el siguiente comando:
gcloudservicesenablegkebackup.googleapis.com
Console
En la consola de Google Cloud, habilita la API de Backup for GKE:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2024-11-22 (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)."]]