Deploying a simple node app to K3s (And Everything That Broke)
Introduction
Today I spent five hours learning K3s on my Raspberry Pi. Nothing worked at first, and honestly... I like it that way.
I'm a full-stack dev that primarily focuses on Node and React in my day-to-day job. We use AWS and some Jenkins pipelines to deploy our apps, and they work pretty well for our use case. Unfortunately, that means that there hasn't been much room lately to learn about any other deployment technologies.
Today, I decided to get elbow deep into Kubernetes by breaking my way to victory on a small Raspberry Pi 3+.
The path to victory is paved in the blood red of error messages
"Breaking my way to victory" could really be my mantra for learning software engineering, and it's really exactly what happened. I pulled that poor unsuspecting little pi out of my closet, plugged it into my keyboard and monitor, and tried running an install for a small Kubernetes distribution, K3S, on it.
"Couldn't get the current server group api list: The server is currently unable to handle the request"
Joyous day. Well, that didn't start up. So I checked to see if K3s was running, and this is the status I got.
"Status: Starting"
Ok, so I'm not the most patient person in the world. I may have expected my tiny Pi to start up in a matter of seconds and immediately run the command. I head off and fix myself a nice cup of cold brew and come back to the little guy—same status.
I take a peek at the journal and see the error popping up in the terminal.
"Failed to create listener, failed to listen on 127.0.0.1:6444 says address already in use"

So. I'm a curious guy, and might have tried installing K3s on this previously? Apparently, the state persists between installs, even after I had the Pi unplugged for months. Just to be safe, I run the uninstall. Definitely nothing on there is important.... I think?
Make a quick YAML file for pulling the Docker container in and a service file to expose.
We hang on this message for 5 minutes
[INFO] systemd: starting k3s

I did a quick memory check on the PI and discovered that I had like 220 Mi actually available on it, which was the real culprit. It turns out that, even though K3s is supposed to be a lightweight distribution (the reason I picked it), it still requires at least 512MB RAM to run.
Ok so burn it all to the ground and start from scratch on the pi? Yep burn it to the ground. For those of you who don't know, Raspberry Pi has a nice little imager where you can get some lightweight OS to run on your PI. Just hop on that bad boy, install the lite version, configure ssh, network settings, etc and you're right as rain!

One more time!
time="2025-11-08T19:16:15Z" level=fatal msg="Error: failed to find memory cgroup (v2)"
After some furious searching about what on earth cgroups are. It turns out that they are the way is. Turns out they are the way that Linux limits/tracks resource usage for specific processes. The reason k3s needs it is because it uses it to enforce memory/CPU limits on the containers. Ok, enable them and reboot.

Boom, we are in business. Test a deployment....
Unable to read /etc/rancher/k3s/k3s.yaml, please start server with --write-kubeconfig-mode or --write-kubeconfig-group to modify kube config permissions
error: error loading config file "/etc/rancher/k3s/k3s.yaml": open /etc/rancher/k3s/k3s.yaml: permission denied
Permissions, I can do that.

AND it ran a simple nginx app 😄

Ok we in this, now just needed to dockerize a basic express app:

Make a quick yaml file for pulling the Docker container in and a service file to expose.


Apply those two yaml files:

Ok, so when you get all your ducks in a row, make sure all the permissions are set up, make sure you have enough memory, and finally deploy your thing... Kubernetes is pretty easy to at least get started.
Conclusion
I like Kubernetes and fiddling around on my little Raspberry Pi. Five hours later, I still like it, actually. I learned more about debugging K3s failures than I would have by scanning through the documentation on my own, and I gained a little insight into the true limitations of my hardware.
Why did I spend a Saturday fighting with my Raspberry Pi and K3s? I want to learn and eventually build developer tools, not just some front-end features using React (although I am very grateful for my job), but rather the infrastructure that makes deploying easier. I want to learn more about the magical black boxes I click a button on every day that launch my apps to the world, and maybe learn how to build them myself. My goal is to move beyond just writing app code and understand the things they are running on. This was just one step towards that. I need to learn about other technologies that surround deployment next. Maybe Terraform. CI/CD pipelines, and actually building something that makes deployment easy for myself.