How to completely uninstall kubernetes
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
There is no single universal "uninstall Kubernetes" command because the correct cleanup depends on how Kubernetes was installed. A kubeadm-based cluster on Linux is removed differently from Minikube, kind, k3s, or a managed cloud cluster.
If your goal is a true reset on a self-managed node, the job usually has three parts: reset cluster state, remove packages and configuration files, and clean up the container runtime or CNI artifacts left behind.
Identify the Installation Type First
Before deleting anything, confirm what you are uninstalling.
Common cases:
- kubeadm on Linux nodes
- Minikube on a local workstation
- kind clusters running in Docker
- k3s or MicroK8s distributions
- managed clusters such as EKS, GKE, or AKS
The commands are different. For example, deleting an EKS cluster is a cloud control-plane operation, not a matter of wiping /etc/kubernetes on your laptop.
For a self-managed kubeadm node, this is the usual starting point.
Reset a kubeadm-Based Node
The safest first command is kubeadm reset.
That removes much of the cluster state from the node, including certificates and static pod manifests that kubeadm created.
After the reset, stop the kubelet and remove Kubernetes packages if you do not plan to reinstall immediately.
On RPM-based systems, use the equivalent package manager instead.
Remove Residual Configuration and State
Package removal does not clean everything. Kubernetes leaves state in several directories.
You may also want to remove CNI state if you are trying to return the machine to a clean pre-cluster condition.
Be deliberate here. These paths may contain state you would want if you planned to recover the cluster instead of destroying it.
Clean Up Networking and Runtime Artifacts
Kubernetes installs networking rules and depends on a container runtime. After uninstalling the cluster, stale interfaces and iptables rules can remain.
Depending on your setup, you may need to restart the runtime or remove leftover bridges manually.
If you used Docker-backed local tooling such as kind, the cleanup path is different.
Local Development Variants
For Minikube, use the tool's own cleanup command:
For kind, delete the cluster through kind itself:
For k3s, use the packaged uninstall script:
For MicroK8s:
These distributions install extra components and paths that generic kubeadm cleanup commands will not always remove correctly.
Verify That the Node Is Clean
A quick verification pass helps avoid partial uninstalls.
If kubectl is still present, that may simply mean the binary remains installed, not that the cluster still exists. Check both packages and directories.
On a machine meant for reinstallation, it is also useful to verify swap, container runtime configuration, and networking state before starting over.
Common Pitfalls
The biggest mistake is assuming every Kubernetes installation can be removed the same way. It cannot.
Another common issue is skipping kubeadm reset and only deleting packages. That often leaves behind certificates, manifests, and kubelet state that interfere with a later reinstall.
People also forget CNI and networking artifacts. Even when the control plane is gone, stale network configuration can cause confusing behavior on the next cluster bootstrap.
Finally, do not delete data directories blindly on a machine that still matters operationally. rm -rf /var/lib/etcd is correct for destruction, but disastrous if you still needed the cluster state.
Summary
- Uninstall steps depend on whether you used kubeadm, Minikube, kind, k3s, MicroK8s, or a managed service.
- For kubeadm nodes, start with
kubeadm reset -f. - Remove packages and then delete leftover configuration and state directories.
- Clean up CNI and container runtime artifacts if you need a true reset.
- Use tool-specific uninstall commands for local Kubernetes distributions.
- Verify the node state after cleanup before reinstalling or repurposing it.
Related reading
- How to completely uninstall Minikube in windows 10 Pro? chocolatey
- How to config simple login/pass authentication for kubernetes desktop UI
- How to configure a Kubernetes Multi-Pod Deployment
- How to configure a non-default serviceAccount on a deployment
- How to configure Apache Tika in a kube environment to obtain maximum throughput when parsing a massive number of documents?
- How to configure custom themes for keycloak on kubernetes
- How to configure external IP address of minikube dashboard?
- How to configure fluentd daemonset for RBAC

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.