Microk8s a lightweight locally install kubernetes

I’m very excited to announce a new project with the aim of running a super lightweight, local, kubernetes cluster. While there are some great options today, most rely on virtual machines and lots of workarounds to present a K8S cluster. With microk8s, installing a conformant local cluster and running containers takes a matter of seconds.

microk8s is just over three weeks old as a project but is already in a shape for general testing. As a snap based package it can be installed on most linux machines with just

sudo snap install microk8s --beta --classic
microk8s.enable dns dashboard

My blog post goes into more details on getting started and covers instructions for both Fedora and Ubuntu. The Github README outlines more usage examples and how this package is built.

Finally, we’re thrilled that the latest microk8s conformance report, tested with sonobuoy, shows it passing 139 of the 140 tests! Putting us much closer to our goal of a clean, conformant, k8s cluster for local installs.

Over the next few weeks we hope to clean up the structure, improve user experience, and make microk8s available for Mac OSX as well as Windows. If you’re interested in following along, getting help, or learning more join us in the #microk8s channel on the Kubernetes Slack!

10 Likes

With 1.12 there is now a stable channel open for microk8s, so an install doesn’t need the --beta unless you actually want to be tracking beta releases of k8s.

sudo snap install microk8s --classic

That should be all you need on Ubuntu 18.04 or 16.04. On other distros you may need to install the snapd package first, as per https://snapcraft.io/

Further docs are at https://microk8s.io/

1 Like

Pardon my ignorance but would appreciate if someone could help me understand if the aim / goal of microk8s is different from say kube-spawn ? Or are they different tools with very different aims and purposes but some overlap ?

Microk8s is a lot like the other distributions of Kubernetes (kubespray, minikube, cdk, kops, and many others) in that it will deploy a Kubernetes cluster. Each of these distributions have different goals though. KOPS is a Kubernetes specialized for AWS, kubespray aims to be a general deployer, CDK deploys Kubernetes on virtually any Ubuntu machine, and minikube is for local development.

Microk8s is more similar to minikube than kubespray. It’s designed to make creating a local Kubernetes cluster very simple and fully isolated from your desktop. There are a lot of differences between minikube and microk8s but the main take aways are:

  • microk8s setup takes at most two commands to get running
  • microk8s is lightweight on system resources (no vms required)
  • microk8s is has built in securities to keep your Kubernetes and workloads separate from your laptop
  • microk8s can be un-installed and reset cleanly without any traces (also in one command)

If you’re looking for a local kubernetes, I’d suggest trying out microk8s and minikube. If you’re looking to deploy Kubernetes onto servers or in the cloud I’d check out kubespray and CDK. Each solution is unique in how they handle deployments and choice will really come down to whichever one works best for you.

1 Like

Thanks for the very useful and pertinent answer. Since Microk8 doesn’t require (and by inference use) VMs, I’m wondering if it makes changes to the host OS (I suppose by also needing it to be Linux) that might interfere or contradict OS configuration requirements of the host OS due to some other software – such as other hypervisors installed on the host OS (and their functioning) ?

Also, with the purpose specific distributions of k8s, doesn’t it become challenging for people to move between local testbed (on their development workstation) and the production environment (s.a. AWS), since the provisioning and command/control CLIs change ?

MicroK8s is a snap package of kubernetes. Snaps are nice because they do not touch the filesystem much at all, they are generally well contained. All the k8s code comes in the snap, and if you remove the snap, it’s all gone. There are some networking pieces that need to be setup to allow the containers on top of k8s to talk to one another, but that’s pretty isolated too.

So in general, use microk8s when you want a clean single-machine kubernetes for appliances or development purposes. It works well on a VM on the cloud, or on your laptop. It’s not designed to scale out, use a different distribution like the charmed distribution of kubernetes on Ubuntu or a manual kubeadm deployment if you want a full cluster.

1 Like