Tanzu Kubernetes Grid – Detach and delete clusters

Reading Time: 2 mins


In my earlier post, I have shown the steps to attach/register TKG clusters using TMC CLI, now let me explain the process of detaching and deregistering the clusters using TMC Console.

Detach the workload cluster from TMC Console

In TMC Console: Clusters > select the cluster capv-workload > Actions (can be located in top right corner) > Detach

  • provide the name : capv-workload > DETACH

  • Verify the pod status, should take few mins to complete
# Get the admin credentials of the workload cluster. In this case, capv-workload is workload cluster: 

$ tanzu cluster kubeconfig get capv-workload --admin

# Set the context of kubectl to the cluster

$ kubectl config use-context capv-workload-admin@capv-workload

kubectl get pods -n vmware-system-tmc

Deregister the management cluster from TMC Console

In TMC Console: Administration > Management clusters > click on capv-mgmt > Actions (can be located in top right corner) > Deregister

  • Provide name: capv-mgmt and DEREGISTER
  • Verify the pod termination status in management cluster context, should take few mins to complete
# Ensure the context is pointing to management cluster, In this case capv-mgmt is the management cluster. 

kubectl config get-contexts
CURRENT   NAME                        CLUSTER     AUTHINFO          NAMESPACE
*         capv-mgmt-admin@capv-mgmt   capv-mgmt   capv-mgmt-admin

# Check the pods

kubectl get pods -n vmware-system-tmc
  • List the management clusters and capv-mgmt should be missing
tmc managementcluster list

Delete the workload cluster using Tanzu CLI

  • Once deletion is completed, check the cluster list
tanzu cluster list

Delete the management cluster using Tanzu CLI

  • Get management cluster info
tanzu mc get
  • Delete Management cluster using Tanzu CLI, should take 15 mins to complete
tanzu mc delete -y