Follow the procedure mentioned in this topic to uninstall the Kubernetes cluster.

Procedure

  1. Log in to the deployment host.
  2. Download the deployment container image bundle from My Downloads on to the deployment host under the $HOME directory. The package is named as VMware-Deployment-Container-<VERSION>-<TAG>.tar.gz. For example, VMware-Deployment-Container-2.4.1-167.tar.gz.
    Note: To verify the downloaded package, run the following command on your deployment host.
    $ sha256sum VMware-Deployment-Container-<VERSION>-<BUILD_ID>.tar.gz
    This command displays the SHA256 fingerprint of the file. Compare this string with the SHA256 fingerprint provided next to the file in the My Downloads site and ensure that they match.
    # To load the docker image, execute the following command on the deployment host.
    $ docker load -i <dir/on/deployment host>/VMware-Deployment-Container-2.4.1-167.tar.gz
    
    # Verify the deployment container image on deployment host by executing the following command.
    $ docker images
  3. Launch the Deployment Container as follows:
    docker run \
                 --rm \
                 -v $HOME:/root \
                 -v $HOME/.ssh:/root/.ssh \
                 -v $HOME/.kube:/root/.kube \
                 -v /var/run/docker.sock:/var/run/docker.sock \
                 -v $(which docker):/usr/local/bin/docker:ro \
                 -v $HOME/.docker:/root/.docker:ro \
                 -v /etc/docker:/etc/docker:rw \
                 -v /opt:/opt \
                 --network host \
                 -it projects.registry.broadcom.com/tcx/deployment:2.4.1-167
                 bash
  4. Run the following export command within the container:
    export ANSIBLE_CONFIG=/root/k8s-installer/scripts/ansible/ansible.cfg
  5. Run the cleanup.yaml playbook inside the Deployment Container.
    cd /root/k8s-installer/
    ansible-playbook  -i inventory/<your-cluster-name>/hosts.yml scripts/ansible/cleanup.yml -u <your-SSH-username> --become -e @scripts/ansible/internal_vars.yml -e @scripts/ansible/vars.yml
  6. Once the cleanup is initiated, there will be a prompt to confirm cluster reset. Enter yes to proceed with the cleanup.
    Are you sure you want to reset cluster state? yes
  7. Reboot all the Cluster Node VMs (Control Plane and Worker Node VMs).
  8. After reboot, login to the ControlNode VM and run the below command:
    kubeadm reset
    Note:
    • Once the Ansible cleanup script exists, verify that there are no failure message. Also verify that the "failed=0" message is displayed for all the cluster nodes.
    • There will be some fatal messages which will be displayed on the console and ignored by the Ansible script during execution. These messages does not have any functional impact and can be safely ignored.