K3S: pico Kubernetes distribution for IoT

Kubernetes Logo
Kubernetes Logo

Kubernetes has revolutionized the way to manage containerized workloads at scale. Kubernetes is the perfect tool when you need to scale horizontally, but what happens when you run Kubernetes on a 1GB RAM node? Things start to get cramped. Meet K3s, a tiny Kubernetes distribution optimized to run on IoT or Edge devices.

About K3S

K3s is “5 less than K8s”, a lightweight Certified Kubernetes Distribution. It is a relatively new (2019) distribution made by Rancher Labs (the developers behind Rancher). K3s has a pretty low footprint:

  • Linux 3.10+
  • 512 MB of ram per server
  • 75 MB of ram per node
  • 200 MB of disk space
  • x86_64, ARMv7, ARM64

As you can see it is pretty tiny, and it has very low requirements. Most importantly it runs on ARMv7 and ARM64 (ARMv8/AArch64): this means it also runs fine on a Raspberry Pi!

What do I get? What do I leave?

As you might’ve guessed, K3s weightlessness comes at a cost, here’s a list of what’s missing compared to a standard Kubernetes distribution:

  • Legacy and non-default features
  • Alpha features
  • In-tree cloud providers
  • In-tree storage drivers
  • Docker (optional)

K3s also has a few additional features out of the box:

  • Simplified installation
  • SQLite3 support in addition to etcd
  • TLS management
  • Automatic Manifest and Helm Chart management
  • containerd, CoreDNS, Flannel

How to get started

K3s is incredibly easy to install and use. Provided you have the needed requirements and an operating system up and running you can simply do:

$ curl -sfL https://get.k3s.io | sh -

This will install the K3s release, install a uninstall script, and create, start and enable a systemd unit.

After a few minutes you may do the following to check the node:

$ k3s kubectl get node

Add another node

$ sudo k3s agent --server https://myserver:6443 --token ${NODE_TOKEN}

You can get NODE_TOKEN from /var/lib/rancher/k3s/server/node-token on your master node (K3s server).

Image courtesy of mark | marksei
mark

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.