Uninstalling Kubernetes
Uninstall Kubernetes only when you will not use the Kubernetes cluster. The uninstallation operation is required on all nodes, including the management and compute nodes.
- Clear the Kubernetes cluster settings.
kubeadm reset
- Uninstall the management component.
yum erase -y kubelet kubectl kubeadm kubernetes-cni
- Delete the configuration directory.
[ -d ${HOME}/.kube ] && rm -rf ${HOME}/.kube [ -d /etc/cni/net.d ] && rm -rf /etc/cni/net.d - View the bridge information of Flannel and CNI and delete the bridges created by the network plugin.
- View the bridge information of Flannel and CNI.
ip a
In the command output, the bridges are flannel.1 and cni0.

- Delete the bridges.
ip link set dev flannel.1 down ip link set dev cni0 down ip link delete flannel.1 ip link delete cni0
- View the bridge information of Flannel and CNI.
- Delete the base component images to uninstall Kubernetes.
Base components are deployed using Docker images. Therefore, you only need to forcibly delete the images to uninstall Kubernetes.
docker rmi IMAGE_ID
IMAGE_ID indicates the ID of the Docker image. You can run the following command to query the ID:
docker images
Parent topic: Kubernetes Deployment Guide (CentOS & openEuler)