When attempting to delete an object in a vSphere Supervisor environment, the object remains stuck in Deleting state.
This KB article will go over checks regarding if the deleting object is a Namespace, Cluster or TanzuKubernetesCluster (TKC) object.
For Workload Cluster nodes stuck deleting, please check the below KB article regarding PodDisruptionBudgets (PDBs):
vSphere Workload Cluster Node Stuck Deleting due to PodDisruptionBudget (PDB)
vSphere Supervisor 7.0
vSphere Supervisor 8.0
vSphere Supervisor 9.0
This issue can occur regarding of whether or not the affected resource is managed by Tanzu Mission Control (TMC).
Object deletions can get stuck when incorrect steps are performed for deletion. The deletion request remains stuck as it is waiting for existing underlying objects and dependencies to delete.
For example:
kubectl describe ns <namespace>
Status: Terminating
Conditions:
Type Reason Message Status LastTransitionTime
ContentDeletionFailed Failed to delete all resource types, # remaining: admission webhook "validation.clusterclass.cluster.x-k8s.io" denied the request: ClusterClass.cluster.x-k8s.io "<clusterclass name>" is forbidden: ClusterClass cannot be deleted because it is used by # Cluster(s).
NamespaceContentRemaining True DAY, DD MON YYYY HH:MM:SS +ssss
SomeResourcesRemain Some resource are remaining: clusterbootstraps.run.tanzu.vmware.com has # resource instances, clusters.cluster.x-k8s.io has # resource instances, kubeadmcontrolplanes.controlplane.cluster.x-k8s.io has # resource instances, machines.cluster.x-k8s.io has # resource instances, secrets. has # resource instances
NamespaceFinalizersRemaining True DAY, DD MON YYYY HH:MM:SS +ssss
SomeFinalizersRemain Some content in the namespace has finalizers remaining: cluster.cluster.x-k8s.io in # resource instances, kubeadmcontrolplanes.controlplane.cluster.x-k8s.io in # resource instances, machines.cluster.x-k8s.io in # resource instances, tkg.tanzu.vmware.com/addon in # resource instances
For Workload Cluster nodes stuck deleting, please check the below KB article regarding PodDisruptionBudgets (PDBs):
vSphere Workload Cluster Node Stuck Deleting due to PodDisruptionBudget (PDB)
Any further actions should be to investigate the noted underlying objects or dependencies for the stuck Deleting object, which are also likely stuck deleting/terminating.
Finalizers exist to prevent untimely or inappropriate deletion of objects which underlying resources are dependent upon.
Please contact VMware by Broadcom Technical Support for assistance on cleaning up stuck objects that are stuck Deleting or stuck Terminating.