K3s Lightweight Kubernetes Distribution Targets Low Resources x86 and Arm Platforms

Kubernetes (K8s) is described as a “portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available. Google open-sourced the Kubernetes project in 2014”.

However, as Rancher Labs’ CEO Sheng Liang explains “existing Kubernetes distributions are often memory intensive and overly complex for edge computing environments”, so the company developed and launched K3s, a lightweight Kubernetes distribution designed for developers and operators looking for a way to run Kubernetes in resource-constrained x86, Armv7-A and 64-bit Armv8-A hardware platforms often found in edge computing environments, as opposed to the cloud.

k3s
Click to Enlarge

Rancher Labs managed to reduce the footprint of Kubernetes, and better adapt it to entry-level hardware by taking four main steps:

  • Removing old and non-essential code – Alpha functionalities, all non-default admission controllers, in-tree cloud providers, and storage drivers are disabled by default, opting instead to allow users to add in any drivers they need.
  • Consolidating the packaging of running processes – In order to conserve RAM, the processes that typically run on a Kubernetes management server were combined into a single process, including the Kubelet, kubeproxy and flannel agent processes.
  • Using containerd instead of Docker – Switching to containerd, and removing functionality like libnetwork, swarm, Docker storage drivers and other plugins, Rancher managed to reduce the runtime footprint significantly.
  • Introducing SQLite as an optional datastore – Rancher added SQLlite as optional datastore in K3s to provide a lightweight alternative to etcd.

This results in an easy to install, lightweight Kubernetes distribution with a binary of less than 40 MB, requiring only 512 MB of RAM for the server to run, 75MB RAM per node, and Linux 3.10 or greater.

One company with a specific use case was Goldwind Smart Energy which manages more than 30,000 wind turbines, and K3s allow them to deploy Kubernetes clusters on thousands of edge locations.

Instructions to install K3s on Raspberry Pi can be found in Medium, but basically if you already have a configured images for your board, all you have to do is to run:


Which should automatically install K3s for your architecture (amd64, armhf, or arm64). You’ll also find further details on the official website and K3s github repo.

To run the server:


and one agent:


Where NODE_TOKEN comes from /var/lib/rancher/k3s/server/node-token
in the server.

K3s was also demonstrated at FOSDEM 2019 as part of the talk entitled “CI/CD for embedded development with an ESP8266, Arduino-cli, Gitlab-ci, Raspberry Pi, and Kubernetes“.

Thanks to Zoobab for the tip.

Share this:

Support CNX Software! Donate via PayPal or cryptocurrencies, become a Patron on Patreon, or buy review samples

Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
3 Comments
oldest
newest
Advertisements