Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come creare un ripristino granulare per un backup in Google Distributed Cloud (GDC) air-gapped.
La funzionalità di ripristino granulare consente di ripristinare un sottoinsieme di risorse da un backup. Questa funzionalità offre la flessibilità
per perfezionare l'ambito di ripristino definito nel piano di ripristino.
Prima di iniziare
Per creare un ripristino granulare per un backup, devi disporre di:
Amministratore backup cluster utente: gestisce le risorse di backup come i piani di backup e ripristino nei cluster utente. Chiedi all'amministratore IAM dell'organizzazione di concederti
il ruolo Amministratore backup cluster utente (user-cluster-backup-admin).
Per gli utenti di AO:
Backup Creator: crea backup manuali ed esegue ripristini. Chiedi all'amministratore IAM del progetto di concederti il ruolo Autore backup (backup-creator).
RESTORE_NAME: il nome del ripristino che vuoi creare.
PROJECT_NAMESPACE: il nome del tuo progetto GDC.
RESTORE_PLAN: il nome del piano di ripristino da cui deriva questo ripristino.
BACKUP_NAME: il backup da ripristinare. Questo backup deve essere associato al
piano di backup a cui fa riferimento il piano di ripristino. Per saperne di più, vedi Pianificare un insieme di ripristini.
Gli esempi seguenti sono forniti nel formato YAML utilizzato da Google Cloud CLI.
Ripristina una singola risorsa con ambito di spazio dei nomi
Questo esempio ripristina una risorsa ConfigMap con il nome nginx-vars nello spazio dei nomi webserver, utilizzando il ripristino granulare inclusionFilters per selezionare la risorsa. Se vuoi scegliere risorse nel gruppo principale, utilizza una stringa vuota per il campo group.
Questo esempio ripristina tutte le risorse disponibili tranne una groupKind
con il nome sc1, utilizzando il ripristino granulare
exclusionFilters per escludere la risorsa.
Questo esempio ripristina le risorse che hanno entrambe le etichette key1:value1 e
key2:value2, utilizzando il ripristino granulare inclusionFilters per selezionare le
risorse.
Questo esempio ripristina tutte le risorse disponibili, ad eccezione delle risorse groupKind di ConfigMap
e storage.k8s.io/StorageClass, utilizzando il ripristino granulare exclusionFilters
per escludere questi due GroupKind.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis guide outlines the process of creating a fine-grained restore for a backup in Google Distributed Cloud (GDC) air-gapped environments, allowing for the restoration of specific subsets of resources.\u003c/p\u003e\n"],["\u003cp\u003eFine-grained restores require an existing backup and the appropriate identity and access management (IAM) roles, such as User Cluster Backup Admin or Backup Creator, depending on the user type.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves creating fine-grained restore filters using YAML, specifying resources to be included or excluded based on group, kind, name, namespace, or labels.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eManualRestoreRequest\u003c/code\u003e custom resource must be created, defining the \u003ccode\u003erestoreName\u003c/code\u003e, \u003ccode\u003ePROJECT_NAMESPACE\u003c/code\u003e, \u003ccode\u003erestorePlanName\u003c/code\u003e, \u003ccode\u003ebackupName\u003c/code\u003e, and the fine-grained restore filters.\u003c/p\u003e\n"],["\u003cp\u003eThe guide offers examples of fine-grained restore filters in YAML format, demonstrating how to restore resources based on various criteria like namespace, group, name, or label.\u003c/p\u003e\n"]]],[],null,["# Create a fine-grained restore\n\nThis page describes how to create a fine-grained restore for a backup in Google Distributed Cloud (GDC) air-gapped.\n\nThe fine-grained restore feature lets you restore a subset of resources from a\nbackup. This feature provides the flexibility\nto refine the restore scope defined in the restore plan.\n\nBefore you begin\n----------------\n\nTo create a fine-grained restore for a backup, you must have the following:\n\n- An existing backup. For more information, see [Plan a set of backups](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/cluster-backup/plan-backups).\n- The necessary identity and access role:\n\n - For PA users:\n - User Cluster Backup Admin: manages backup resources such as backup and restore plans in user clusters. Ask your Organization IAM Admin to grant you the User Cluster Backup Admin (`user-cluster-backup-admin`) role.\n - For AO users:\n - Backup Creator: creates manual backups and restores. Ask your Project IAM Admin to grant you the Backup Creator (`backup-creator`) role.\n - For more information, see [Role definitions](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/iam/role-definitions).\n\nCreate a fine-grained restore\n-----------------------------\n\nTo create a restore with a fine-grained filter, follow these steps:\n\n1. Create the fine-grained restore filters. You can use the following YAML\n example.\n\n inclusionFilters:\n - groupKind:\n group: foo.io\n kind: Bar\n name: name1\n namespace: ns1\n exclusionFilters:\n - labels:\n key1: value1\n key2: value2\n\n2. Create a `ManualRestoreRequest` custom resource to plan restores from\n an existing `Backups`. Here's an example of a `ManualRestoreRequest`:\n\n apiVersion: backup.gdc.goog/v1\n kind: ManualRestoreRequest\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORE_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePROJECT_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n spec:\n restoreName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORE_NAME\u003c/span\u003e\u003c/var\u003e\n restorePlanName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eRESTORE_PLAN\u003c/span\u003e\u003c/var\u003e\n backupName: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eBACKUP_NAME\u003c/span\u003e\u003c/var\u003e\n filter:\n \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFINE_GRAINED_RESTORE_FILTERS\u003c/span\u003e\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRESTORE_NAME\u003c/var\u003e: the name of the restore that you want to create.\n- \u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e: the name of your GDC project.\n- \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e: the name of the restore plan this restore is derived from.\n- \u003cvar translate=\"no\"\u003eBACKUP_NAME\u003c/var\u003e: the backup to restore. This backup must be associated with the backup plan to which the restore plan refers to. For more information, see [Plan a set of restores](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/cluster-backup/plan-restores#create-restore-plan).\n- \u003cvar translate=\"no\"\u003eFINE_GRAINED_RESTORE_FILTER\u003c/var\u003e: the fine-grained restore filters. For examples, see [Fine-grained restore filter\n examples](#fine-grained-restore-filter-examples).\n\nFine-grained restore filter examples\n------------------------------------\n\nThe following examples are provided in the YAML format used by Google Cloud CLI.\n\n### Restore a single namespace scoped resource\n\nThis example restores a `ConfigMap` resource with the name `nginx-vars` in the\nnamespace `webserver`, using the fine-grained restore `inclusionFilters` to select\nthe resource. If you want to choose resources under the core group, use an empty\nstring for the `group` field. \n\n filter:\n inclusionFilters:\n - groupKind:\n kind: ConfigMap\n name: nginx-vars\n namespace: webserver\n\n### Exclude a single cluster scoped resource\n\nThis example restores all available resources except for one `groupKind`\nresource with the name `sc1`, using the fine-grained restore\n`exclusionFilters` to exclude the resource. \n\n filter:\n exclusionFilters:\n - groupKind:\n group: storage.k8s.io\n kind: StorageClass\n name: sc1\n\n### Restore resources with two labels\n\nThis example restores resources which have both labels `key1:value1` and\n`key2:value2`, using the fine-grained restore `inclusionFilters` to select the\nresources. \n\n filter:\n inclusionFilters:\n - labels:\n key1: value1\n key2: value2\n\n### Exclude all resources of some GroupKinds\n\nThis example restores all available resources except for the `groupKind` resources of `ConfigMap`\nand `storage.k8s.io/StorageClass`, using the fine-grained restore `exclusionFilters`\nto exclude these two GroupKinds. \n\n filter:\n exclusionFilters:\n - groupKind:\n kind: ConfigMap\n - groupKind:\n group: storage.k8s.io\n kind: StorageClass\n\nWhat's next\n-----------\n\n- [View and delete a restore](/distributed-cloud/hosted/docs/latest/gdch/platform-application/pa-ao-operations/cluster-backup/view-and-delete-restore)"]]