Detaching a cluster means deregistering it from Google Cloud
[Fleet management](https://docs.cloud.google.com/anthos/fleet-management/docs) and removing the associated
software from your cluster. You can detach the cluster with the Google Cloud CLI
or the Google Cloud console.

### gcloud CLI

To detach a cluster, use the
[`gcloud container attached clusters delete` command](https://docs.cloud.google.com/sdk/gcloud/reference/container/attached/clusters/delete).

Providing the optional flag `--ignore-errors` forces the cluster
to detach even if some in-cluster resources can't be deleted. Including the
optional `--allow-missing` flag means that the delete request returns
a success code even if the cluster can't be found:

```
gcloud container attached clusters delete CLUSTER_NAME \
  --ignore-errors \
  --allow-missing \
  --location=GOOGLE_CLOUD_REGION
```

Replace the following:

- <var translate="no">CLUSTER_NAME</var>: the name of your cluster
- <var translate="no">GOOGLE_CLOUD_REGION</var>: the name of the Google Cloud region administering your cluster

For more information, see
[gcloud container attached clusters delete](https://docs.cloud.google.com/sdk/gcloud/reference/container/attached/clusters/delete).

### Console


> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

<br />

1. In the Google Cloud console, go to the **Google Kubernetes Engine clusters
   overview** page.

   [Go to GKE clusters](https://console.cloud.google.com/kubernetes/list/overview)
2. Select the Google Cloud project that the cluster is in.

3. Click the name of the cluster you want to detach, and then select
   **View more details** in the side panel.

4. Near the top of the window, click **Delete**.

5. When prompted to confirm, enter the name of the cluster and
   click **Confirm**.

When you detach a cluster, all Google Cloud resources related to the cluster,
such as the fleet membership resources and workload identity pool OIDC
providers are deleted. The Kubernetes cluster itself isn't deleted.

> [!NOTE]
> **Note:** Any features not managed by GKE attached clusters, such as Config Sync and Cloud Service Mesh, need to be cleaned up manually.