Use the Manually delete agent extensions option to forcibly remove a cluster from your VMware Tanzu Mission Control organization.

When you provision or attach a cluster, Tanzu Mission Control installs cluster agent extensions on the cluster and registers the cluster with the Tanzu Mission Control cluster agent service. For more information, see What Happens When You Attach a Cluster in VMware Tanzu Mission Control Concepts.

When you remove an attached cluster from your Tanzu Mission Control organization using the Manually delete agent extensions option, Tanzu Mission Control makes no attempt to remove the cluster agent extensions installed on the cluster. If you choose this option, you must manually remove the cluster agent extensions as described in this procedure.
Note: If you use Manually delete agent extensions to release control of a provisioned cluster, Tanzu Mission Control attempts to delete the cluster but it is possible that the cluster and its resources might remain as they were prior to removing the cluster from your organization. These resources, that were provisioned through Tanzu Mission Control, might continue to run in the cloud provider account in which you created them. You must manually delete the cluster and its resources using your cloud provider's tools to avoid incurring costs associated with them.

In contrast, when you detach a cluster without the Manually delete agent extensions option, Tanzu Mission Control tells the cluster agent extensions to uninstall themselves, and then removes the cluster from the cluster agent registry for your organization. Similarly when you use the standard delete of a provisioned cluster, Tanzu Mission Control deletes the cluster from your cloud provider before removing it from the cluster agent registry for your organization.

Unless you have reason to forcibly remove this cluster from your organization, use the standard detach or delete without the Manually delete agent extensions option.

Some reasons to use the Manually delete agent extensions option include the following:
  • You have attempted to delete the cluster and it appears to be stuck in the Deleting state for an extended period of time.
  • You want to detach the cluster, but for some reason Tanzu Mission Control cannot communicate with it.
In either case, make sure you remove the cluster agent extensions manually as described in this procedure, or delete the cluster if it is no longer needed.

Prerequisites

Before you start this procedure, log in to the Tanzu Mission Control console and make sure you have the appropriate permissions.
  • To detach or delete a cluster, you must be associated with the clustergroup.edit role for the cluster group.
  • You must also be associated with the cluster.admin role for the cluster.

Procedure

  1. In the left navigation pane of the Tanzu Mission Control console, click Cluster groups.
  2. On the Cluster groups page, click the cluster group that contains the cluster you want to remove from your organization, and then click the cluster.
  3. On the cluster detail page, click Actions and then choose the appropriate action from the dropdown.
    • For an attached cluster, choose Detach.
    • For a provisioned cluster, choose Delete.
  4. In the confirmation dialog, select Manually delete agent extensions and then enter the name of the cluster.
  5. Click Detach or Delete.
    Tanzu Mission Control de-registers the cluster from your organization.
  6. If you no longer need the cluster, delete it using your cloud provider's tools.
  7. If you want to keep the cluster, remove the cluster agent extensions.
    1. Open a command window and connect to your cluster with kubectl.
    2. Use the following kubectl commands to remove the namespace, CRDs, clusterroles/clusterrolebindings, and other resources installed by Tanzu Mission Control.
      kubectl delete namespace vmware-system-tmc
      kubectl delete crd extensions.clusters.tmc.cloud.vmware.com
      kubectl delete crd agents.clusters.tmc.cloud.vmware.com
      kubectl delete crd extensionresourceowners.clusters.tmc.cloud.vmware.com
      kubectl delete crd extensionintegrations.clusters.tmc.cloud.vmware.com
      kubectl delete crd extensionconfigs.intents.tmc.cloud.vmware.com
      kubectl delete clusterrole extension-updater-clusterrole extension-manager-role agent-updater-role vmware-system-tmc-psp-agent-restricted
      kubectl delete clusterrolebinding extension-updater-clusterrolebinding extension-manager-rolebinding agent-updater-rolebinding vmware-system-tmc-psp-agent-restricted
      kubectl delete psp vmware-system-tmc-agent-restricted
      
    3. Use the following kubectl commands to remove the catalog-related Kubernetes resources installed by Tanzu Mission Control.
      Note: Removing these resources impacts any workloads that you have deployed using the catalog.
      kubectl delete crd packageinstalls.packaging.carvel.dev
      kubectl delete crd packagerepositories.packaging.carvel.dev
      kubectl delete crd internalpackagemetadatas.internal.packaging.carvel.dev
      kubectl delete crd internalpackages.internal.packaging.carvel.dev
      kubectl delete crd apps.kappctrl.k14s.io
      kubectl delete APIService v1alpha1.data.packaging.carvel.dev
      kubectl delete ns tanzu-system
      kubectl delete ns tanzu-package-repo-global
      kubectl delete tanzupackage-install-admin-role kapp-controller-cluster-role
      kubectl delete clusterrolebinding kapp-controller-cluster-role-binding pkg-apiserver:system:auth-delegator 
      kubectl delete psp tanzu-system-kapp-ctrl-restricted
      kubectl delete rolebinding pkgserver-auth-reader -n kube-system
      
    These kubectl commands remove the Tanzu Mission Control cluster agent extensions from your cluster.