Unregistering a cluster

This page describes how to manually unregister a cluster from a Google Cloud fleet.When you manually unregister a cluster, its connection to the fleet isremoved but the cluster remains.Deleting a registered GKE cluster on Google Cloud using either the Google Cloud console or gcloud CLI also deletes the cluster's fleet membership.

You can unregister GKE clusters on Google Cloud and attachedthird-party clusters only. Other cluster types can't be unregistered.

Note that moving registered clusters between fleets (unregistering thenreregistering) is not recommended, as it can result in unexpectedor unwanted behavior: for example, your workloads' fleet Workload Identitywill change, potentially resulting in blocked requests and outages. Therecommended approach is to create a new cluster in the fleet in which youwant your workloads to reside, then move your workloads from your old clusterto the new cluster.

Unregister a cluster

gcloud

Unregister a GKE cluster

This command can only be used to unregister GKE clusters registered usinggcloud container clusters update orgcloud container clusters create.

Run the following command:

gcloud container clusters updateCLUSTER_NAME --clear-fleet-project

ReplaceCLUSTER_NAME with the cluster's name you want to delete.

Unregister a GKE cluster (legacy command)

If you registered a cluster using the olderregister command, run either of the following commands to unregister it:

gcloud container fleet memberships unregister[MEMBERSHIP_NAME] \   --project=[PROJECT_ID] \   --gke-uri=[GKE_URI]
gcloud container fleet memberships unregister[MEMBERSHIP_NAME] \   --project=[PROJECT_ID] \   --gke-cluster=[GKE_CLUSTER]

where:

  • [PROJECT_ID] is your Google Cloud project ID.Learn how to findthis value.
  • [MEMBERSHIP_NAME] is the membership name that corresponds to yourcluster. To list all the memberships on the Hub, run:gcloud container fleet memberships list.
  • [GKE_URI] is the URI of the GKE cluster,for example: 'https://container.googleapis.com/projects/my-project/locations/us-central1-a/clusters/my-cluster'.You can obtain the URI by runninggcloud container clusters list --uri.The provided URI will be validated to confirm that it maps to the validGKE cluster.
  • [GKE_CLUSTER] is thelocation/name of theGKE cluster. The location can be a zone or a regionfor example:us-central1-a/my-cluster.

Unregister an attached cluster

These instructions apply to clusters registered using the latest version of our attached clusters feature. Clusters attached using the deprecated previous generation of this feature should use the legacy command in the next section.

Unregister an attached cluster (legacy command)

If you registered a cluster using the previous generation of attached clusters, run the following command to unregister it:

gcloud container fleet memberships unregister[MEMBERSHIP_NAME] \   --project=[PROJECT_ID] \   --context=[KUBECONFIG_CONTEXT] \   --kubeconfig=[KUBECONFIG_PATH]

where:

  • [PROJECT_ID] is your Google Cloud project ID.Learn how to findthis value.
  • [MEMBERSHIP_NAME] is the membership name that corresponds to yourcluster. To get list of all the memberships on the Hub, run:gcloud container fleet memberships list.
  • [KUBECONFIG_PATH] is the local path where yourkubeconfig containing an entry for the cluster file is stored.This defaults to$KUBECONFIG if that environment variable is set,otherwise this defaults to$HOME/.kube/config.
  • [KUBECONFIG_CONTEXT] is the cluster's context as itappears in the kubeconfig file. You can get this value from the commandline by runningkubectl config current-context.

Console

Unregister a GKE cluster on Google Cloud

To unregister a GKE cluster:

  1. Go to theGKE Clusters page. Thispage shows all your clusters.

    Go to the GKE Clusters page

  2. ClickActions next to the cluster in the list that you want to unregister.

  3. In the Actions menu, selectUnregister.

  4. In the dialog that displays, type the name of the cluster and clickUnregister to confirm the action.

Unregister an attached third-party cluster

Preview

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

To unregister an attached cluster:

  1. In the Google Cloud console, go to theGoogle Kubernetes Engine clustersoverview page.

    Go to GKE clusters

  2. Select the Google Cloud project that the cluster is in.

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

  4. Near the top of the window, clickDelete.

  5. When prompted to confirm, enter the name of the cluster andclickConfirm.

Terraform

To unregister a GKE cluster that you registered using Terraform:

Delete the following block from thegoogle_container_cluster resource configuration of the cluster:

fleet {      project ="FLEET_HOST_PROJECT""    }

FLEET_HOST_PROJECT is the Google Cloud project ID your cluster is registered to.

Manage the Connect Agent

The following steps apply only to unregistering attached clusters, where the Connect Agent is installed on the cluster as part of registration.

Optional: Verify that the Connect Agent namespace is deleted

After you unregister a cluster, you can verify that the namespace used by theConnect Agent has been deleted. This applies to registrations that install the Connect Agent only. To do so, run:

kubectl get ns -l hub.gke.io/project

If this command returns no output, the namespace has already been deleted.

Delete the Connect Agent Service Account

If you created a service account for the Connect Agent, you can delete it as follows:

gcloud iam service-accounts delete[SERVICE_ACCOUNT_NAME]

Unregister an unavailable cluster

If you want to unregister a cluster that you can no longer access, performthe following steps:

  1. List the clusters (a.k.a memberships) that are currently registered:

    gcloud container fleet memberships list

    In the command output, theName column lists the membership names of registeredclusters, and theEXTERNAL_ID column lists the clusters' UIDs of the kube-systemnamespace.

  2. To unregister an unavailable cluster, run the following command:

    gcloud container fleet memberships delete[MEMBERSHIP_NAME]

    where[MEMBERSHIP_NAME] is the membership name that corresponds toyour cluster.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.