I could not make sense of this work without research. After three years at CERN, back in Bilbao I decided to work on my own and keep researching and learning. I believe entrepreneurship is the ultimate professional challenge — and, at the same time, an expression of creativity and a claim to freedom.
Zetesis comes from the Greek ζήτησις, inquiry: find the cause before proposing the solution.
The two Kubernetes clusters I described in Which servers I manage and how I run them with GitOps run on Talos Linux, an operating system built only to run Kubernetes: it has no SSH and no package manager, and you manage it through an API. What Talos is and how the work splits between it, Kubernetes and Argo CD is covered in Building a homelab from scratch: Kubernetes and GitOps. This post is about the file each node comes from, what it takes to rebuild one, and two times this way of working got me out of trouble.
As in the previous posts, I do not give machine names, addresses or domains.
You do not log into a Talos node to configure it. It receives a configuration document through its API, via talosctl, the Talos command-line tool, and applies it as a whole. That document is long and carries certificates, so I do not write it by hand: talhelper generates it from a much shorter talconfig.yaml per cluster.
The talconfig.yaml holds the Talos and Kubernetes versions, the disk the system installs to, the node's network and a few patches: Cilium as the cluster network instead of the one Talos ships with, Kubernetes without kube-proxy, and the pod security and API audit policies. To change anything on the node I change that file, generate the configuration with talhelper genconfig and apply it with talosctl apply-config.
Secrets live in the same repository, encrypted with SOPS
Next to each cluster's talconfig.yaml there are two files encrypted with SOPS, a tool that encrypts the values in a YAML file and leaves the field names readable, using age for the encryption. talsecret.sops.yaml holds the cluster's secrets: the keys of its certificates and the tokens its parts use to join. inline-secrets.sops.yaml holds Kubernetes manifests that Talos applies at boot, before anything else exists in the cluster.
talhelper decrypts them when it generates the configuration, with a key that is not in the repository. Only the ciphertext lives in git, and a pull request shows which field changed without showing its value.
The whole node comes out of the repository, Argo CD included
If a node is lost, I rebuild it from the repository. I boot the machine from the Talos image, which waits for its configuration, and apply the one talhelper generates. Talos installs itself to disk, brings up Kubernetes and applies the manifests from inline-secrets: the namespaces for Argo CD and External Secrets, the operator that pulls secrets from Infisical, and the first credentials they need.
Two commands are still manual: installing Cilium and Argo CD with Helm, both with the values kept in the repository. Argo CD cannot start without a network, and Cilium cannot arrive through Argo CD before Argo CD exists. When it is installed, Argo CD creates its root application, which points to the cluster's applications folder, and from there it deploys the rest in order: operators, secrets and applications. Cilium is declared in that folder too, so Argo CD adopts it and manages it from then on.
The node comes from the file; the data, from the backups
What the file does not bring back is the data: the applications' volumes and the PostgreSQL databases. Those have to come back from the backups, which go every night to storage in the other house. How they are made and where they go is in The backups of my servers.
That split is what makes a rebuild possible: nothing lives on the node that is not in git or in a backup. That is why every change goes through the file. One applied only with talosctl, without bringing it into git, would be gone on the next rebuild.
Extensions are declared too
Talos ships the bare minimum, and whatever is missing comes as official extensions. The platform cluster needs two: ZFS, the file system that holds its volumes, and Tailscale, the private network that joins my machines. The extensions go in the talconfig.yaml, in a list talhelper turns into a schematic, the recipe Image Factory understands. Image Factory is the service from Sidero Labs, the company behind Talos, that builds the system image with the extensions you ask for, and the node's install image is pinned in the file as well.
What those extensions need goes in the same file: that the node loads the ZFS module, how the disk is split, with one part for Talos and the rest left raw for the ZFS pool, and the configuration of the Tailscale extension, with its key in another file encrypted with SOPS.
When I changed the node's IP and the tokens stopped working
In July I moved each cluster to its own network, apart from the home network, which meant changing the nodes' IPs. The change was in the file: the new address and the certificates that had to accept it. What I did not expect was every Kubernetes service account token to stop working at once.
The cause is in how Talos sets up the Kubernetes API. The issuer of those tokens, the field that says who signed them, is derived from the cluster's address, and that address was the node's IP. With the new IP the issuer changed, and the API started rejecting the old tokens. Argo CD, Cilium, External Secrets and the PostgreSQL operator lost access to the API and began to fail.
I made it worse by trying to pin the old issuer with an extra argument to the Kubernetes API, which Talos already manages: the API stopped starting. For about ten minutes there was no Kubernetes API, but the Talos one kept answering, because it is a separate service. Through it I put the node back on the previous configuration with talosctl apply-config, without a console, and once the Kubernetes API was back I restarted the controllers so they would request new tokens.
The procedure is now written down in the repository: before changing a node's IP, add the new one to the certificates, apply the change in try mode, which rolls back by itself if the node loses its network, and restart the controllers afterwards.
When production rebooted every 15 hours
In late August, the production cluster started rebooting entirely and without warning, roughly every fifteen hours: six times in nine days, four of them in the last sixty hours. Every reboot took down the website, the login and everything else running on that cluster.
The clue was in the kernel log, which I read with talosctl dmesg, through the same API. When Cilium loaded its eBPF programs, the kernel's verifier, the part that checks those programs before running them, hit an internal error. The node is set to reboot on a serious kernel error, so every time the bug fired, the node started over.
It was a known kernel bug, already fixed: the kernel in my Talos version had been built eleven days before the patch. Bumping talosVersion from v1.12.4 to v1.12.11 in the talconfig.yaml, generating the configuration and upgrading the node with talosctl upgrade fixed it. After the upgrade I checked that the error no longer showed up in the log.
The server is a file in git too
Both fixes were a change to a file and a command against the Talos API. Neither needed logging into the machine, because there is no way to log in. In exchange, everything the node is has to be written down: its version, its network, its extensions and its secrets, encrypted, in the same repository as the rest of the infrastructure.