RHEL / Centos
$ docker container prune
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
$ systemctl stop kubelet
$ systemctl stop docker
$ find /var/lib/kubelet | xargs -n 1 findmnt -n -t tmpfs -o TARGET -T | uniq | xargs -r umount -v
$ rm -r -f /etc/kubernetes /var/lib/kubelet /var/lib/etcd
$ kubeadm reset
$ iptables --flush
$ sudo rm -rf ~/.kube
# Reboot A Server
$ systemctl start docker
$ systemctl enable --now kubeletCode language: PHP (php)
Ubuntu
$ kubeadm reset
$ sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
$ sudo apt-get autoremove
$ sudo rm -rf ~/.kube
Code language: JavaScript (javascript)
How to remove or cleanup kubernetes worker nodes in Centos 7?
How to remove or cleanup kubernetes worker nodes in Ubuntu?
$ kubeadm reset
$ sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube*
$ sudo apt-get autoremove
$ sudo rm -rf ~/.kubeCode language: JavaScript (javascript)
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals