When attempting to delete a TKC this can sometimes get stuck in a deletion phase, if there are still objects remaining for cluster
vSphere IAAS
Deletions can get stuck when correct steps are not used for delelion e.g Deleting namespace from UI before removing cluster. Running below command will provide a list of what may be holding up the deletion of the cluster.
kubectl api-resources --namespaced -o name | paste -d ',' -s | xargs kubectl get -n <ns>
From below we can see objects that are holding up the deletion.
kubectl api-resources --namespaced -o name | paste -d ',' -s | xargs kubectl get -n <namespace>
NAME | PHASE | AGE | VERSION |
cluster.cluster.x-k8s.io/<cluster name> |
Deleting | 31d |
NAME | CLUSTER | INITIALIZED | API SERVER | AVAILABLE | REPLICAS | READY | UPDATED | UNAVAILABLE | AGE | VERSION |
kubeadmcontrolplane.controlplane.cluster.x-k8s.io/<cluster name>-control-plane |
/<cluster name> |
true | true | 1 | 0 | 1 | 1 | 0 | 31d |
v1.28.7+vmware.1-fips.1 |
NAME | CONTROL PLANE | WORKER | TKR NAME | AGE | READY | TKR COMPATIBLE | UPDATES AVAILABLE |
tanzukubernetescluster.run.tanzu.vmware.com/<cluster name> |
1 | v1.28.7---vmware.1-fips.1-tkg.1 |
31D | False | True |
Objects can be removed manually by deleting objects listed from kubectl api-resources --namespaced -o name | paste -d ',' -s | xargs kubectl get -n <namespace>
Please contact Broadcom support for further instructions on deleting the objects preventing the namespace/TKC from being deleted.