How do I kill microk8s kubernetes?

12/4/2021

I took a course a while ago on Kubernetes. I used my Ubuntu 20.04.3 LTS laptop to set up the environment for educational purposes.

I used microk8s as my Kubernetes distribution.

I recently noticed that there were the following processes using about 1/2 GB of memory:

kube-apiserver
kube-controller
kubelet

They are all running as root.

This is their specific version information.

Client Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.13-35+005120472f128e", GitCommit:"005120472f128ee37994ebbe34eb340d4a580a95", GitTreeState:"clean", BuildDate:"2021-11-18T08:25:58Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.13-35+005120472f128e", GitCommit:"005120472f128ee37994ebbe34eb340d4a580a95", GitTreeState:"clean", BuildDate:"2021-11-18T08:26:57Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}

I tried to kill the processes by using the following method:

sudo kill -9 {pid}

However, the processes came back!

How do I kill a microk8s kubernetes cluster? I do not care about retaining any data and I do not want the cluster to restart on boot.

-- Campbell Hutcheson
kubernetes
microk8s
ubuntu

1 Answer

12/4/2021

You can remove the microk8s using following command in ubuntu:

sudo snap remove microk8s

The above command should remove all the services from your laptop.

-- Prafull Ladha
Source: StackOverflow