Home of @CodeCleric
There is where I post random tech stuff. Enjoy!
From MicroCeph to Longhorn on K8s - Walkthrough
complications
Ubuntu 25.04 is coming out on April 17th, 2025, and you can’t upgrade from 24.04 to 25.04 without going through 24.10. Unfortunately, you have to do both upgrades. Should I do that now? Might as well… sigh…
Nope, holding off on the upgrade for a bit.
Alrighty, so here is my plan for doing this:
Choose and set up Hardware
Ok, I had three boxes setup as nodes in a docker swarm. I’m leaving one as a single swarm node for some legacy code running on it, and converting the other two to k8s workers, and adding 2TB each external ssds (with enclosures).
From MicroCeph to Longhorn on K8s - Background
K8s, storage, and resiliency
When I decided to build a home lab using k8s, I used MicroK8s in a snap on Ubuntu 24.04. I could have used other distros and other kubernetes distributions, installed with kubadm, K3s, rancher, minikube, etc.
Since I chose Microk8s, supported by Canonical, the install and basic admin were trivial. Microk8s has a bunch of Addons, such as a registry, CoreDNS, helm, cert-manager, etc.
These have worked OK. I have been disappointed with the documentation for some of the addons, while others have been fine. A lot of it depends on whether you need customization rather than the defaults. For example, I already have a Let’s Encrypt account for a number of domains, and while I can reference the cert-manager documentation for how to integrate the existing account, that isn’t mentioned in the addon docs. It’s fine, really, just not as complete as I would prefer. It is open source, so if I have an issue, I can pitch in and help.
Resurrecting languishing LXC instances
I had a number of LXC instances running various services on a 3-node docker swarm. Through various and sundry misadventures, that swarm was displaced from it’s original context and wound up at my house. Did I mention it used to be a 5-node swarm? On a different subnet?
Well, I got the swarm part working again and a couple of the LXC nodes I cared about. Then I started a new job, and kind of let it all go.
Python is not so slow
Here is a good article about the topic: The Speed of Python: It Ain’t That Bad!.
I wholeheartedly agree with the article - Python is implemented in C, with a module system that allows C libraries and code to be used in a given module. If you benchmark Python using numerical computation, but don’t allow numpy or some other C library for optimized computation, you are being disingenuous.
Python’s string manipulation routines are also implemented in C, but a user doesn’t have to install that as a separate module. It’s not an argument against Python to use the Python ecosystem when you need to optimize for performance.
CLI movie conversion with ffmpeg
.mov to mp4
ffmpeg -i my-video.mov -vcodec h264 -acodec mp3 my-video.mp4
Any to any
ffmpeg -i inputVideoName.mkv -c:v copy -c:a copy outputVideoName.mp4
This keeps the audio and video codec whatever it was.