Stay organized with collections
Save and categorize content based on your preferences.
Autopilot
Standard
This page describes how to configure conflict handling strategies for
namespaced and cluster-scoped resources in a restore plan.
When restoring to a cluster, you might encounter resource conflicts in the following scenarios:
Restoring to an existing cluster that already has resources provisioned.
When a Kubernetes resource is managed by tools, such as GitOps or an operator.
Backup for GKE provides various options to define conflict handling for
cluster-scoped and namespaced resources that you can specify in a restore plan.
Restore conflict handling for cluster-scoped resources
You can configure the following options in the restore plan to handle conflicts
for a cluster-scoped resources:
Keep resources in target cluster (non-destructive): if a resource with
the same name exists in the target cluster, leave it as it is.
Replace resources in target cluster (destructive): if a resource already
exists in the target cluster, delete it and restore the copy from the backup.
gcloud
Update an existing restore plan to handle conflict for a cluster-scoped resource:
RESTORE_PLAN: the name of the restore plan that you want to update.
PROJECT_ID: the ID of your Google Cloud project.
LOCATION: the compute region for the resource, for example us-central1.
CLUSTER_RESOURCE_CONFLICT_POLICY: defines how to handle restore-time conflicts for selected cluster resources. Use one of the following options:
use-existing-version: if the resources that are being restored already exist in the target cluster, Backup for GKE keeps the existing resources.
use-backup-version: if the resources that are being restored already exist in the target cluster, Backup for GKE replaces the existing resources with the new resources from the backup.
Console
Use the following instructions to update cluster-scoped resources conflict policy in the Google Cloud console:
In the Google Cloud console, go to the Google Kubernetes Engine page.
In the Restore configurations section, go to the Cluster-scoped resources section and click Edit.
In the Define conflict handling section, select a conflict handling option.
Click Save changes.
Restore conflict handling for namespaced resources
In the restore plan, you can configure the following options to manage conflict
for a namespaced resource. You can specify conflict handling for namespaced
resources at the following levels:
Individual resource
Namespace and ProtectedApplication
The following are the available options to handle conflicts for the individual resources:
Merge skip (non-destructive): if a specific resource already exists,
skip restoring the resource from the backup.
Merge replace volume (destructive): if a specific resource already exists,
skip restoring that resource but replace the underlying persistent volume
using the volume data restore policy. The merge replace volume achieves
the data-only restore.
Merge replace (destructive): if a specific resource already exists,
replace that resource with the one from backup and the associated volume
data by following the volume data restore policy.
The following are the available options to handle conflicts of all resources
belonging to a Namespace and ProtectedApplication:
Fail on conflict (non-destructive): if namespace or
ProtectedApplication targeted for restore from a backup that already
exists in the target cluster, the restore fails.
Rollback (destructive): when the target cluster contains the namespace
or ProtectedApplication that are targeted for restore to the cluster,
the existing group of resources is deleted before the new resources are restored.
gcloud
Update an existing restore plan to handle conflict for a namespaced resource:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Handle resource conflicts during restore\n\nAutopilot Standard\n\n*** ** * ** ***\n\nThis page describes how to configure conflict handling strategies for\nnamespaced and cluster-scoped resources in a restore plan.\n\nWhen restoring to a cluster, you might encounter resource conflicts in the following scenarios:\n\n- Restoring to an existing cluster that already has resources provisioned.\n- When a Kubernetes resource is managed by tools, such as GitOps or an [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).\n\nBackup for GKE provides various options to define conflict handling for\ncluster-scoped and namespaced resources that you can specify in a [restore plan](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/restore-plan#create_a_restore_plan).\n\nRestore conflict handling for cluster-scoped resources\n------------------------------------------------------\n\nYou can configure the following options in the restore plan to handle conflicts\nfor a cluster-scoped resources:\n\n- **Keep resources in target cluster (non-destructive)**: if a resource with the same name exists in the target cluster, leave it as it is.\n- **Replace resources in target cluster (destructive)**: if a resource already\n exists in the target cluster, delete it and restore the copy from the backup.\n\n | **Warning:** This option could cause unintentional data loss if used inappropriately. For example, deleting a `CustomResourceDefinition` will cause Kubernetes to delete all custom `CustomResource` of that type.\n\n### gcloud\n\nUpdate an existing restore plan to handle conflict for a cluster-scoped resource: \n\n gcloud beta container backup-restore restore-plans update \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --cluster-resource-conflict-policy=\u003cvar translate=\"no\"\u003eCLUSTER_RESOURCE_CONFLICT_POLICY\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e: the name of the restore plan that you want to update.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [compute region](/compute/docs/regions-zones#available) for the resource, for example `us-central1`.\n- \u003cvar translate=\"no\"\u003eCLUSTER_RESOURCE_CONFLICT_POLICY\u003c/var\u003e: defines how to handle restore-time conflicts for selected cluster resources. Use one of the following options:\n\n - \u003cvar translate=\"no\"\u003euse-existing-version\u003c/var\u003e: if the resources that are being restored already exist in the target cluster, Backup for GKE keeps the existing resources.\n - \u003cvar translate=\"no\"\u003euse-backup-version\u003c/var\u003e: if the resources that are being restored already exist in the target cluster, Backup for GKE replaces the existing resources with the new resources from the backup.\n\n### Console\n\nUse the following instructions to update cluster-scoped resources conflict policy in the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Google Kubernetes Engine** page.\n\n [Go to Google Kubernetes Engine](https://console.cloud.google.com/kubernetes/list)\n2. In the navigation menu, click **Backup for GKE**.\n\n3. Click the **Restore plans** tab.\n\n4. Click the restore plan name.\n\n5. Click the **Details** tab.\n\n6. In the **Restore configurations** section, go to the **Cluster-scoped resources** section and click **Edit**.\n\n7. In the **Define conflict handling** section, select a conflict handling option.\n\n8. Click **Save changes**.\n\nRestore conflict handling for namespaced resources\n--------------------------------------------------\n\nIn the restore plan, you can configure the following options to manage conflict\nfor a namespaced resource. You can specify conflict handling for namespaced\nresources at the following levels:\n\n- Individual resource\n- Namespace and ProtectedApplication\n\n| **Note:** If the restore plan includes destructive policies, such as merge replace volume, merge replace, and rollback, the PV and volume continue to exist but become orphaned and unused if the reclaim policy is [Retain](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#retain). If the reclaim policy is [Delete](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#delete), the PV and volume are deleted.\n\nThe following are the available options to handle conflicts for the individual resources:\n\n- **Merge skip (non-destructive)**: if a specific resource already exists, skip restoring the resource from the backup.\n- **Merge replace volume (destructive)**: if a specific resource already exists, skip restoring that resource but replace the underlying persistent volume using the volume data restore policy. The merge replace volume achieves the data-only restore.\n- **Merge replace (destructive)**: if a specific resource already exists, replace that resource with the one from backup and the associated volume data by following the volume data restore policy.\n\nThe following are the available options to handle conflicts of all resources\nbelonging to a **Namespace** and **ProtectedApplication**:\n\n- **Fail on conflict (non-destructive)** : if namespace or [ProtectedApplication](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/protected-application) targeted for restore from a backup that already exists in the target cluster, the restore fails.\n- **Rollback (destructive)** : when the target cluster contains the namespace\n or [ProtectedApplication](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/protected-application) that are targeted for restore to the cluster,\n the existing group of resources is deleted before the new resources are restored.\n\n### gcloud\n\nUpdate an existing restore plan to handle conflict for a namespaced resource: \n\n gcloud beta container backup-restore restore-plans update \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e \\\n --project=\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --namespaced-resource-restore-mode=\u003cvar translate=\"no\"\u003eNAMESPACED_RESOURCE_RESTORE_MODE\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eRESTORE_PLAN\u003c/var\u003e: the name of the restore plan that you want to update.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [compute region](/compute/docs/regions-zones#available) for the resource, for example `us-central1`.\n- \u003cvar translate=\"no\"\u003eNAMESPACED_RESOURCE_RESTORE_MODE\u003c/var\u003e: defines how to\n handle restore-time conflicts for namespaced resources. Use one of the following options:\n\n - \u003cvar translate=\"no\"\u003emerge-skip-on-conflict\u003c/var\u003e: skip the individual conflicting resources.\n - \u003cvar translate=\"no\"\u003emerge-replace-volume-on-conflict\u003c/var\u003e: skip the individual conflicting resources but replace the underlying persistent volume data.\n - \u003cvar translate=\"no\"\u003emerge-replace-on-conflict\u003c/var\u003e: replace the individual conflicting resources and underlying persistent volume data.\n - \u003cvar translate=\"no\"\u003efail-on-conflict\u003c/var\u003e: to fail on conflicting namespace or [ProtectedApplication](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/protected-application).\n - \u003cvar translate=\"no\"\u003edelete-and-restore\u003c/var\u003e: roll back conflicting namespace or [ProtectedApplication](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/protected-application).\n\n### Console\n\nUse the following instructions to update namespaced resources conflict policy in the Google Cloud console:\n\n1. In the Google Cloud console, go to the **Google Kubernetes Engine** page.\n\n [Go to Google Kubernetes Engine](https://console.cloud.google.com/kubernetes/list)\n2. In the navigation menu, click **Backup for GKE**.\n\n3. Click the **Restore Plans** tab.\n\n4. Click the restore plan name.\n\n5. Click the **Details** tab.\n\n6. In the **Restore configurations** section, go to the **Namespaced resources** section and click **Edit**.\n\n7. In the **Define conflict handling** section, select a conflict handling option.\n\n8. Click **Save changes**.\n\nRecommended conflict handlings for common scenarios\n---------------------------------------------------\n\nThe following table lists the recommended conflict handling strategies for certain common scenarios:\n\nWhat's next\n-----------\n\n- Learn more about [restoring a backup](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/restore)."]]