Si vous souhaitez utiliser Google Cloud CLI pour cette tâche, installez puis initialisez gcloud CLI. Si vous avez déjà installé gcloud CLI, assurez-vous de disposer de la dernière version en exécutant la commande gcloud components update.
Activer l'API Sauvegarde pour GKE
Le service Sauvegarde pour GKE est automatiquement activé dans tout projet où l'API GKE est activée. Cela vous permet d'améliorer la protection des données de vos clusters GKE en utilisant le service Sauvegarde pour GKE.
L'activation de l'API Sauvegarde pour GKE seule ne modifie aucune configuration de cluster GKE existante et n'affecte pas les charges de travail en cours d'exécution. De plus, il ne crée pas automatiquement de sauvegardes et n'entraîne pas de coûts supplémentaires. Les coûts ne sont encourus que lorsque vous créez et stockez des sauvegardes à l'aide du service Sauvegarde pour GKE.
Si vous avez désactivé manuellement le service Sauvegarde pour GKE, vous pouvez l'activer à l'aide de Google Cloud CLI, de la console Google Cloud ou de Terraform.
gcloud
Pour activer le service Sauvegarde pour GKE, exécutez la commande suivante :
gcloudservicesenablegkebackup.googleapis.com
Console
Dans la console Google Cloud , activez l'API Sauvegarde pour GKE :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/01 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/01 (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)."]]