Tanzu guest cluster re-provisions after deletion due to legacy TanzuKubernetesCluster (TKC) object.
search cancel

Tanzu guest cluster re-provisions after deletion due to legacy TanzuKubernetesCluster (TKC) object.

book

Article ID: 421308

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • Unable to permanently delete a Tanzu Guest Cluster or TKG Cluster using the standard v1Beta1 Cluster object.
  • After successfully deleting the cluster with the below command, the cluster gets automatically re-provisioned and returns to a Provisioned state within 30-60 seconds.

kubectl delete cluster <cluster_name> -n <cluster_namespace>

  • The yaml file of the guest cluster confirms that the cluster object is a legacy v1alpha1 TanzuKubernetesCluster (TKC) object. Validate with the below command:

kubectl get cluster <cluster_name> -n <cluster_namespace> -o yaml | less

Environment

  • VMware vSphere Supervisor 1.27
  • VMware vSphere Kubernetes Service 1.26

Cause

The initial command (kubectl delete cluster) only deletes the newer, lower-level Cluster API (CAPI) Cluster object. As the TKC object still exists, the TKC controller immediately reconciles the state by recreating/re-provisioning the missing Cluster object.

Resolution

  • To ensure a complete deletion, you must delete the TanzuKubernetesCluster (TKC) object with the below command: 

kubectl delete tanzukubernetescluster <cluster-name> -n <namespace>

  • This instructs the TKC Controller to initiate the full cluster cleanup process, preventing re-provisioning.