Minikube is very popular and the most known Kubernetes version for local software development. It runs inside a virtual machine like VirtualBox and allows developers to run Kubernetes applications locally. As Docker runs natively just on Linux, you may wonder why do we need virtual machine on Linux? Well, not anymore.
Mac users have no other way of running Docker except in a virtual machine, hidden or visible. However, Linux users should be able to run Docker and Kubernetes over it just on the bare metal. Minikube has possibility to run on Linux without a virtual machine, but as it installs locally in that case, different configuration files get spread over the host system and this is pretty much messy, actually not much different than installing Kubernetes using kubeadm. Fortunatelly, MicroK8s comes as help.
Thanks to snapd, light Linux virtualization layer available on Ubuntu and derivative operating system, you may now install MicroK8s using snap simply by running the following command:
sudo snap install microk8s --classic
To configure kubectl to use this "cluster", you can just run:
To start and stop microk8s, just type:
sudo microk8s.stop sudo microk8s.start
Well, good news for Ubuntu users, but what about Mac? Guess what, there is actually Mac version as well. Still runing in a virtual machine, but at least this virtual machine is lighter than VirtualBox. To install the Multipass on Mac, just download the latest *-Darwin.pkg from here. After that, run the following commands:
multipass launch --name microk8s --mem 4G --disk 40G multipass exec microk8s -- sudo snap install microk8s --classic multipass exec microk8s -- sudo iptables -P FORWARD ACCEPT
You can find more usable multipass commands here.
Besides basic Kubernetes functionality, MicroK8s provides several addons:
dashboard dns fluentd gpu ingress istio jaeger metrics-server prometheus registry storage
You can simply enable some of them using microk8s.enable.
microk8s.enable dns dashboard
multipass exec microk8s-vm -- /snap/bin/microk8s.enable dns dashboard
That's all Kubernatus, happy cube-kuttling.