<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.11 </button>

- [Latest version](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/latest/how-to/deleting-a-user-cluster)
- [Version 1.16](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/1.16/how-to/deleting-a-user-cluster.md.txt)
- [Earlier versions (unsupported)](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/latest/version-history#expandable-1)

<br />

This page describes how to delete an Google Distributed Cloud user
cluster.

## Overview

How you delete a user cluster depends on how the cluster was created. If the
cluster was created in the Google Cloud console, you can use either the
Google Cloud console or `gkectl` to delete it. If the cluster was created with
`gkectl`, use `gkectl` to delete it. If you are unsure how the cluster was
created, follow the steps below to delete the cluster using the
Google Cloud console.

## Delete a user cluster

### Google Cloud console

If the user cluster was created in the Google Cloud console, or it has been
[configured to be managed by the Anthos On-Prem API](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/1.11/how-to/enroll-user-cluster),
do the following steps to delete the cluster:

1. In the Google Cloud console, go to the GKE Enterprise clusters page.

   [Go to the GKE Enterprise clusters page](https://console.cloud.google.com/anthos/clusters)
2. Select the Google Cloud project that the user cluster is in.

3. In the list of clusters, click the cluster that you want to delete.

4. In the **Details** panel, if the **Type** is **vm Anthos (VMware)** do the
   following steps to delete the cluster using the Google Cloud console:

   1. In the **Details** panel, click **More details**.

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

   3. When prompted to confirm, click **Delete** again.

   If the **Type** is **external** , this indicates that the cluster was
   created using `gkectl`. In this case, use `gkectl` to delete the cluster.

### gkectl

If the cluster was created using `gkectl`, and it wasn't configured to be
managed by the Anthos On-Prem API, run the following command to delete
the cluster:

    gkectl delete cluster \
        --kubeconfig ADMIN_CLUSTER_KUBECONFIG \
        --cluster CLUSTER_NAME 

where

- `ADMIN_CLUSTER_KUBECONFIG` is the path to the admin cluster's kubeconfig file.
- `CLUSTER_NAME` is the name of the user cluster you want to delete.

If you are using the Seesaw bundled load balancer,
[delete the load balancer](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/1.11/how-to/bundled-load-balance.md.txt#deleting_a_load_balancer).

## Force delete a user cluster

If deleting the user cluster using the Google Cloud console or
`gkectl delete cluster` fails to delete the cluster, you can run `gkectl` with
the `--force` flag.

To force delete a cluster:

    gkectl delete cluster \
       --kubeconfig ADMIN_CLUSTER_KUBECONFIG \
       --cluster CLUSTER_NAME \
       --force

- `ADMIN_CLUSTER_KUBECONFIG` is the path to the admin cluster's kubeconfig file.
- `CLUSTER_NAME` is the name of the user cluster you want to delete.

### Clean up resources

After a forced deletion, some F5 or vSphere resources might be leftover. The
following sections explain how to clean up these leftover resources.

#### Clean up a user cluster's VMs in vSphere

To verify that the user cluster's VMs are deleted, perform the following steps:

1. From the vSphere Web Client's left-hand **Navigator** menu, click the
   **Hosts and Clusters** menu.

2. Find the resource pool for your admin cluster. This is the value of
   [`vCenter.resourcePool`](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/1.11/how-to/admin-cluster-configuration-file.md.txt#vcenter-resourcepool-field)
   in your admin cluster configuration file.

3. Under the resource pool, locate VMs prefixed with the name of your user
   cluster. These are the control-plane nodes for your user cluster. There will
   be one or three of these depending on whether your user cluster has a
   high-availability control plane.

4. Find the resource pool for your user cluster. This is the value of
   [`vCenter.resourcePool`](https://docs.cloud.google.com/anthos/clusters/docs/on-prem/1.11/how-to/user-cluster-configuration-file.md.txt#vcenter-resourcepool-field)
   in your user cluster configuration file. If your user cluster configuration
   file does not specify a resource pool, it is inherited from the admin cluster.

5. Under the resource pool, locate VMs prefixed with the name of a node pool in
   your user cluster. These are the worker nodes in your user cluster.

6. For each control-plane node and each worker node:

   1. From the vSphere Web Client, right-click the VM and select
      **Power** \> **Power Off**.

   2. After the VM is powered off, right-click the VM and select
      **Delete from Disk**.

#### Clean up a user cluster's F5 partition

If there are any entries remaining in the user cluster's partition, perform the
following steps:

1. From the F5 BIG-IP console, in the top-right corner of the console, switch to the user cluster partition you want to clean up.
2. Select **Local Traffic** \> **Virtual Servers** \> **Virtual Server List**.
3. In the **Virtual Servers** menu, remove all the virtual IPs.
4. Select **Pools**, then delete all the pools.
5. Select **Nodes**, then delete all the nodes.

## After you have finished

After `gkectl` finishes deleting the user cluster, you can delete the user
cluster's kubeconfig.