Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Kubernetes a été conçu pour être extensible. Vous pouvez ajouter de nouvelles API, telles que les API Backup et GKE Backup Agent, à un cluster Kubernetes.
Ces API sont conformes à un modèle d'API uniforme, le modèle de ressources Kubernetes (KRM).
Ces API utilisent des ressources personnalisées Kubernetes et s'appuient sur le KRM.
Les API permettent de gérer le cycle de vie des sauvegardes, et de créer des dépôts, des règles et des plans de sauvegarde.
Points de terminaison d'un service
L'URL suivante est le point de terminaison de l'API Backup KRM :
Remplacez MANAGEMENT_API_SERVER_ENDPOINT par le point de terminaison du serveur de l'API Management.
Document de découverte
Utilisez la commande kubectl proxy --port=8001 pour ouvrir un proxy vers le serveur d'API sur votre ordinateur local. Vous pouvez ensuite accéder au document de découverte à l'une des URL suivantes :
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/04 (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/04 (UTC)."],[[["\u003cp\u003eKubernetes' extensibility allows for the addition of new APIs, such as the Backup and GKE Backup Agent APIs, which adhere to the Kubernetes Resource Model (KRM).\u003c/p\u003e\n"],["\u003cp\u003eThese APIs, namely the Backup KRM API and the GKE Backup Agent API, manage the lifecycle of backups and the creation of backup repositories, policies, and plans within a Kubernetes cluster.\u003c/p\u003e\n"],["\u003cp\u003eThe Backup KRM API endpoint is \u003ccode\u003ehttps://<MANAGEMENT_API_SERVER_ENDPOINT>/apis/backup.gdc.goog/v1\u003c/code\u003e, and the GKE Backup Agent API endpoint is \u003ccode\u003ehttps://<MANAGEMENT_API_SERVER_ENDPOINT>/apis/gkebackup.gke.io/v1\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eDiscovery documents for these APIs can be accessed locally via a proxy using the \u003ccode\u003ekubectl proxy --port=8001\u003c/code\u003e command at \u003ccode\u003ehttp://127.0.0.1:8001/apis/backup.gdc.goog/v1\u003c/code\u003e and \u003ccode\u003ehttp://127.0.0.1:8001/apis/gkebackup.gke.io/v1\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe documents offer examples of resources that can be created using the APIs, such as \u003ccode\u003eClusterBackupPlan\u003c/code\u003e, \u003ccode\u003eProtectedApplication\u003c/code\u003e, and \u003ccode\u003eClusterBackupRepository\u003c/code\u003e resources, each outlining specific configurations.\u003c/p\u003e\n"]]],[],null,["# Backup API overview\n\nKubernetes was designed for extensibility. You can add new APIs such as the Backup and GKE Backup Agent APIs to a Kubernetes cluster.\nThese APIs conform to a uniform API model, the Kubernetes Resource Model (KRM).\n\nThese APIs use Kubernetes custom resources and rely on the KRM.\nThe APIs are used to manage the lifecycle of backups, and to create backup repositories, policies, and plans.\n\nService endpoints\n-----------------\n\nThe following URL is the API endpoint for the Backup KRM API: \n\n https://\u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e/apis/backup.gdc.goog/v1\n\nThe following URL is the API endpoint for the GKE Backup Agent API: \n\n https://\u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e/apis/gkebackup.gke.io/v1\n\nReplace \u003cvar translate=\"no\"\u003eMANAGEMENT_API_SERVER_ENDPOINT\u003c/var\u003e with the endpoint of the\nManagement API server.\n\nDiscovery document\n------------------\n\nUse the `kubectl proxy --port=8001` command to open a proxy to the API server on\nyour local machine. From there, you can access the discovery document at one of\nthe following URLs:\n\n- `http://127.0.0.1:8001/apis/backup.gdc.goog/v1`\n- `http://127.0.0.1:8001/apis/gkebackup.gke.io/v1`\n\nExample `ClusterBackupPlan` resource\n------------------------------------\n\nHere is an example of a `ClusterBackupPlan` resource: \n\n apiVersion: backup.gdc.goog/v1\n kind: ClusterBackupPlan\n metadata:\n name: backup-plan\n namespace: project-namespace\n spec:\n targetCluster:\n targetClusterType: UserCluster\n targetClusterName:\n kind: \"Cluster\"\n name: \"cluster-sample\"\n backupSchedule:\n cronSchedule: \"*/30 * * * *\"\n paused: false\n clusterBackupConfig:\n backupScope:\n selectedNamespaces:\n namespaces: [\"nginx\"]\n clusterBackupRepositoryName: backup-repository\n retentionPolicy:\n backupDeleteLockDays: 10\n backupRetainDays: 10\n\nExample `ProtectedApplication` resource\n---------------------------------------\n\nHere is an example of a `ProtectedApplication` resource: \n\n apiVersion: gkebackup.gke.io/v1\n kind: ProtectedApplication\n metadata:\n name: protected-application-test\n namespace: applications\n spec:\n applicationName: protectedApplication\n resourceSelection:\n type: Selector\n selector:\n matchLabels:\n app: protected\n components:\n - name: protect-application-deployment\n resourceKind: Deployment\n resourceNames:\n - protected-application-deployment\n strategy:\n type: BackupAllRestoreAll\n\nExample `ClusterBackupRepository` resource\n------------------------------------------\n\nHere is an example of a `ClusterBackupRepository` resource: \n\n apiVersion: backup.gdc.goog/v1\n kind: ClusterBackupRepository\n metadata:\n name: user-1-user\n namespace: user-1-user-cluster\n spec:\n secretReference:\n namespace: \"object-storage-secret-ns\"\n name: \"object-storage-secret\"\n endpoint: \"https://objectstorage.google.gdch.test\"\n type: \"S3\"\n s3Options:\n bucket: \"fully-qualified-bucket-name\"\n region: \"us-east-1\"\n forcePathStyle: true\n importPolicy: \"ReadWrite\""]]