Score:0

How to remove kubernetes completely from Ubuntu node

kr flag

We need to completely remove Kubernetes from Ubuntu 18.04 server.

For that we tried

kubeadm reset

sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni kube* 

It gives

Package 'kubeadm' is not installed, so not removed
Package 'kubectl' is not installed, so not removed
Package 'kubelet' is not installed, so not removed
Package 'kubernetes-cni' is not installed, so not removed

If we run kubeadm version

kubeadm version: &version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.3", GitCommit:"ca643a4d1f7bfe34773c74f79527be4afd95bf39", GitTreeState:"clean", BuildDate:"2021-07-15T21:03:28Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

which kubeadm

/usr/local/bin/kubeadm

dpkg -S /usr/local/bin/kubeadm

dpkg-query: no path found matching pattern /usr/local/bin/kubeadm

snap list --all

No snaps are installed yet. Try 'snap install hello-world'

We had installed Kubernetes using no source compiling locally.

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key
add
sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
sudo apt update
sudo apt install kubeadm kubelet kubectl
sudo apt-mark hold kubeadm kubelet kubectl

What is the issue here? How can I properly remove Kubernetes from this node?

moonkotte avatar
in flag
The question is not really about kubernetes because after `kubeadm reset` settings are removed (however some traces can be left). There are different options what can be done with `broken` packages, e.g. [try with dpkg or other options from this answer](https://askubuntu.com/a/438365) or [I've seen it's possible to install them and then remove properly](https://stackoverflow.com/questions/42809946/not-able-to-remove-a-package-completely-in-ubuntu#comment72732818_42809946). Also! Sounds obvious, but nowadays it's much faster to recreate a VM.
Wytrzymały Wiktor avatar
it flag
Hello @SachithMuhandiram. Any updates?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.