So I've been running 2 Octoprint instances to manage my printers for ~2.5 years. I've been also running Kubernetes cluster at home on some Raspberry Pis as my main platform for home automation and home projects for some time now. I wanted to migrate all my home services to k8s but I struggled with my 3D printers and migrating Octoprint - since I have to connect to physical devices it seemed like I need to schedule my application to the node where the printer is connected. I didn't like this idea at all so I decided to do something about it
So I started with 3 objectives:
- I wanted to be able to just connect a printer to any usb port of any node in the cluster and the whole setup should just work
- I wanted to be able to schedule my Octoprint instances to any node in the cluster, regardless of where the printer is connected
- I wanted to be able to have as many printers managed this way as I wanted, and adding new device should be as easy as writing 4 lines of configuration yaml.
Well, I think I can share with you "beta" version of my solution.
KubeSerial is a Kubernetes Operator that monitors your cluster nodes looking for your devices, exposes them over the network in the cluster and schedules your Octoprint instance. It can manage as many printers as you like and creates printer setup only when it's connected - so when you're not printing you won't have Octoprint just waiting there occupying your RPi. Each Octoprint instance is started automatically connected to proper printer - so you don't need to remember or test each time which port is for which printer. It also can expose your Octoprint instance through Ingress under specified domain (like
http://ender3.my.home). Take a look at project readme for more examples.
So yeah, I have no idea if anyone will be even interested in this but I though I'll share this as it can make managing multiple printers nice and easy. If anyone is running RPi Kubernetes cluster give it a try and let me know what you think or if you encountered any problems . Install guide is in project readme. Also, if you have some other devices in your workshop (like CNC machines or whatnot) that are managed by software that this could support - I'm open for ideas.