Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página se describe cómo cancelar el registro de un clúster en una flota de Google Cloud de forma manual.
Cuando cancelas el registro de un clúster de forma manual, se quita su conexión con la flota, pero el clúster permanece. Si borras un clúster de GKE registrado en Google Cloud a través la consola de Google Cloud o gcloud CLI también se borra la membresía de la flota del clúster.
Puedes cancelar el registro de clústeres de GKE en Google Cloud y en clústeres
de terceros conectados únicamente. No se pueden cancelar el registro de otros tipos de clústeres.
Ten en cuenta que no se recomienda mover clústeres registrados entre flotas (anular el registro y, luego,
volver a registrarlo), ya que puede dar como resultado un comportamiento
inesperado o no deseado, por ejemplo, Workload Identity de la flota de tus cargas de trabajo
cambiará, lo que podría provocar interrupciones y solicitudes bloqueadas. El
enfoque recomendado es crear un clúster nuevo en la flota, en el que
deseas que residan las cargas de trabajo y, luego, mover las cargas de trabajo del clúster anterior
al nuevo.
Cancela el registro de un clúster
gcloud
Cancela el registro de un clúster de GKE
Este comando solo se puede usar para cancelar el registro de clústeres de GKE registrados con gcloud container clusters update o gcloud container clusters create.
[MEMBERSHIP_NAME] es el nombre de la membresía que corresponde a tu clúster. Para enumerar todas las membresías del concentrador, ejecuta: gcloud container fleet memberships list.
[GKE_URI] es el URI del clúster de GKE, por ejemplo: “https://container.googleapis.com/projects/my-project/locations/us-central1-a/clusters/my-cluster”.
Para obtener el URI, ejecuta gcloud container clusters list --uri.
El URI proporcionado se validará para confirmar que se asigna al clúster de GKE válido.
[GKE_CLUSTER] es el location/name del clúster de GKE. La ubicación puede ser una zona o una región, por ejemplo: us-central1-a/my-cluster.
Cancela el registro de un clúster conectado
Estas instrucciones se aplican a los clústeres registrados con la versión más reciente de nuestra función de clústeres conectados. Los clústeres conectados con la generación anterior obsoleta de esta función deben usar el comando heredado en la siguiente sección.
[MEMBERSHIP_NAME] es el nombre de la membresía que corresponde a tu clúster. Para obtener una lista de todas las membresías en el concentrador, ejecuta gcloud container fleet memberships list.
[KUBECONFIG_PATH] es la ruta local en la que
se almacena el kubeconfig que contiene una entrada para el archivo del clúster.
El valor predeterminado es $KUBECONFIG si esa variable de entorno está configurada, de lo contrario, el valor predeterminado será $HOME/.kube/config.
[KUBECONFIG_CONTEXT] es el contexto del clúster tal como aparece en el archivo de kubeconfig. Puedes obtener este valor desde la línea de comandos si ejecutas kubectl config current-context.
Console
Cancela el registro un clúster de GKE en Google Cloud
Para cancelar el registro de un clúster de GKE, haz lo siguiente:
Ve a la página Clústeres de GKE. En
esta página, se muestran todos tus clústeres.
Selecciona el proyecto de Google Cloud en el que se encuentra el clúster.
Haz clic en el nombre del clúster que deseas desconectar y, luego, selecciona
View more details en el panel lateral.
Cerca de la parte superior de la ventana, haz clic en delete
Borrar.
Cuando se te solicite confirmación, ingresa el nombre del clúster y
haz clic en Confirmar.
Terraform
Para cancelar el registro de un clúster de GKE que registraste con Terraform, ejecuta el siguiente comando:
Borra el siguiente bloque de la configuración de recursos google_container_cluster del clúster:
fleet {
project = "FLEET_HOST_PROJECT""
}
FLEET_HOST_PROJECT es el ID del proyecto de Google Cloud en el que está registrado tu clúster.
Cómo administrar Connect Agent
Los siguientes pasos se aplican solo a la cancelación del registro de clústeres conectados, en los que Connect Agent se instala en el clúster como parte del registro.
Verifica que se borre el espacio de nombres de Connect Agent (opcional)
Después de cancelar el registro de un clúster, puedes verificar que se haya borrado el espacio de nombres que usa el agente de Connect. Esto se aplica solo a los registros que instalan el agente de Connect. Para realizar esta acción debes ejecutar lo siguiente:
kubectl get ns -l hub.gke.io/project
Si este comando no muestra ningún resultado, el espacio de nombres ya se borró.
Borra la cuenta de servicio de Connect Agent
Si creaste una cuenta de servicio para el agente de Connect, puedes borrarla de la siguiente manera:
gcloud iam service-accounts delete [SERVICE_ACCOUNT_NAME]
Cancela el registro de un clúster no disponible
Si deseas cancelar el registro de un clúster al que ya no tienes acceso, sigue estos pasos:
Enumera los clústeres (es decir, las membresías) que estén registrados actualmente:
gcloud container fleet memberships list
En el resultado del comando, la columna Name enumera los nombres de la membresía de los clústeres registrados y la columna EXTERNAL_ID enumera los UID de los clústeres del espacio de nombres de kube-system.
Para cancelar el registro de un clúster no disponible, ejecuta el siguiente comando:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["This page describes how to manually unregister a cluster from a Google Cloud fleet.\nWhen you manually unregister a cluster, its connection to the fleet is\nremoved but the cluster remains. [Deleting a registered GKE cluster on Google Cloud](/kubernetes-engine/docs/how-to/deleting-a-cluster) using either the Google Cloud console or gcloud CLI also deletes the cluster's fleet membership.\n\nYou can unregister GKE clusters on Google Cloud and attached\nthird-party clusters only. Other cluster types can't be unregistered.\n\nNote that moving registered clusters between fleets (unregistering then\nreregistering) is not recommended, as it can result in unexpected\nor unwanted behavior: for example, your workloads' fleet Workload Identity\nwill change, potentially resulting in blocked requests and outages. The\nrecommended approach is to create a new cluster in the fleet in which you\nwant your workloads to reside, then move your workloads from your old cluster\nto the new cluster.\n\nUnregister a cluster \n\ngcloud\n\nUnregister a GKE cluster\n\nThis command can only be used to unregister GKE clusters registered using `gcloud container clusters update` or `gcloud container clusters create`.\n\nRun the following command: \n\n```\ngcloud container clusters update CLUSTER_NAME --clear-fleet-project\n```\n\nReplace \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with the cluster's name you want to delete.\n\nUnregister a GKE cluster (legacy command)\n\nIf you registered a cluster using the older `register` command, run either of the following commands to unregister it: \n\n```\ngcloud container fleet memberships unregister [MEMBERSHIP_NAME] \\\n --project=[PROJECT_ID] \\\n --gke-uri=[GKE_URI]\n``` \n\n```\ngcloud container fleet memberships unregister [MEMBERSHIP_NAME] \\\n --project=[PROJECT_ID] \\\n --gke-cluster=[GKE_CLUSTER]\n```\n\nwhere:\n\n- \u003cvar translate=\"no\"\u003e[PROJECT_ID]\u003c/var\u003e is your Google Cloud project ID. [Learn how to find\n this value](/resource-manager/docs/creating-managing-projects#identifying_projects).\n- \u003cvar translate=\"no\"\u003e[MEMBERSHIP_NAME]\u003c/var\u003e is the membership name that corresponds to your cluster. To list all the memberships on the Hub, run: `gcloud container fleet memberships list`.\n- \u003cvar translate=\"no\"\u003e[GKE_URI]\u003c/var\u003e 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 running `gcloud container clusters list --uri`. The provided URI will be validated to confirm that it maps to the valid GKE cluster.\n- \u003cvar translate=\"no\"\u003e[GKE_CLUSTER]\u003c/var\u003e is the `location/name` of the GKE cluster. The location can be a zone or a region for example: `us-central1-a/my-cluster`.\n\nUnregister an attached cluster\n\nThese 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.\n\n- [Detach an EKS cluster](/anthos/clusters/docs/multi-cloud/attached/eks/how-to/detach-cluster)\n- [Detach an AKS cluster](/anthos/clusters/docs/multi-cloud/attached/aks/how-to/detach-cluster)\n- [Detach another attached cluster type](/anthos/clusters/docs/multi-cloud/attached/generic/how-to/detach-cluster)\n\nUnregister an attached cluster (legacy command)\n\nIf you registered a cluster using the previous generation of attached clusters, run the following command to unregister it: \n\n```\ngcloud container fleet memberships unregister [MEMBERSHIP_NAME] \\\n --project=[PROJECT_ID] \\\n --context=[KUBECONFIG_CONTEXT] \\\n --kubeconfig=[KUBECONFIG_PATH]\n```\n\nwhere:\n\n- \u003cvar translate=\"no\"\u003e[PROJECT_ID]\u003c/var\u003e is your Google Cloud project ID. [Learn how to find\n this value](/resource-manager/docs/creating-managing-projects#identifying_projects).\n- \u003cvar translate=\"no\"\u003e[MEMBERSHIP_NAME]\u003c/var\u003e is the membership name that corresponds to your cluster. To get list of all the memberships on the Hub, run: `gcloud container fleet memberships list`.\n- \u003cvar translate=\"no\"\u003e[KUBECONFIG_PATH]\u003c/var\u003e is the local path where your kubeconfig 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`.\n- \u003cvar translate=\"no\"\u003e[KUBECONFIG_CONTEXT]\u003c/var\u003e is the cluster's context as it appears in the kubeconfig file. You can get this value from the command line by running `kubectl config current-context`.\n\nConsole\n\nUnregister a GKE cluster on Google Cloud\n\nTo unregister a GKE cluster:\n\n1. Go to the **GKE Clusters** page. This\n page shows all your clusters.\n\n [Go to the GKE Clusters page](https://console.cloud.google.com/kubernetes/list/overview)\n2. Click more_vert **Actions** next to the cluster in the list that you want to unregister.\n\n3. In the Actions menu, select **Unregister**.\n\n4. In the dialog that displays, type the name of the cluster and click **Unregister** to confirm the action.\n\nUnregister an attached third-party cluster\n\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\n\u003cbr /\u003e\n\nTo unregister an attached cluster:\n\n1. In the Google Cloud console, go to the **Google Kubernetes Engine clusters\n overview** page.\n\n [Go to GKE clusters](https://console.cloud.google.com/kubernetes/list/overview)\n2. Select the Google Cloud project that the cluster is in.\n\n3. Click the name of the cluster you want to detach, and then select\n **View more details** in the side panel.\n\n4. Near the top of the window, click delete **Delete**.\n\n5. When prompted to confirm, enter the name of the cluster and\n click **Confirm**.\n\nTerraform\n\nTo unregister a GKE cluster that you registered using Terraform:\n\nDelete the following block from the `google_container_cluster` resource configuration of the cluster: \n\n fleet {\n project = \u003cvar translate=\"no\"\u003e\"FLEET_HOST_PROJECT\"\u003c/var\u003e\"\n }\n\n\u003cvar translate=\"no\"\u003eFLEET_HOST_PROJECT\u003c/var\u003e is the Google Cloud project ID your cluster is registered to.\n\nManage the Connect Agent\n\nThe following steps apply only to unregistering attached clusters, where the Connect Agent is installed on the cluster as part of registration.\n\nOptional: Verify that the Connect Agent namespace is deleted\n\nAfter you unregister a cluster, you can verify that the namespace used by the\nConnect Agent has been deleted. This applies to registrations that install the Connect Agent only. To do so, run: \n\n```\nkubectl get ns -l hub.gke.io/project\n```\n\nIf this command returns no output, the namespace has already been deleted.\n\nDelete the Connect Agent Service Account\n\nIf you created a service account for the Connect Agent, you can delete it as follows: \n\n```\ngcloud iam service-accounts delete [SERVICE_ACCOUNT_NAME]\n```\n\nUnregister an unavailable cluster\n\nIf you want to unregister a cluster that you can no longer access, perform\nthe following steps:\n\n1. List the clusters (a.k.a memberships) that are currently registered:\n\n ```\n gcloud container fleet memberships list\n ```\n\n In the command output, the `Name` column lists the membership names of registered\n clusters, and the `EXTERNAL_ID` column lists the clusters' UIDs of the kube-system\n namespace.\n2. To unregister an unavailable cluster, run the following command:\n\n ```\n gcloud container fleet memberships delete [MEMBERSHIP_NAME]\n ```\n\n where \u003cvar translate=\"no\"\u003e[MEMBERSHIP_NAME]\u003c/var\u003e is the membership name that corresponds to\n your cluster."]]