To delete a Tanzu Kubernetes Grid management cluster, run the tkg delete management-cluster command.

When you run tkg delete management-cluster, Tanzu Kubernetes Grid creates a temporary kind cleanup cluster on your bootstrap environment to manage the deletion process. The kind cluster is removed when the deletion process completes.

  1. To list all of the management clusters are running, run the tkg get management-cluster command.

    tkg get management-cluster
    

    The management cluster context that is the current context of the Tanzu Kubernetes Grid CLI and kubectl is marked with an asterisk (*).

    MANAGEMENT-CLUSTER-NAME     CONTEXT-NAME                                    
    my-vsphere-mgmt-cluster *   vsphere-mgmt-cluster-admin@vsphere-mgmt-cluster 
    my-aws-mgmt-cluster         aws-mgmt-cluster-admin@aws-mgmt-cluster   
    
  2. If there are management clusters that you no longer require, run tkg delete management-cluster.

    You must specify the name of the management cluster to delete.

    tkg delete management-cluster my-aws-mgmt-cluster
    

    To skip the yes/no verification step when you run tkg delete management-cluster, specify the --yes option.

    tkg delete management-cluster my-aws-mgmt-cluster --yes
    
  3. If there are Tanzu Kubernetes clusters running in the management cluster, the delete operation is not performed.

    In this case, you can delete the management cluster in two ways:

    • Run tkg delete cluster to delete all of the running clusters and then run tkg delete management-cluster again.
    • Run tkg delete management-cluster with the --force option.
    tkg delete management-cluster my-aws-mgmt-cluster --force
    

IMPORTANT: Do not change context or edit the .kube-tkg/config file while Tanzu Kubernetes Grid operations are running.

check-circle-line exclamation-circle-line close-line
Scroll to top icon