Skip to main content

K3s Kubernetes

Uninstall

Uninstall and clean up

There comes a time when you break the Kubernetes beyond repair. So, we are going to clean up and start anew.

Worker nodes

Assuming you have Ansible set up same as we installed K3s using this guide: Nodes setting

Run following to remove Kubernetes from worker nodes:

ansible workers -b -m shell -a "/usr/local/bin/k3s-agent-uninstall.sh"

Master nodes

ansible control -b -m shell -a "/usr/local/bin/k3s-uninstall.sh"

Storage cleanup

Remove all files from /storage<number>:

ansible all -b -m shell -a "rm -rf /storage01/*"