MicroK8s: Big Things Come in Small Packages
Despite Kubernetes’ soaring popularity, the technology isn’t perfect. To reduce the barriers to entry that developers, DevOps engineers, and others have faced with Kubernetes, also known as K8s, Canonical in late 2018 introduced MicroK8s. Let’s take a look at this valuable tool.
Remember the huge container ship that ran aground in the Suez Canal and blocked vessels at both ends of the international waterway for a week in March? That’s what managing software containers might feel like if not for Kubernetes.
It’s fair to say that without open-source Kubernetes and its capabilities for automatically deploying, upgrading, and provisioning apps and services across clouds at scale, we could still be stuck in the old world of monolithic software rather than the modular, flexible paradigm now underpinning digital innovation globally.
Eighty-three percent of 1,324 IT pros who responded to a survey by the Cloud Native Computing Foundation last year said they use Kubernetes to manage their container lifecycle. Yet despite its soaring popularity, the technology isn’t perfect. It can be complex to learn, operate, and maintain.
To reduce the barriers to entry that developers, DevOps engineers, and others have faced with Kubernetes, also known as K8s, Canonical in late 2018 introduced MicroK8s.
Canonical’s Kubernetes pedigree already was strong by that point. The company had released a fully supported, enterprise K8s distribution two years earlier, and its Ubuntu operating system was (and remains) the reference platform for Kubernetes on all major public clouds — Amazon’s EKS, Google’s GKE, and Microsoft’s AKS.
Now, after it had become clear that usability challenges were a fly in the Kubernetes ointment, Canonical wanted to offer a simple way to consume K8s services and tools. From the beginning, MicroK8s was designed as a lightweight, pure-upstream, production-ready Kubernetes distribution enabling developers to get a fully featured, conformant, and secure K8s system running in under a minute.
Two and a half years later, MicroK8s (pronounced “micro-kates”) remains faithful to its original purpose while also maturing into a more full-bodied solution for helping developers be more productive and reduce the notorious operational headaches in configuring, monitoring, and managing Kubernetes clusters.
MicroK8s is now being used in a variety of scenarios, from single-node installation on a developer’s workstation to support of compute-intensive artificial intelligence (AI) and machine learning (ML) workloads. MicroK8s’ low-resource footprint and support for both ARM and Intel architectures make it ideal for the edge, the Internet of Things (IoT), and appliances. MicroK8s is a popular choice on Raspberry PIs.
MicroK8s has proven a valuable tool for DevOps, whether K8s is being used to run tests on a local or a production CI/CD pipeline. All a developer needs to do is build containerized apps on local using MicroK8s with, let’s say Gitlab, then move the apps to the test environment that is also built on another MicroK8s instance, and finally deploy the containers in production. Normally, this multi-step process would demand a great deal of manual configuration. With MicroK8s, it’s all done automatically.
AI/ML pipelines have become another significant use case for MicroK8s. Running Kubeflow – the top ML toolkit for Kubernetes — on top of MicroK8s is as easy as typing “microk8s enable kubeflow”. Similarly, the GPU acceleration needed for model training compute requirements is just a command away.
MicroK8s clusters can be deployed on top of any infrastructure — a laptop, workstation, a cloud virtual machine, or an on-prem server – and is available for Linux, Windows and macOS. It comes in a single package that installs a single-node (standalone) K8s cluster with a single command or can create a multi-node cluster with just a few commands.
MicroK8s has all the Kubernetes core components; in addition, many of the add-ons that one would typically look for in Kubernetes, such as DNS and the Dashboard, also are a single command away.
MicroK8s uses the Snap packaging mechanism, which means that as soon as a new K8s version is available upstream, the MicroK8s cluster will be automatically updated in kind. All available security patches also will be installed automatically.
The idea is that even people with little to no hands-on Kubernetes experience can enjoy a “zero ops experience” – the K8s cluster up and running with a single command, automatic security updates, and the ability to run add-ons without having to worry about configuration (unless, for some reason, manual configuration is preferred).
Features that have been added to MicroK8s during its existence include:
- HA clustering to get a fully resilient K8s cluster by joining three or more nodes to a cluster and have MicroK8s automatically distribute the control plane across the nodes.
- The ability to use Juju, JAAS or Helm to automate operations.
- Ability to use DNS, ingress, Calico, Flannel and Cilium for a project’s networking.
- Ability to use GPU acceleration for AI and ML projects and combine it with Kubeflow as a home edition HPC
- Integration with Istio or Linkerd for service mesh and MetalLb for load balancing.
- Ability to use KNative to write serverless applications
- A full toolbox of logging and monitoring technologies including Prometheus, Grafana, Elastic, Fluentd, Kibana, and Jaeger.
Canonical recently announced the new MicroK8s 1.21 release, which aims to solve problems around K8s memory consumption for affordable devices of small form factors.
The memory footprint was slashed by a whopping 30 percent in single node and multi-node deployments, which helps those looking to build clusters using hardware such as the Raspberry Pi or the NVIDIA Jetson.
MicroK8s also has shed 280Mb of memory. How? Previous versions either packaged all Kubernetes upstream binaries as they were or compiled them in a snap. That package was 218Mb and deployed a full Kubernetes of 800Mb.
In MicroK8s 1.21, the upstream binaries are compiled into a single binary before packaging. That means a lighter package – 192Mb – and, more importantly, a Kubernetes of only 580Mb. So MicroK8s can be used on devices with less than 1Gb of memory and still leave resources for the sort of multiple container deployments required for three-tier website hosting or AI/ML model serving.
MicroK8s is the answer for developers and operators who want to dive into Kubernetes but are scared of the complexities. With MicroK8s, it’s all smooth sailing.