Deleting a user cluster

This page describes how to delete an Anthos clusters on VMware (GKE on-prem) 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 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 console.

Delete a user cluster

console

If the user cluster was created in the console, or it has been configured to be managed by the GKE On-Prem API, do the following steps to delete the cluster:

  1. In the console, go to the Anthos clusters page.

    Go to the Anthos clusters page

  2. Select the 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 console:

    1. In the Details panel, click View 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 GKE 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.

Force delete a user cluster

If deleting the user cluster using the 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 left over. 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 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 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.