Cleaning up NSX-T resources from a PKS deployment

In the current release (1.0.x) of Pivotal Container Service (PKS), NSX-T resources are not cleaned up after deleting a Kubernetes cluster. In order to delete the PKS created resources out of NSX-T, you’ll need to run the nsx-cli.sh command like so:

./nsx-cli.sh cleanup <PKS_CLUSTER_UUID> <DRY_RUN>

You can grab the PKS cluster ID by running:

pks clusters

2018-04-17_11-11-20.png

Then you’d run nsx-cli.sh like so

./nsx-cli.sh cleanup c23027a4-1b9d-4baf-99f0-8710b7bec851 false

However, if delete the PKS cluster before you record the PKS UUID, how can you retrieve the PKS UUID? It can be found by looking at one of the PKS created NSX objects and looking at the ncp/cluster tag under the Tags section:

2018-04-25_16-05-08.png

The UUID we need is everything after pks- so it will be c23027a4-1b9d-4baf-99f0-8710b7bec851. We can then clean up NSX by running the following:

./nsx-cli.sh cleanup c23027a4-1b9d-4baf-99f0-8710b7bec851 false 2>/dev/null| grep Number

2018-04-17_11-28-21.png

 

 



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s