Chibang - A GitOps-Managed Home Server for Kubernetes
The Beginning
Chibang is my home server. It stores household backups and files, and it is also where I run virtual machines to learn Kubernetes.
It started on Fedora CoreOS, an operating system that updates itself and cannot be changed by accident. I chose it because I like systems that look after themselves. But setting it up was a series of commands typed over SSH, and none of it was written down.
The Problem
There were two problems, and both were about risk.
The first was recovery. If the boot drive failed, rebuilding the server meant remembering what I had done months earlier. Every change made by hand was a change that could be lost.
The second was where Kubernetes lived. To learn it, I had added k3s to the server itself and was running AI models on it with a GPU. It worked, but the experiment now shared a machine with my backups. One bad change to the cluster could take my storage down with it.
I wanted a server that could be rebuilt from a written record, and a Kubernetes environment that could break without touching my data.
Keeping the Data Safe
Protecting data is the most important job of Chibang, so that came first. The storage pool uses ZFS, which checks the data it reads and can repair corruption from the mirrored disks. Backups go to a restic repository on the pool and are replicated offsite to a MEGA S4 bucket every night.
I built on uCore, a version of Fedora CoreOS that already includes ZFS and the backup tools, so I do not have to maintain them myself.
Giving Kubernetes Its Own Space
I considered moving everything to Talos Linux, an operating system built only for Kubernetes. But then reaching my backups would depend on the cluster being healthy.
Instead, I removed k3s from the server and now run Kubernetes in Talos virtual machines on top of it. The server stays focused on storage and backups. The cluster can be experimented with, broken or rebuilt without touching the pool.
This separation was deliberate. It mirrors how enterprises keep storage and compute apart, and that is the pattern I wanted to practise. The virtual machines are defined as code in a separate repository, so they are recreated the same way every time.
Managing the Server From Git
To solve the recovery problem, the whole setup of the server now lives in Git. GitHub Actions turns it into a complete operating system image every time I make a change, and once a day to pick up upstream updates. Each image is digitally signed.
The server only accepts an image that carries my signature. It prepares each update in the background and switches over when I restart it. The previous version is kept, so going back is one command.
Nothing in the image is tied to one machine, and no passwords are stored in it. The same setup works on new hardware or in a test virtual machine.
Challenges
One mistake showed why checks matter. I introduced a conflict between two startup services, and the server booted into a state where I could not reach it. The fix was small, but the lesson was not: a broken image should never reach the server.
Now every build is checked for that kind of conflict before it is published. It does not catch every problem, but it catches this one before it can cause an outage.
Results
Rebuilding Chibang no longer depends on memory. A reinstall is one install command pointing at its configuration, then one script to restore the passwords. Every change is recorded in Git, and every running version can be traced back to the change that produced it.
Updates are verified before they are accepted, applied when I choose, and can be undone with one command. Kubernetes can break, or be rebuilt from scratch, without putting the backups at risk.
The technical details, including how the image is built, signed and installed, are in the README at github.com/edy-rus/chibang.
What I learned: An immutable operating system prevents some kinds of drift, but it does not make a system declarative by itself. The important change was making Git the place where changes begin, and giving Kubernetes its own space, where an experiment can no longer reach my backups.
