Stale NCP created objects left in NSX after removing Tanzu/Kubernetes Cluster
search cancel

Stale NCP created objects left in NSX after removing Tanzu/Kubernetes Cluster

book

Article ID: 422746

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Tanzu/Kubernetes cluster has removed
  • Tanzu/Kubernetes may have been removed/uninstalled
  • Objects created by NCP remain in NSX

Environment

VMware NSX

Cause

Removing Tanzu/Kubernetes or created clusters may not remove all objects in NSX created by NCP. This can happen if there are dependencies on the objects that are attempted to be removed.

Resolution

This is a condition that may occur in a VMware NSX environment.

 

Workaround: 

Use the NCP cleanup script to remove objects from decommissioned clusters. 

On vCenter, run the following script (if NCP was deployed in policy mode)
python nsx_policy_cleanup.py --mgr-ip={nsx_mngr_ip} -u admin -p {password} -c {k8s_cluster_name} --no-warning -r

On vCenter, run the following script (if NCP was deployed in manager mode)
python nsx_cleanup.py --mgr-ip={nsx_mngr_ip} -u admin -p {password} -c {k8s_cluster_name} --top-tier-router-uuid={top_tier_router_uuid} --no-warning -r

Please see the link under Additional Information for further details on the command parameters. 

Additional Information

NSX Container Plugin - Cleaning Up the NSX Environment