MicroK8s Kubernetes Single Node Cluster

Prasanta Kumar Mohanty
2 min readMar 29, 2020

What is MicroK8s?

MicroK8s is a CNCF certified upstream Kubernetes deployment that runs entirely on your workstation or edge device. Being a snap it runs all Kubernetes services natively (i.e. no virtual machines) while packing the entire set of libraries and binaries needed. Installation is limited by how fast you can download a couple of hundred megabytes and the removal of MicroK8s leaves nothing behind.

What you need to Install ?

A Linux machine

Deploying microK8s

If you are using Ubuntu follow the below steps and you will see all the nodes and services running for you

sudo snap install microk8s --classic --channel=1.17/stable
sudo usermod -a -G microk8s $USER
su - $USER
microk8s.status --wait-ready
microk8s.kubectl get nodes
microk8s.kubectl get services
Open the firewalls sudo ufw allow in on cni0 && sudo ufw allow out on cni0
sudo ufw default allow routed

Host your first service on microK8s

Deploy microbot with 2 pods 
microk8s.kubectl create deployment microbot --image=dontrebootme/microbot:v1
microk8s.kubectl scale deployment microbot --replicas=2
expose the deployment with nodeport
microk8s.kubectl expose deployment microbot --type=NodePort --port=80 --name=microbot-service
get all namespaces
microk8s.kubectl get all --all-namespaces
you will get something like this
default service/microbot-service NodePort 10.152.183.12 <none> 80:31421/TCP 10m

Check if the service is working ?

open any browser and type http://localhost:31421 , you should see the below image with pod detail

--

--

Prasanta Kumar Mohanty

Engineering | SRE | Highly distributed scalable architecture