vSphere Namespace Stuck in Terminating Phase on vSphere Supervisor
search cancel

vSphere Namespace Stuck in Terminating Phase on vSphere Supervisor

book

Article ID: 397851

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

A namespace in the vSphere Supervisor does not get deleted and remains indefinitely in the "Terminating" state.
This typically occurs when the deletion process is unable to complete due to leftover resources or configuration inconsistencies.

kubectl get namespace
NAME                         STATUS        AGE
<TARGET_VSPHERE_NAMESPACE>   Terminating   23d
kubectl describe namespace <TARGET_VSPHERE_NAMESPACE>
...
Status: Terminating
Conditions:
   Type                         Status  LastTransitionTime                  Reason              Message
   ----                         ------  ------------------                  ------              -------
   NamespaceContentRemaining    True    Mon-Sun, DD MM YYYY HH:MM:SS +ssss  SomeResoucesRemain  Some resources are remaining: <RESOUCE_NAME> has 1 resource instances.
   NamespaceFinalizersRemaining True    Mon-Sun, DD MM YYYY HH:MM:SS +ssss  SomeFinalizerRemain Some content in the namespace has finalizers remaining: <RESOURCE_NAME> in 1 resource instances,
... 

Environment

vSphere Supervisor

NSX ALB

Cause

This issue typically occurs when the namespace is deleted before removing all associated resources such as Tanzu Kubernetes clusters (TKCs), workloads, or supporting components.

In some cases, an outdated or mismatched AVI (NSX-ALB) certificate on the Supervisor Cluster can also contribute to the problem, interfering with proper namespace cleanup.

Resolution

  • Check for remaining resources
    • Use kubectl get all -n <namespace> to list all resources within the namespace.

    • Consult proper resources for cleaning up the resources under the namespace. Improper deletion of resources can cause the deletion to become stuck even further as well as bring down system functionality and management of other resources in the environment.

      • For system objects. reach out to VMware by Broadcom Technical Support for assistance in proper clean-up.
    • It is not a proper step to delete finalizers to force deletion. Finalizers are set on objects to prevent the clean up of objects which underlying resources are dependent upon. Force deletion of these objects will strand the underlying resources, leading to them becoming unmanageable by the system and potentically causing future issues.

  • Ensure all clusters are deleted

    • Confirm that no TKCs or clusters are still associated with the namespace.

  • Validate and update AVI certificate (if applicable)

    • If the AVI certificate has been updated via the NSX-ALB UI, ensure that the Supervisor Cluster has the correct and matching certificate.

    • Replace the certificate on the Supervisor if necessary.

  • Retry namespace deletion

    • Once all resources are cleared and the certificate is correctly applied, the namespace should get deleted either automatically or upon manual removal from the vCenter UI.

Additional Information

If the issue persists, please refer to: