K3s CPU Usage Bug Still Plaguing the Project

K3s is plagued by a CPU usage bug that the project can't seem to shake.

K3s CPU Usage Bug Still Plaguing the Project
Photo by Growtika / Unsplash

K3s is a lightweight Kubernetes distribution that can be used to run Kubernetes clusters on a variety of devices, including embedded systems, edge devices, and personal computers. It is a popular choice for small and medium-sized businesses that are looking for a cost-effective and easy-to-use way to run Kubernetes.

However, k3s is plagued by a CPU usage bug that the project can't seem to shake.

A year ago I wrote about a problem where an idle k3s cluster will gradually increase its cpu use over time. I was able to repeat this problem in both versions 1.21 and 1.22.

Now that it has been some time and  a couple new versions have been released, I wanted to go back and test it out again.

I spun up a fresh Debian VM and installed k3s 1.25.7 and let it idle for a day.

Unfortunately, history repeated itself.

I observed the exact same pattern. The idle CPU use of the k3s node started at about 8% and seemed to increase about 1% per day.

CPU use of an idle k3s cluster over about 2 days. Ignore the spike. I was playing with it then.

I love the idea of running a lightweight k3s distribution. Nothing I am running in my homelab requires a full scale kubeadm-instantiated k8s cluster.

But the existence of this CPU-use bug negates the whole point of the lightweighted-ness of k3s. And this bug is truly unique to k3s. I have a VM running a k8s cluster as well on the same hypervisor and its CPU use stays consistent for weeks on end.

Its really disappointing this remains an issue.

High CPU and Memory Load on single node k3s cluster · k3s-io/k3s · Discussion #5769
HI, i have an ubuntu 20.02 machine, which has k3s installe. After installing rancher, the memory and cpu consumption of the k3s service is skyrocketing. versions: “Ubuntu 20.04.1 LTS” - export INST...