Remove a self-managed cluster that you no longer want to manage with Tanzu Platform for Kubernetes.
This procedure assumes that you have added a self-managed cluster.
Make sure you have the appropriate permissions to detach a cluster.
Depending on your chosen approach, make sure you have done one of the following:
You can remove a self-managed cluster from Tanzu Platform using either the hub or the Tanzu CLI.
In the confirmation dialog, select the method you want to use for removing the cluster.
Click Detach.
To detach a self-managed cluster using the tanzu
CLI:
Run the following command, replacing <my-cluster>
with the name of your cluster:
tanzu operations cluster delete <my-cluster> --cluster-type attached
To detach a self-managed cluster from Tanzu Platform without removing the cluster agent extensions, add the --force
flag, for example:
tanzu operations cluster delete <my-cluster> --cluster-type attached --force
If you have removed a cluster from Tanzu Platform management without cleaning up the cluster agent extensions from the cluster, you can use this procedure to remove the residual resources from the cluster and still retain the cluster.
The following steps remove the Tanzu-related resources on your cluster.
Use the following kubectl commands to remove the namespace, CRDs, clusterroles/clusterrolebindings, and other resources installed by Tanzu Platform.
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
Use the following kubectl commands to remove the catalog-related Kubernetes resources installed by Tanzu Platform.
NoteRemoving 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