Skip to main content

README Highlight Friday #38, 2023: K3s

In this week’s issue of README Highlight Friday, we are taking a look at K3s, a lightweight Kubernetes distribution that is production-ready, easy to install, and consumes half the memory of upstream Kubernetes. The binary size of K3s is less than 100 MB, making it a great choice for edge computing, IoT, CI/CD, development, ARM-based systems, and situations where a deep understanding of Kubernetes is not feasible.

K3s is fully conformant with Kubernetes and includes several changes to improve its performance and simplicity. It is packaged as a single binary and supports sqlite3 as the default storage backend, with options for etcd, MySQL, and PostgreSQL as well. K3s wraps Kubernetes and other components in a single launcher, making it secure by default with reasonable defaults for lightweight environments. It has minimal OS dependencies, requiring only a sane kernel and cgroup mounts.

The distribution bundles several technologies together, including Containerd and runc as container runtimes, Flannel for CNI, CoreDNS for DNS, Metrics Server for resource monitoring, Traefik for ingress, klipper-lb as an embedded service load balancer provider, kube-router for network policy, helm-controller for deploying helm manifests, Kine as a datastore shim, and local-path-provisioner for provisioning volumes using local storage. In addition, K3s includes host utilities such as iptables/nftables, ebtables, ethtool, and socat.

K3s simplifies Kubernetes operations by managing TLS certificates, the connection between worker and server nodes, and auto-deploying Kubernetes resources from local manifests in real-time. It also has plans to manage an embedded etcd cluster in the future.

K3s is not a fork of Kubernetes but a distribution that aims to remain as close to upstream Kubernetes as possible. It maintains a small set of patches, important to its use case and deployment model, while contributing changes back to upstream projects whenever possible.

The lightweight and smaller size of K3s is achieved by running many components inside a single process, reducing memory overhead. The binary size is further reduced by removing third-party storage drivers and cloud providers that can be replaced with out-of-tree alternatives like CSI and CCM.

K3s follows the release cadence of upstream Kubernetes, with patch releases being released within one week, and new minor releases within 30 days. The versioning of K3s corresponds to the version of upstream Kubernetes being released, with additional postfixes for making releases using the same version while remaining semver compliant.

For documentation and installation, users can visit the official docs site for complete information. K3s can be easily installed using the install.sh script, which downloads K3s and adds it as a service. The script also installs additional utilities such as kubectl, crictl, k3s-killall.sh, and k3s-uninstall.sh. Alternatively, users can manually download the K3s binary and run the server.

Contributions to K3s are welcome, and interested individuals can check out the contributing guide for more information. Security issues in K3s can be reported by sending an email to [email protected].