Wenn Sie die Google Cloud CLI für diese Aufgabe verwenden möchten, müssen Sie die gcloud CLI installieren und dann initialisieren. Wenn Sie die gcloud CLI bereits installiert haben, rufen Sie die neueste Version mit gcloud components update ab.
Backup for GKE API aktivieren
Der Sicherung für GKE-Dienst wird in allen Projekten automatisch aktiviert, in denen die GKE API aktiviert ist. Dadurch können Sie den Datenschutzstatus Ihrer GKE-Cluster verbessern, indem Sie den Sicherung für GKE-Dienst verwenden.
Das Aktivieren der Backup for GKE API allein wirkt sich nicht auf vorhandene GKE-Clusterkonfigurationen aus und nicht auf die laufenden Arbeitslasten. Außerdem werden nicht automatisch Sicherungen erstellt und es fallen keine zusätzlichen Kosten an. Kosten fallen nur an, wenn Sie Sicherungen mit dem Backup for GKE-Dienst erstellen und speichern.
Wenn Sie den Dienst "Sicherung für GKE" manuell deaktiviert haben, können Sie den Dienst "Sicherung für GKE" mit dem Google Cloud CLI, der Google Cloud Console oder Terraform aktivieren.
gcloud
Führen Sie den folgenden Befehl aus, um den Backup for GKE-Dienst zu aktivieren:
gcloudservicesenablegkebackup.googleapis.com
Console
Aktivieren Sie in der Google Cloud Console die Backup for GKE API:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2024-11-21 (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)."]]