Enter MicroK8s, a tool by Canonical (the company behind Ubuntu) that enables you to easily deploy a lightweight, multi-node Kubernetes cluster in your local environment.
Every developer, systems admin and tech enthusiast is interested in learning Kubernetes. It is a complex container orchestration tool that can be overwhelming for beginners. Designed as a minimal conformant Kubernetes, MicroK8s installs and clusters with a single command.
What is MicroK8s?
Above all, MicroK8s is a powerful, lightweight, reliable production-ready Kubernetes distribution. It is the smallest, fastest multi-node Kubernetes. Single-package fully conformant lightweight Kubernetes that works on Linux, Windows and Mac. Perfect for developer workstations, IoT, Edge, CI/CD.
MicroK8s is an enterprise-grade Kubernetes distribution that has a small disk and memory footprint while offering carefully selected add-ons out-the-box, such as Istio, Knative, Grafana, Cilium and more. Whether you are running a production environment or interested in exploring K8s, it will serves your needs.
Why use it?
So, anyone who’s tried to work with Kubernetes knows the pain of having to deal with getting set up and running with the deployment. Therefore if you don’t want to spend time jumping through hoops to get Kubernetes up and running, MicroK8s gets you started in under 60 seconds.
- Small: Developers want the smallest K8s for laptop and workstation development. MicroK8s provides a standalone K8s compatible with Azure AKS, Amazon EKS, Google GKE when you run it on Ubuntu.
- Simple: Minimize administration and operations with a single-package install that has no moving parts for simplicity and certainty. All dependencies and batteries included.
- Secure: Updates are available for all security issues and can be applied immediately or scheduled to suit your maintenance cycle.
- Current: MicroK8s tracks upstream and releases beta, RC and final bits the same day as upstream K8s. You can track the latest K8s or stick to any release version from 1.10 onwards.
Comprehensive: MicroK8s includes a curated collection of manifests for common K8s capabilities and services:
- Service Mesh: Istio, Linkerd
- Serverless: Knative
- Monitoring: Fluentd, Prometheus, Grafana, Metrics
- Ingress, DNS, Dashboard, Clustering
- Automatic updates to the latest Kubernetes version
- GPGPU bindings for AI/ML
- Cilium, Helm and Kubeflow!
How to install MicroK8s
You will need a computer with a Linux distribution that supports snaps such as Ubuntu. If you have a Windows PC or a Mac, you can use the corresponding MicroK8s native installers.
sudo snap install microk8s --classic
As a result in under 60 seconds you should have your distribution up and running.
2. Start MicroK8s and check the status
sudo microk8s start microk8s status
MicroK8s includes a kubectl command:
sudo microk8s.kubectl get nodes sudo microk8s.kubectl get services
User access without sudo
The microk8s user group is created during the snap installation. Users in that group are granted access to microk8s commands. To add a user to that group:
sudo usermod -a -G microk8s <username>
MicroK8s installs a barebones upstream Kubernetes. Additional services like DNS and the Kubernetes dashboard can be enabled using the microk8s enable command:
sudo microk8s enable dns dashboard
Installing the sample application
For example we’ll use NGINX as a sample application. It will be installed as a Kubernetes deployment:
sudo microk8s.kubectl create deployment nginx --image=nginx
To verify the installation, you can run the following:
sudo microk8s.kubectl get deployments sudo microk8s.kubectl get pods
Microk8s vs Minikube
Doesn’t Minikube already allow me to do just this?
Yes, but with one key difference. While Minikube usually spins up a local virtual machine (VM) for the Kubernetes cluster, MicroK8s were designed for Linux and does not require a VM. It uses snap packages, an application packaging and isolation technology.
This difference has its pros and cons. One of the first factors is cross-platform portability. While a Minikube VM is portable across operating systems – it supports not only Linux, but Windows, macOS, and even FreeBSD. Microk8s requires Linux, and only on those distributions that support snaps. Most popular Linux distributions are supported.
Another factor to consider is resource consumption. Since Microk8s doesn’t require spinning up a virtual machine you’ll have more resources to run your workloads and other applications. In addition to, you can even use it to install Kubernetes on Raspberry Pi.