Cleanup Failed Cluster Deployment (TKG/TCE)
Updated: Jan 28
I was recently deploying a management cluster in my TCE lab, and the deployment failed:
Running the tanzu management-cluster delete command will normally cleanup the deployment, deleting the TCE VM`s.
But sometimes there are leftover objects inside the Tanzu system that do not get deleted and its a good idea to clean these up after a failed deployment. This will limit garbage objects and clutter that could cause confuse administration in the long term. The output above shows some kubectl commands that you can run to debug the k8s side of things.
You can use this to view the KIND bootstrap cluster kubectl event logs:
kubectl get events -n tkg-system
1.) Delete the failed deployment
tanzu management-cluster delete
2.) Find and Delete KIND Clusters
TCE creates a KIND cluster initially and then uses that to bootstrap the management cluster deployment. Locate and delete these.
kind get clusters kind delete cluster --name tkg-kind-c7labdi4nsfn9a8vdl90
3.) Remove all containers
docker rm -f $(docker ps -aq)
4.) Remove all container images
docker rmi -f $(docker images -aq)
5.) Remove all orphaned volumes
docker system prune --all --volumes -f