TKC becomes orphaned and fails to delete due to missing supervisor namespace
search cancel

TKC becomes orphaned and fails to delete due to missing supervisor namespace

book

Article ID: 421975

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

Tanzu Kubernetes Cluster (TKC) becomes orphaned because the Supervisor Namespace was deleted before deleting the TKC.
In this condition, the TKC enters a stuck/terminating state, and normal deletion attempts fail because the namespace no longer exists.

  • A TKC object remains visible in the Supervisor cluster:
    • kubectl get tkc -A
  • While trying to delete the cluster, result indicates that the namespace listed for the TKC does not exist:
    • Error from server (NotFound): namespaces "<name>" not found

Environment

vSphere with Tanzu

Cause

Each TKC object is namespaced and depends on the existence of the Supervisor Namespace for:

  • VM Operator reconciliation
  • Cluster API (CAPI) cleanup
  • Machine, vSphereMachine, and VirtualMachine object garbage collection
  • Finalizer completion

If the namespace is deleted before deleting the TKC, the TKC becomes orphaned, preventing controllers from completing the cleanup workflow.

As a result, the TKC cannot be deleted normally and remains in an inconsistent state.

This is why you see:

tkc stuck in Terminating or Ready=False or namespace not found

Resolution

To safely clean up an orphaned Tanzu Kubernetes Cluster (TKC), recreate the missing namespace to allow Supervisor controllers to complete the deletion workflow. After the TKC is removed, the namespace may be deleted if no longer required.

Note: Do not remove finalizers unless instructed by VMware/Broadcom Support, as it may leave orphaned VMs or incomplete Cluster API objects.

Step 1: Recreate the Supervisor Namespace

Recreate the namespace with the same name as shown in the TKC listing:

  • kubectl create namespace <namespace>

This namespace does not require any labels, storage policies, permissions, or VM class assignments.A minimal empty namespace is sufficient for controller cleanup.

Step 2: Attempt TKC deletion again

Run the standard delete command:

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

Step 3: Verify cleanup

Confirm that both TKC and underlying CAPI objects are removed:

  • kubectl get tkc -A
  • kubectl get cluster -A
  • kubectl get vspheremachine -A
  • kubectl get virtualmachine -A

All objects related to the TKC should now be absent.

Step 4: (Optional) Delete the re-created namespace

If the namespace was created only to complete cleanup and is no longer needed:

  • kubectl delete namespace <namespace>

The namespace should delete immediately, as no workloads or TKC resources remain.

Additional Information

TKC deletion depends on:

  • CAPI Cluster controller
  • MachineDeployment/Machines controller
  • VM Operator
  • Supervisor Namespace controller

These only operate when the namespace exists.

When you recreate the namespace:

  • Controllers reattach
  • Finalizers run normally
  • Node VMs and CAPI objects are cleaned
  • TKC is deleted successfully