How to install MicroK8s Single Node Kubernetes
What is MicroK8s?
MicroK8s is one of the easiest and fastest way to get Kubernetes up and running and start experimenting.
In a lab, testing or home environment using a single node kubernetes can make a lot of sense because of the low hardware overhead. In a production environment, it should not be used and instead a normal kubernetes environment should be deployed with at least 3 nodes. With that said, lets see how to quickly deploy MicroK8s.
The easiest way to install is with Ubuntu, since snaps are natively enabled. An extra step to enable snap is required in other environments for this method.
How to Install MicroK8s on Ubuntu 20 LTS
Step 1: Check OS is up to date
sudo apt update && sudo apt upgrade
Step 2: Disable swap
sudo swapoff -a
comment out any swap entry in /etc/fstab (yes this step could be done with sed, but the syntax changes on differnt versions. So lets use vi to edit /etc/fstab and then insert a hash onto the swap line
sudo vi /etc/fstab
# comment out swap
# UUID=cfc0b054-0ce9-46e5-8616-bbf033c55b0a none swap sw 0 0
Step 3: Install MicroK8s snap
sudo snap install microk8s --classic
add current user to microk8s group
usermod -aG username microk8s
Step 4: Enable any required add-ons
microk8s.enable dashboard
check the status
microk8s status
Summary
Microk8s should now be installed and you are ready to start deploying apps onto it! For further information about the project visit the MicroK8s website.