homek8s/docs/cluster-overview.md
Lance Walters 953be9f3cf backup(portal): barman-cloud PITR via a Linode-side Garage WAL archive
sirius-growth/portal had a 24h-RPO pg_dump and no way to roll forward. This adds
continuous WAL archiving + a daily base backup into a second, independent Garage
node on the Linode (bucket pg-wal-archive, 10.10.0.5:3900, WireGuard-only), and
proves a restore to a point in time end to end.

- infrastructure/garage-linode/: podman+quadlet unit (the Linode is a kubelet
  node, no docker), garage.toml bound to 10.10.0.5 only, nft guard in PREROUTING
  -140, install.sh, README with the measured disk sizing, pitr-restore.md with
  the rehearsal transcript.
- apps/base/sirius-growth/cluster.yaml: spec.backup.barmanObjectStore
  (destinationPath s3://pg-wal-archive, gzip WAL+data, retentionPolicy 14d),
  credentials from Secret sirius-growth/portal-wal-s3 (out of band, not in git).
- apps/base/sirius-growth/scheduled-backup.yaml: ScheduledBackup portal-daily,
  03:20 UTC, six-field cron.
- docs/cluster-overview.md: §5.1 the WAL store, §8.1 coverage + sizing + gaps,
  §8.3 the PITR restore recipe.

forgejo/pg is deliberately left on pg_dump only (a day of git history is
annoying, not costly); portal keeps its nightly dump as the logical second copy.

Rehearsed 2026-11-19: marker row at 22:35:06Z, unwanted row at 22:35:28Z,
throwaway cluster restored to targetTime 22:35:15Z came back with the marker and
without the later row. See infrastructure/garage-linode/pitr-restore.md.
2026-11-19 17:46:27 -05:00

894 lines
74 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Home Lab Kubernetes Cluster — Current State
created: 2026-10-26
updated: 2026-10-26
author: Lance Walters (written with Hermes devops agent)
tags: [homelab, kubernetes, kubeadm, wireguard, cilium, forgejo, garage]
status: current
verified: 2026-10-26T19:17Z
---
# Home Lab Kubernetes Cluster — Current State
> **Provenance.** Everything marked *(live)* was read off the running cluster or hosts on **2026-10-26 between 19:00 and 19:17 UTC**. Anything not marked live comes from the GitOps repo `sirius/homek8s` at commit `bd5057c` or from the `home-k8s` Hermes skill, and is labelled as such. Section 10 is the command log. Where the skill and reality disagree, **reality is written here** and the disagreement is listed in §9.3.
Related: [[WireGuard Mesh]], [[Home Lab Runbook]], [[Pi Reboot Recovery]]
---
## 1. At a glance
*(all live)*
| Property | Value |
|---|---|
| Nodes | **3** — `siriussec` (control-plane + worker), `rpi` (worker / network edge), `linode` (worker, remote cloud) |
| Kubernetes | `v1.36.4` on all three, kubeadm-bootstrapped, single control plane |
| API endpoint | `https://10.10.0.2:6443` — WireGuard overlay address only |
| CNI | Cilium **v1.20.1** (Helm-managed by Flux), kube-proxy replacement, **native routing** (`ipv4NativeRoutingCIDR: 10.244.0.0/16`, `autoDirectNodeRoutes`), no VXLAN in the data path |
| Gateway API | Cilium Gateway, hostNetwork Envoy on nodes labelled `node-role.kubernetes.io/gateway=true` |
| Pod network | `10.244.0.0/16`, /24 per node: siriussec `10.244.0.0/24`, rpi `10.244.1.0/24`, linode `10.244.2.0/24` |
| Service network | `10.96.0.0/12` |
| Storage | `local-path` (rancher.io/local-path, default SC, provisioner pinned to siriussec), data under `/opt/local-path-provisioner` |
| GitOps | Flux v2 (`source`, `kustomize`, `helm`, `notification` controllers), watching `sirius/homek8s` `master`, applied revision `bd5057c` |
| Databases | CloudNativePG **1.30.0**, two clusters: `forgejo/pg` (10Gi) and `sirius-growth/portal` (5Gi) |
| Public ingress | Cloudflare tunnel **`sirius home`** → `cloudflared` (systemd on rpi) → `http://10.10.0.2:8080` |
| Workloads | **31 running pods** across 9 namespaces, plus 6 completed pods (CI prune jobs and leftovers) |
| Metrics | **none** — `metrics-server` is not installed, `kubectl top` fails *(live: `error: Metrics API not available`)* |
**In one paragraph.** This is a three-node kubeadm cluster stitched together over WireGuard rather than a LAN. The T480 (`siriussec`) is the control plane and does the heavy lifting — app pods, databases, Forgejo, the AMD64 CI runner all live there because it is the only `amd64` box with real disk. The Raspberry Pi (`rpi`) is the network edge: it is the WireGuard hub, the Cloudflare tunnel host, and the ARM64 CI runner. The Linode VPS (`linode`) rejoined as a third worker on 2026-10-26 and carries pod CIDR `10.244.2.0/24` over the Pi's `wg-remote` tunnel. There is no VXLAN and no kube-proxy: Cilium routes pod traffic natively, so every node must be reachable at its pod CIDR over WireGuard, and the API server is firewalled to the overlay plus pod CIDR only.
---
## 2. Topology
*(live — `kubectl get nodes -o wide`, node JSON)*
| Node | Hardware | OS / kernel | Arch | LAN | Overlay | Pod CIDR | Roles / labels | Taints |
|---|---|---|---|---|---|---|---|---|
| `siriussec` | ThinkPad T480 | Arch Linux, `6.18.50-2-lts` | amd64 | `192.168.1.179` (`enp0s31f6`) | `10.10.0.2` (`wg0`) | `10.244.0.0/24` | `control-plane`, `worker`, `gateway=true`, `node-role…/gateway=true`, `exclude-from-external-load-balancers` | **none** |
| `rpi` | Raspberry Pi (8 GiB) | Debian 13 trixie, `6.18.39+rpt-rpi-2712` | arm64 | `192.168.1.125` (`eth0`) | `10.10.0.1` (`wg0`), `10.20.0.2` (`wg-remote`) | `10.244.1.0/24` | `worker`, `node-role…/traffic`, `dedicated=network` (**no** `gateway=true` since 2026-10-27) | **none** |
| `linode` | Linode VPS, Atlanta | Debian 13 trixie, `6.12.113+deb13-amd64` | amd64 | public `50.116.38.217` | `10.10.0.5` (`dummy-k8s`), `10.20.0.1` (`wg0`, hub role) | `10.244.2.0/24` | `dedicated=network` | **none** |
Node conditions are clean on all three: `Ready=True`, `MemoryPressure/DiskPressure/PIDPressure/NetworkUnavailable=False` *(live)*.
### 2.1 What the roles actually mean
**`siriussec` — control plane and the only real compute node.** Runs `kube-apiserver`, `etcd`, `kube-controller-manager`, `kube-scheduler` as static pods, plus every application pod, both CNPG database instances, Forgejo, and the AMD64 CI runner. There is deliberately **no** `NoSchedule` taint on the control plane so it can also be a worker. It sits on the API-over-WireGuard side: `:6443` is reachable only from `lo`, `wg0`, and the pod CIDR (§3.4).
**`rpi` — network edge, not app compute.** WireGuard hub, `cloudflared` tunnel host, ARM64 CI runner (two runners, actually), and Gateway node. The skill says `rpi` carries `dedicated=network:PreferNoSchedule`; **live, it carries the label but no taint** *(drift, §9.3)*. Pods that must not land there still pin by `nodeSelector` rather than relying on the taint.
**`linode` — a real kubeadm worker again.** It runs a full Cilium agent and has pod CIDR `10.244.2.0/24`. It is **not** a `wg0` peer of the Pi: it is reached over the Pi's `wg-remote` interface (`10.20.0.2` ↔ `10.20.0.1`) with a static route for its pod CIDR. See §3.2.
### 2.2 Pinning rules (live, from Deployment specs)
| Rule | Who uses it | Why |
|---|---|---|
| `nodeSelector: kubernetes.io/hostname: siriussec` | `forgejo`, `forgejo-runner-amd64`, `local-path-provisioner`, `piedmont-*`, `sirius-growth-*`, `siriusdevops-*`, `cilium-operator` | amd64 images; rpi is arm64, and the PVs live on siriussec's NVMe |
| `nodeSelector: kubernetes.io/hostname: rpi` | `forgejo-runner-arm64`, `forgejo-runner-deploy-arm64` | needs the Pi's Docker socket and arm64 host |
| label `dedicated=network` (on rpi and linode) | none currently — both are labellable targets for future network/light pods | intended for traffic/edge workloads |
| `node-role.kubernetes.io/gateway=true` (**siriussec only**; rpi lost it 2026-10-27, linode never had it) | `cilium-envoy` DaemonSet | Gateway listeners follow the label. Exactly one node must carry it: a gateway node that does not run the backend pods binds the ports and answers **503 after 5 s** for everything |
Several app Deployments also carry a stray `tolerations: [{key: dedicated, effect: PreferNoSchedule}]` — harmless today because no node has that taint; it is residue from when rpi was tainted.
**Why apps are pinned to `siriussec` and not spread:** the PVs are `local-path` on siriussec's `/opt/local-path-provisioner`, so a pod with a PVC cannot move. The public site images are `amd64` only, and rpi is arm64. All three production site namespaces and both databases therefore live on one machine — that is a deliberate, documented single point of failure, not an oversight.
---
## 3. WireGuard
### 3.1 Two hubs, three paths
There are **two independent WireGuard topologies** in play, and conflating them is the classic mistake here.
```
┌───────────────────────────────────────────┐
│ rpi (LAN 192.168.1.125) │
│ wg0 10.10.0.1/24 ← MESH HUB │
│ wg-remote 10.20.0.2/24 ← spoke of the │
│ Linode hub │
└───────┬───────────────────────┬───────────┘
wg0 (10.10.0.2/32) │ │ wg-remote (UDP 49194)
PSK, endpoint │ │ → 50.116.38.217:51820
192.168.1.179:50013 │ ▼
┌─────────────▼──────────┐ ┌──────────────────────────┐
│ siriussec 10.10.0.2 │ │ linode 10.20.0.1/24 │
│ (cluster API :6443) │ │ REMOTE HUB (wg0 :51820) │
└────────────────────────┘ │ dummy-k8s 10.10.0.5/32 │
│ node, pod 10.244.2.0/24 │
┌────────────────────────┐ └───────┬───────────┬──────┘
│ Legion (laptop) │ │ │
│ k8snet 10.10.0.3/32 │ 10.20.0.3 10.20.0.5 + 10.10.0.3
│ admin kubectl only │ (phone) (Legion's hub-side leg)
│ NOT a node │ │
└────────────────────────┘ 10.20.0.4 + 10.10.0.6 (SG VPS + its pod CIDR 10.244.3.0/24)
```
*(live — `wg show` on rpi, `wg show wg0` on siriussec, `wg show wg0` on linode)*
**Mesh hub — `wg0` on rpi, `10.10.0.1/24`, UDP 51820.** Public key `tvPloMcBwTDciWi5WbFDpQQ2xcgidcKzRI/G3IqeuCQ=`. Peers:
| Mesh addr | Peer | Endpoint seen | Handshake (live) | AllowedIPs on hub | Notes |
|---|---|---|---|---|---|
| `10.10.0.2/32` | **siriussec** | `192.168.1.179:50013` | 1 min ago | `10.10.0.2/32, 10.244.0.0/24` | PSK enabled; 301 GiB in / 12.7 GiB out |
| `10.10.0.3/32` | **Legion** (`k8snet`) | `192.168.1.126:52000` | 48 min ago | `10.10.0.3/32` | admin/kubectl spoke, on the LAN; PSK enabled |
| `10.10.0.4/32` | unnamed spoke | `100.91.7.84:44094` (Tailscale) | **6 days 5 h ago** | `10.10.0.4/32` | **stale** — peer defined but effectively dead |
`wg show wg0 dump | wc -l` = **4** (header + 3 peers) *(live)*.
**Remote hub — `wg0` on the Linode, `10.20.0.1/24`, UDP 51820.** Public key `/2Y0XpJYd9Vl9Al6zNAlQimEYA+xY9Y5PO6nUDkfKEA=`. Peers *(live)*:
| Hub addr | Peer | AllowedIPs | Handshake |
|---|---|---|---|
| `10.20.0.2/32` | **rpi** (`wg-remote`, pubkey `h1v1Rhrnq2N2kt454xQamL1Y1x0TaICa1zoKgyZHpkM=`) | `10.20.0.2/32, 10.10.0.0/24, 10.96.0.0/12, 10.244.0.0/16` | ~1 min |
| `10.20.0.3/32` | phone | `10.20.0.3/32` | ~43 s |
| `10.20.0.5/32` + `10.10.0.3/32` | Legion (hub-side leg) | `10.20.0.5/32, 10.10.0.3/32` | ~1 min |
| `10.20.0.4/32` + `10.10.0.6/32` | SG VPS | `10.20.0.4/32, 10.10.0.6/32, 10.244.3.0/24` | *(no handshake shown — idle)* |
**Pi's `wg-remote` side** (`10.20.0.2/24`, local UDP 49194) has exactly one peer, the Linode hub, with `AllowedIPs = 10.20.0.0/24, 10.10.0.5/32, 10.244.2.0/24` and a 25 s keepalive. That single line is why `10.10.0.5` (the Linode node's dummy address) and the Linode pod CIDR are reachable from the Pi at all.
### 3.2 Address plan and AllowedIPs
- **Mesh `10.10.0.0/24`** — the cluster's transport network. Node InternalIPs are `10.10.0.1/.2/.5`; the API is `10.10.0.2:6443`.
- **Remote hub `10.20.0.0/24`** — the Linode's hub addressing, plus phone and SG VPS spokes that never touch the mesh directly.
- **Spoke AllowedIPs are `10.10.0.0/24, 10.244.0.0/16`**, not a full tunnel — client traffic to the internet never traverses the Pi. siriussec's conf is exactly `Address = 10.10.0.2/32`, `Endpoint = 192.168.1.125:51820`, `AllowedIPs = 10.10.0.0/24, 10.244.0.0/16` *(live)*.
- **Pod CIDRs must be in some peer's AllowedIPs.** WireGuard cryptokey routing matches the *destination address*, so `autoDirectNodeRoutes` is useless unless the peer line covers the destination pod CIDR. That is why the hub's peer entries carry `10.244.x.0/24`, and why the Linode hub carries `10.96.0.0/12` and `10.244.0.0/16` toward the Pi.
### 3.3 Why the mesh exists at all
There is no flat L2 between the T480, the Pi and a cloud VPS. Two properties force the overlay:
1. **Cilium native routing has no encapsulation.** With `routing-mode: native` and no VXLAN, a pod on siriussec addressed as `10.244.1.x` is sent as a plain packet, and the node must have a route to it. WireGuard supplies that route (`ip route get <podIP>` → `via 10.10.0.1 dev wg0`).
2. **The API server is firewalled to the overlay.** On siriussec, `/etc/nftables.d/k8s-api.nft` (loaded by `k8s-api-firewall.service`, active) is:
```
tcp dport 6443 iifname "lo" accept
tcp dport 6443 iifname "wg0" accept
ip saddr 10.244.0.0/16 tcp dport 6443 accept
tcp dport 6443 drop
```
*(live)* — so joins, kubelets and in-cluster controllers must arrive over `wg0` or from the pod network. LAN `192.168.1.179:6443` is closed by design.
### 3.4 The `10.10.0.0/24` route-conflict hazard
On the Pi the prefix `10.10.0.0/24` is claimed **twice**: by `wg0` (interface address `10.10.0.1/24`) and by `wg-remote`'s peer AllowedIPs (`10.10.0.0/24` toward the Linode, needed for the `10.10.0.5` dummy address). The kernel prefers `wg-remote`, which silently black-holes the Pi's path to the API while every tunnel still shows "up".
The installed fix is `/32` pins on the hub's own peers:
```bash
sudo ip route replace 10.10.0.2/32 dev wg0
sudo ip route replace 10.10.0.4/32 dev wg0
# 10.10.0.5 stays on wg-remote — it is the Linode's dummy address
```
*(live, current state)*
```
$ ip route get 10.10.0.2 → 10.10.0.2 dev wg0 src 10.10.0.1
$ ip route get 10.10.0.5 → 10.10.0.5 dev wg-remote src 10.20.0.2
$ ip route get 10.10.0.3 → 10.10.0.3 dev wg0 src 10.10.0.1
```
Persisted by `wg0-routes.service` on the Pi (oneshot, `After=wg-quick@wg0.service wg-quick@wg-remote.service`, `Before=kubelet.service`, **no `Requires=`** so a manually-started wg0 does not fail the unit).
### 3.5 wg-quick unit state *(live, and it matters)*
| Host | Unit | enabled | active |
|---|---|---|---|
| rpi | `wg-quick@wg0` | **enabled** | **inactive** (interface was brought up manually) |
| rpi | `wg-quick@wg-remote` | enabled | active |
| rpi | `cloudflared` | enabled | active |
| siriussec | `wg-quick@wg0` | enabled | **inactive** (interface present, started manually) |
| linode | `wg-quick@wg0` | enabled | active |
`wg0` on both rpi and siriussec is up but its unit is inactive — expected, because the interfaces were started with `wg-quick up` directly. Do **not** "fix" this by cycling the systemd unit: `/etc/wireguard/wg0.conf` on the Pi is **wgportal-autogenerated** with `SaveConfig = true`, so `systemctl stop` rewrites the file from the live interface and can drop peers.
### 3.6 Health checks, hop by hop
```bash
# On the Pi
sudo wg show # both interfaces, handshake ages
sudo wg show wg0 dump | wc -l # 4 = header + 3 peers
ip route get 10.10.0.2 # must say dev wg0
ip route get 10.10.0.5 # must say dev wg-remote
curl -sk https://10.10.0.2:6443/version # 200 = API reachable over the mesh
kubectl get nodes # 3/3 Ready
```
### 3.7 Peer management — wgportal is **not** running
The skill describes `wgportal/wg-portal:v2` as the peer manager on the Pi. **Live: there is no `wg-portal` container and no systemd unit.** `/opt/wgportal/` still holds `docker-compose.yml`, `config/`, `data/` (sqlite) and `ADMIN.txt`, and `/etc/wireguard/wg0.conf` still carries the wgportal `AUTOGENERATED FILE - DO NOT EDIT` header — but nothing is running it. **Peer changes today are manual**, applied to `/etc/wireguard/wg0.conf` (and the live interface) by hand. This is a real operational gap, not a documentation detail: there is currently no UI or API to add a peer.
---
## 4. Ingress path
```
Internet
│ Cloudflare TLS (DNS + edge)
▼
Cloudflare Tunnel "sirius home" (id 6d0702eb-99cc-4062-b57d-e70e2f1a7895, healthy, 4 connections)
│
▼
cloudflared (systemd on rpi, token-managed via /etc/systemd/system/cloudflared.service)
│ HTTP, origin override per hostname
▼
http://10.10.0.2:8080 ← siriussec
│
Cilium Gateway "public" (class cilium, listener http:8080)
│ hostNetwork Envoy (DaemonSet cilium-envoy, node-role.kubernetes.io/gateway=true)
▼
HTTPRoute (hostname match, path match) → Service → Pod
```
*(live: tunnel identity from the Cloudflare API, tunnel config from `curl -s http://127.0.0.1:20241/config` on the Pi, gateway/routes from the cluster)*
### 4.1 The origin is `10.10.0.2:8080` — and only that address serves
The tunnel's ingress list maps **every** public hostname to `http://10.10.0.2:8080`, with `originRequest.httpHostHeader` set to the hostname so HTTPRoute host matching works. Verified per node from the Pi with a `Host:` header *(live)*:
| Origin | `Host: siriusdevops.com` | Result |
|---|---|---|
| `10.10.0.2:8080` (siriussec) | **200** (and 200 for forgejo) | ✅ production origin |
| `10.10.0.1:8080` (rpi) | no listener (000 in <1 ms) **since 2026-10-27**; before that, **503 after exactly 5.0 s** | ✗ rpi is not a gateway node any more — no Envoy, no ports |
| `10.10.0.5:8080` (linode) | no listener (000) | ✗ no envoy there |
Note that the `Gateway` **status advertises all three addresses** (`10.10.0.1`, `10.10.0.2`, `10.10.0.5`) even though the label is now on siriussec alone: Cilium fills `status.addresses` with every node InternalIP and ignores `spec.addresses` (cilium#29060). **Do not treat `status.addresses` as a load-balanced VIP or a "try either IP" list** — it is not a list of bound ports either; it is just the node address set. Only `10.10.0.2` has a listener.
### 4.2 The co-location rule
Envoy runs `hostNetwork` on the gateway-labelled nodes. **Before 2026-10-27 rpi carried the label too**, so it had a listener on `0.0.0.0:8080` and every request for a mapped hostname **hung 5 s and returned 503** there: the Envoy on rpi forwards to backend pods that live on siriussec's pod CIDR, sources the connection as `reserved:ingress` (`10.244.1.x`), and the SYN-ACK never completes under Cilium native routing. The measurable signature is the exact **5.000 s** and `503`. Fixed by removing the label from rpi (one gateway node, one serving address); the same 5 s/503 signature was making `10.10.0.1:8081`/`:8084` flap for phone clients, and it answered the same way from rpi's own `127.0.0.1`.
Consequences:
- **The Envoy that serves traffic must be on the node that holds the backend pods.** All app pods are on siriussec ⇒ the usable origin is siriussec, which is what the tunnel already points at.
- Don't "fix" a 503 by rescheduling the site pods to rpi to match the gateway node — they are amd64 images and rpi is arm64.
- Don't add a second listener on rpi, don't `ip addr add` the ingress IP on `cilium_host`, don't iptables-SNAT Envoy. BPF bypasses netfilter; those edits look plausible and do nothing.
### 4.3 503 vs 404
- **404** = the Gateway has no HTTPRoute for that hostname (or a route's path prefix swallowed it). A Cloudflare-visible 404 on a hostname that *is* in the tunnel's ingress list means "tunnel fine, no route".
- **503** = a route exists but its backend Service has no ready endpoints.
- `paaas.siriusdevops.com` is currently mapped in the tunnel and returns **404 with 0 bytes** because no HTTPRoute claims it *(live)*.
### 4.4 Live public hostnames
*(read from the tunnel's own metrics port on rpi — `curl -s http://127.0.0.1:20241/config`)*
| Hostname | Origin | HTTPRoute | Status (live origin check) |
|---|---|---|---|
| `siriusdevops.com` | `http://10.10.0.2:8080` | `siriusdevops/siriusdevops` | 200, 31813 B |
| `www.siriusdevops.com` | `http://10.10.0.2:8080` | same | 200 |
| `forgejo.siriusdevops.com` | `http://10.10.0.2:8080` | `forgejo/forgejo` | 200, 15008 B |
| `paaas.siriusdevops.com` | `http://10.10.0.2:8080` | **none** | **404** (0 B) |
| `piedmonthomesvc.com` | `http://10.10.0.2:8080` | `piedmont/piedmont` | 200, 7067 B |
| `www.piedmonthomesvc.com` | `http://10.10.0.2:8080` | same | 200 |
| `siriusgrowthsolutions.com` | `http://10.10.0.2:8080` | `sirius-growth/sirius-growth` | 200, 72640 B |
| `www.siriusgrowthsolutions.com` | `http://10.10.0.2:8080` | same | 200 |
| *(catch-all)* | `http_status: 404` | — | must stay last |
A second, **inactive** tunnel named `piedmonthomesvc` (`bdcee200-7deb-4c8d-956b-2c030ebf7545`) still exists in the Cloudflare account, with zero connections. Only `sirius home` serves traffic; do not create another.
### 4.5 Routes as configured *(live, `kubectl get httproute -A -o json`)*
All four routes attach to `gateway-system/public`. First-match path ordering matters — the `/api/contact` rule comes **before** `/`:
| Route | Path → backend |
|---|---|
| `forgejo/forgejo` | `/` → `forgejo:3000` |
| `siriusdevops/siriusdevops` | `/api/contact` → `siriusdevops-contact:8090`; `/` → `siriusdevops-site:80` |
| `piedmont/piedmont` | `/api/contact` → `piedmont-contact:8090`; `/` → `piedmont-site:80` |
| `sirius-growth/sirius-growth` | `/api/contact` → `sirius-growth-contact:8090`; `/api/portal` → `sirius-growth-portal:8091`; `/` → `sirius-growth-site:80` |
A single `ReferenceGrant` exists (`gateway-system/forgejo`) for the cross-namespace route.
### 4.6 Second gateway: `internal`
`internal/internal` (namespace `internal`) and `internal/hubble-ui` are Cilium Gateways on **port 8081** and **8084**, `allowedRoutes: All`, with no tunnel mapping. It carries the WireGuard-only services. Both are reachable **by bare IP** (phones cannot edit `/etc/hosts`): **Grafana** `http://10.10.0.2:8081/` and **Hubble UI** `http://10.10.0.2:8084/`; the named URLs (`grafana.lab.internal`, `hubble.lab.internal`) are laptop conveniences only. Hubble UI has its own `Gateway internal/hubble-ui` because Cilium merges hostname-less routes that share a Gateway. The enforcement point is the *host* firewall on both gateway nodes (nft `table inet internal_gw` on siriussec, ufw rules above the LAN catch-all on rpi), not the Gateway: a listener port is reachable on every node address the moment it is Programmed. Full pattern, negative tests and the add-next-service recipe: `docs/internal-wireguard-services.md`.
Neither hostname is in the cloudflared ingress list, and `*.lab.internal` resolves nowhere public — `Host: <name>.lab.internal` on the public gateway (`10.10.0.2:8080`) answers **404**.
---
## 5. Garage object storage
*(live — Docker container on the Pi, `garage status`, `garage bucket list`)*
**What it is:** the homelab's S3-compatible object store, used for photo and client-file buckets behind the public sites.
| Property | Value |
|---|---|
| Where | **Docker container on `rpi`**, not in Kubernetes — image `dxflrs/garage:v1.1.0`, container `garage` |
| Compose | **`infrastructure/garage/` in this repo** (installed to `/etc/garage/docker-compose.yml`); state stays at `/home/sirius/websites/garage/`. Flux does not apply it — see that directory's README |
| State | `data/` (bind → `/data/data`) and `meta/` (bind → `/data/meta`); config `/etc/garage/garage.toml`, RPC secret `/etc/garage/garage.env` (0600, not in git) |
| Ports | `10.10.0.1:3900` S3 API and `10.10.0.1:3903` metrics (WireGuard only), `127.0.0.1:3900` host-local. No `0.0.0.0` publish. 3901 (RPC) and 3902 (`[s3_web]`) are no longer published at all |
| Firewall | `host/garage-firewall.nft` — nftables PREROUTING priority -140 drop for 3900-3903 from anything but `lo`/`wg0`/`wg-remote`. Docker's DNAT bypasses ufw's INPUT chain, so ufw alone cannot stop a compose typo |
| Capacity | 100 GB configured; `354.3 GB (36.0%)` data available (single healthy node `d053db4dfc97bf78`) |
| Buckets | `sirius-growth-photos`, `piedmont-photos`, `siriusdevops-media`, `sirius-growth-blog-media`, `sirius-growth-client-files` |
| Keys | one per consumer — `ci-push` (W only) and `site-fetch` (R only) on `siriusdevops-media`; the shared `ci-key` was deleted 2026-11-19 |
| Backup | hourly `meta` snapshot + nightly `data` rsync to `root@10.20.0.1:/root/garage-backup` (systemd timers) |
| Metrics | Prometheus target `job="garage"` scraping `10.10.0.1:3903`, `monitoring/controllers/home/garage.yaml` |
**Exposure model:** every published port binds an explicit address, and the host firewall drops the rest before Docker can rewrite the packet. A pod on siriussec reaches the S3 API at `http://10.10.0.1:3900` over the mesh; the LAN and the internet see nothing (measured off-mesh from the Linode node: all of 3900-3903 filtered).
**What breaks:** anything that assumes `127.0.0.1:3902` (the removed static web endpoint) is reachable from inside the pod network. It never was — a pod's `127.0.0.1` is its own netns — and the listener is now gone. Kubernetes workloads must use the `10.10.0.1:3900` S3 endpoint, or the in-image `/photos/` alias baked into the site images as a fallback. That alias is a deliberate fallback, **not** evidence the bucket is gone.
### 5.1 A *second*, unrelated Garage node: the WAL archive on the Linode
`infrastructure/garage-linode/` (not Flux-applied, like the Pi's) runs a
single-node Garage on the **Linode hub** and holds exactly one bucket,
`pg-wal-archive`, for CloudNativePG point-in-time recovery (§8.1, §8.3).
| Property | Value |
|---|---|
| Where | Linode VPS (`linode` node), **podman** + quadlet `/etc/containers/systemd/garage.container` — there is no Docker on a kubelet node |
| Node | `994fd2f42ae72da6`, zone `dc1`, capacity **20 GB**, `replication_factor = 1` — a separate store with its own `node_key`, **not** a peer of the Pi's node |
| Endpoint | `http://10.10.0.5:3900` (S3) — the dummy-k8s WireGuard address, reachable from every pod over the mesh. `:3903` metrics, mesh-only, not scraped yet |
| Config | `garage.toml` binds those two addresses explicitly (no `0.0.0.0`), RPC secret from `/etc/garage/garage.env` (0600, not in git) |
| Firewall | nft `inet wal_archive_guard`, PREROUTING priority -140: accept `lo`/`wg0` (+ pod CIDR), drop everything else. ufw on this host is unrelated and stays as it is |
| State | `/var/lib/garage/{meta,data}`, covered by the nightly cluster-backup tree on the same host |
| Bucket | `pg-wal-archive` — private (`Website access: false`, anonymous GET → 403) |
| Keys | `cnpg-portal-wal` (`GK7f2b4bb1fc9abaec50fde37b`, RW on that bucket only) → Secret `sirius-growth/portal-wal-s3` |
This node exists **because of where it is**, not because the estate needed a
second S3 service: a WAL archive on the Pi would sit in the same building, power
domain and uplink as the CNPG primary on siriussec. Off-site or it is not a
backup.
---
## 6. Workloads
*(live — `kubectl get pods -A -o wide` at 19:0x UTC. **31 Running**, 6 Completed. This table is the running set, 31 rows.)*
### 6.1 Running pods
| # | Namespace | Pod | Node | IP | Purpose | Exposure |
|---|---|---|---|---|---|---|
| 1 | cnpg-system | `cnpg-controller-manager-78484bd58d-m6rtk` | siriussec | 10.244.0.183 | CloudNativePG operator (1.30.0) | internal |
| 2 | flux-system | `helm-controller-5788b55f98-zzgmw` | siriussec | 10.244.0.210 | Flux HelmRelease reconciler | internal |
| 3 | flux-system | `kustomize-controller-645cdc4b67-r2gl6` | siriussec | 10.244.0.30 | Flux kustomize reconciler (applies all YAML) | internal |
| 4 | flux-system | `notification-controller-7cd6d4994b-drh8x` | siriussec | 10.244.0.125 | Flux alerts/webhooks | internal |
| 5 | flux-system | `source-controller-56549698b5-2lvmc` | siriussec | 10.244.0.44 | Flux git artifact fetcher | internal |
| 6 | forgejo | `forgejo-67847d596c-jpb7x` | siriussec | 10.244.0.197 | Forgejo **16.0.5** git/CI/registry UI | **public** `forgejo.siriusdevops.com` |
| 7 | forgejo | `forgejo-runner-amd64-65fdfdf884-bb88l` | siriussec | 10.244.0.17 | Actions runner (dind sidecar), labels `docker-amd64`, `amd64` | internal |
| 8 | forgejo | `forgejo-runner-arm64-7566647d9f-7q2wk` | rpi | 10.244.1.128 | Actions runner via Pi host Docker socket, labels `docker-arm64`, `arm64`, `docker` | internal |
| 9 | forgejo | `forgejo-runner-deploy-arm64-b748d7c6f-66r5j` | rpi | 10.244.1.167 | Actions runner, label **`deploy-arm64` only** (site deploys) | internal |
| 10 | forgejo | `pg-1` | siriussec | 10.244.0.159 | CNPG PostgreSQL for Forgejo (1 instance) | internal |
| 11 | kube-system | `cilium-cz7w6` | siriussec | 10.10.0.2 (host-net) | Cilium agent v1.20.1 | internal |
| 12 | kube-system | `cilium-dswfb` | rpi | 10.10.0.1 (host-net) | Cilium agent v1.20.1 | internal |
| 13 | kube-system | `cilium-lst6f` | linode | 10.10.0.5 (host-net) | Cilium agent v1.20.1 | internal |
| 14 | kube-system | ~~`cilium-envoy-kfd7w`~~ | ~~rpi~~ | — | **gone 2026-10-27** — rpi lost `gateway=true`; a gateway node that cannot reach the backends only served 5 s/503 (§4.2) | — |
| 15 | kube-system | `cilium-envoy-q2jn8` | siriussec | 10.10.0.2 (host-net) | Gateway data plane — **the one serving public traffic** | **public** (8080) |
| 16 | kube-system | `cilium-operator-6fc68c64d6-cw4rj` | siriussec | 10.244.0.2x | Cilium operator (leader election) | internal |
| 17 | kube-system | `coredns-589f44dc88-l28hh` | siriussec | 10.244.0.109 | cluster DNS (1 of 2) | internal |
| 18 | kube-system | `coredns-589f44dc88-xtzqq` | siriussec | 10.244.0.114 | cluster DNS (2 of 2) | internal |
| 19 | kube-system | `etcd-siriussec` | siriussec | 10.10.0.2 (host-net) | cluster datastore (static pod) | internal |
| 20 | kube-system | `kube-apiserver-siriussec` | siriussec | 10.10.0.2 (host-net) | API server `:6443` (static pod) | overlay + pod CIDR only |
| 21 | kube-system | `kube-controller-manager-siriussec` | siriussec | 10.10.0.2 (host-net) | controller manager (static pod) | internal |
| 22 | kube-system | `kube-scheduler-siriussec` | siriussec | 10.10.0.2 (host-net) | scheduler (static pod) | internal |
| 23 | local-path-storage | `local-path-provisioner-84f56599d-p9d6x` | siriussec | 10.244.0.63 | dynamic local PV provisioning | internal |
| 24 | piedmont | `piedmont-contact-7897cf4d4-z764g` | siriussec | 10.244.0.86 | PHS contact-form API (Telegram) | `/api/contact` on `piedmonthomesvc.com` |
| 25 | piedmont | `piedmont-site-66cbdd498d-tx2gc` | siriussec | 10.244.0.94 | PHS static site (nginx) | `piedmonthomesvc.com` |
| 26 | sirius-growth | `portal-1` | siriussec | 10.244.0.173 | CNPG PostgreSQL for SGS portal (1 instance) | internal |
| 27 | sirius-growth | `sirius-growth-contact-5448485967-n2flh` | siriussec | 10.244.0.219 | SGS contact API | `/api/contact` on `siriusgrowthsolutions.com` |
| 28 | sirius-growth | `sirius-growth-portal-89d598f55-pwf74` | siriussec | 10.244.0.146 | SGS customer portal (`:8091`) | `/api/portal` |
| 29 | sirius-growth | `sirius-growth-site-757d4f96b6-wcnpn` | siriussec | 10.244.0.170 | SGS marketing site (nginx) | `siriusgrowthsolutions.com` |
| 30 | siriusdevops | `siriusdevops-contact-b5df76cd4-b98sb` | siriussec | 10.244.0.244 | SiriusDevOps contact API | `/api/contact` on `siriusdevops.com` |
| 31 | siriusdevops | `siriusdevops-site-566968fffb-52z5n` | siriussec | 10.244.0.85 | SiriusDevOps site (nginx) | `siriusdevops.com` |
Nothing runs on `linode` except its Cilium agent. `rpi` runs only the two runners plus its Cilium/Envoy agents.
### 6.2 Completed / non-running pods (6)
`forgejo/forgejo-67847d596c-xn2br` (old ReplicaSet, `Completed`, 42 d — harmless residue), three `forgejo-runner-prune-*` Job pods (the nightly docker-prune CronJob), and `kube-system/{curl-test,test}` (41 d one-off probes).
### 6.3 Namespaces
| Namespace | Age | Contents |
|---|---|---|
| `kube-system` | 45 d | control plane, Cilium, Envoy, CoreDNS, hubble-relay + hubble-ui |
| `kube-public`, `kube-node-lease`, `default` | 45 d | kubeadm defaults |
| `forgejo` | 45 d | Forgejo, its CNPG cluster, 3 runners, prune CronJob |
| `cnpg-system` | 45 d | CloudNativePG operator |
| `monitoring` | 1 d | kube-prometheus-stack: Prometheus (7d/8GB), Grafana, kube-state-metrics, node-exporter |
| `flux-system` | 41 d | 4 Flux controllers, GitRepository, 4 Kustomizations |
| `gateway-system` | 45 d | Gateway `public` |
| `internal` | 41 d | Gateways `internal` (8081) and `hubble-ui` (8084) |
| `local-path-storage` | 45 d | provisioner |
| `siriusdevops` | 43 d | site + contact |
| `piedmont` | 26 d | site + contact |
| `sirius-growth` | 8 d | site + contact + portal + CNPG cluster |
| `cilium-secrets` | 45 d | Gateway TLS/secret sync target |
### 6.4 Forgejo Actions runners
**Three** runners, all registered against `https://forgejo.siriusdevops.com` (never an in-cluster URL — the checkout URL must resolve from inside job containers).
| Deployment | Node | Docker access | `runs-on` labels | Config |
|---|---|---|---|---|
| `forgejo-runner-arm64` | rpi | Pi **host** socket `/var/run/docker.sock` + host `docker-static` binary + cli-plugins | `docker-arm64`, `arm64`, **`docker`** | CM `forgejo-runner-config` key `arm64.toml`; `capacity 1`; root + privileged; pod `supplementalGroups: [984]`; **no `docker_host`** (would duplicate the socket mount) |
| `forgejo-runner-amd64` | siriussec | privileged `docker:27-dind` sidecar, PVC `forgejo-runner-amd64` (20 Gi) | `docker-amd64`, `amd64` | key `amd64.toml`; `capacity 1`; `docker_host: unix:///var/run/docker.sock` |
| `forgejo-runner-deploy-arm64` | rpi | Pi host socket, same bind mounts | **`deploy-arm64` only** | key `deploy-arm64.toml`; `capacity 1`; `timeout 30m`; state on hostPath `/opt/siriusdevops/runner-deploy/data` |
Label discipline that must not be broken:
- `docker` lives **only** on the Pi arm64 runner, so legacy `runs-on: docker` jobs stay arm64. x86 builds must say `docker-amd64`.
- `deploy-arm64` is disjoint from the CI labels in both directions, so a 20–40 minute onionwire Rust build on the shared Pi runner (capacity 1) can no longer starve `deploy-site`. Residual coupling: `deploy-portal.yml` still uses `docker-amd64`, which a site build also uses.
- `capacity: 1` everywhere is load-bearing, not conservatism: the amd64 dind is one daemon (two concurrent builds starve and `apt` loops on `Ign:`), and the arm64 runner serialises writes into the shared `onionwire-target-ci` volume.
Workflow labels actually present in the local checkouts *(live grep of `.forgejo/workflows`)*: `docker` (×8) and `docker-amd64` (×3) in `onionwire`; `deploy-arm64`, `docker-amd64` in `sirius-growth`; `docker-amd64` in `siriusdevops-contact`.
### 6.5 Nightly disk reclamation (`forgejo/forgejo-runner-prune`)
`apps/base/forgejo/prune-cronjob.yaml`, `17 4 * * *` **UTC** (the repo's one CronJob timezone convention), `concurrencyPolicy: Forbid`, `startingDeadlineSeconds: 1800`, `backoffLimit: 1`, `activeDeadlineSeconds: 3600`.
**Two containers, because there are two kinds of daemon.** `host-daemon` (`docker:27-cli`) mounts the Pi's `/var/run/docker.sock`; `dind-daemons` (`alpine/k8s:1.36.4`) discovers in-cluster dind daemons — pods with label `app=forgejo-runner` **that have a container named `dind`** — and runs the same prune logic inside each over the exec API. The ServiceAccount `forgejo-prune` has only `pods get,list` and `pods/exec create` in namespace `forgejo`. No pod names are in the manifest, so the two arm64 dind daemons from the arm64 migration are picked up the first night they exist (proved by creating an unrelated `app=forgejo-runner` dind pod: the job reported `found=2 pruned=2`).
**Retention.** Exited containers > 48 h, unused **Pi-host** images > 168 h (a week of rollback for the sites). Build cache is capped at **20 GB** on the Pi host and **4 GB** per dind daemon; above the cap the script walks `--filter until=` down from 72 h to 0 s and stops as soon as the cache is under the cap, so the newest layers survive and a cold cache is the last resort. In-cluster images are **dangling-only** pruned: an `until` filter on a *pulled* image compares the upstream build date, so it would delete `node:20-bullseye` / `rust:*-bookworm` every night and make every job cold.
**Named volumes are never pruned** (`docker volume prune` is forbidden): `onionwire-target-ci` (95.8 GB on the Pi), the Android SDK/Gradle/cargo-registry volumes and the cargo registries are shared CI state. Every run prints `docker system df -v` per daemon so growth is recorded before it becomes an outage. The Pi host currently holds **33 volumes / 169.7 GB, 48.67 GB reclaimable**; capping any of them is a separate decision.
**Busy guard.** A daemon with a running container is skipped and the Job still exits 0: on the dind daemons *any* running container counts (they have none when idle), on the Pi host a running container younger than 180 min counts (the standing containers — `sirius-growth-site`, `handyman-site`, `garage`, `registry` — are days old, so no name whitelist is needed). A busy night is not a red job; a *missing* night is what alerts.
Force a run (safe any time; it self-skips when busy):
```bash
kubectl -n forgejo create job --from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)
kubectl -n forgejo logs job/prune-manual-<ts> -c host-daemon # Pi daemon
kubectl -n forgejo logs job/prune-manual-<ts> -c dind-daemons # every dind daemon
```
**Two premises worth writing down, because the code depends on them** (both verified 2026-10-27):
- The build-cache *capacity* flags are a no-op on this buildx (0.20.1). `--keep-storage`, `--max-storage` (rejected: unknown flag) and `--max-used-space` all report `Total: 0B` with a cache over the cap — a 21.44 GB cache with `--max-used-space 20GB`, and a 541 MB cache with `--max-used-space 100MB`. `--filter until=` *does* reclaim (541 MB → 0 with `until=0s`), which is why the cap is enforced by walking age windows.
- **Per-PVC usage is not measurable on this cluster, and no alert pretends otherwise.** `kubelet_volume_stats_*` was an ALPHA metric set served from kubelet's `/metrics/volumes` endpoint; on kubelet v1.36.4 that endpoint returns **404 on all three nodes** (`/metrics`, `/metrics/probes`, `/metrics/cadvisor`, `/metrics/resource` all return 200) and `/metrics` carries no volume-stats series — the upstream loss in kubelet 1.34 (kubernetes/kubernetes#133847, fix #133890), not a hostPath quirk. There is therefore no scrape config that can produce those series; re-deriving them would need a new exporter parsing kubelet's `/stats/summary` JSON (new Deployment + `nodes/stats` RBAC). The old `RunnerDindPvcHighWatermark` / `RunnerDindPvcCritical` rules were deleted for selecting a metric with no producer, and replaced by runner-scoped filesystem rules — see below. The chart's own per-PVC pair went the same way: kube-prometheus-stack's `kubernetes-storage` group (`KubePersistentVolumeFillingUp`, `KubePersistentVolumeInodesFillingUp`, both severities) used to select `kubelet_volume_stats_*` too, and its four rules are now suppressed with `defaultRules.disabled` in `monitoring/controllers/home/values.yaml` (`KubePersistentVolumeFillingUp: true`, `KubePersistentVolumeInodesFillingUp: true`) — one key disables both severities of a rule. `count(kubelet_volume_stats_used_bytes)` returns **0 series**, and a rule that registers `health=ok, state=inactive` on a missing metric reads as "no PVC is filling" when nothing can fire at all. The group's fifth rule, `KubePersistentVolumeErrors`, is *not* dead (kube-state-metrics `kube_persistentvolume_status_phase`, 40 series here), so it is deliberately left enabled — the group survives with one live rule instead of being dropped whole. Verify with `kubectl -n monitoring get prometheusrule kube-prometheus-stack-kubernetes-storage -o json` (one rule left) and `curl /api/v1/rules`.
**Alerts** (`PrometheusRule monitoring/forgejo-prune`, label `release: kube-prometheus-stack`): `ForgejoPruneCronJobStale` (last success > 26 h, or the series absent), `ForgejoPruneJobFailed` (`kube_job_status_failed` for `forgejo-runner-prune-*` > 0 — `kube_job_failed` no longer exists), `NodeFilesystemFillingUp` / `NodeFilesystemCritical` (root fs > 85 % / > 92 % per node, joined to the hostname via `node_uname_info`), plus the node-filesystem guards that replaced them: `RunnerDindDiskHighWatermark` / `RunnerDindDiskCritical` (root fs > 80 % / > 90 % on nodes that run a `forgejo-runner` pod — joined node → `node_uname_info.nodename` → `kube_pod_info.node`, rpi excluded), and `RpiDindDataRootFillingUp` (group `dind-disk-cap`, rpi root fs > 70 %, because it carries 240 GiB of dind PVCs on a 917 G disk). The dind data-root is a plain directory under `/opt/local-path-provisioner` on that filesystem, so filesystem fill is the only honest per-runner signal. Alertmanager is disabled in this stack, so they surface in Prometheus → Alerts and Grafana → Alerting, not as pages.
---
## 7. CI/CD flow
**Application images**
```
git push → Forgejo Actions
├─ arm64 / docker jobs → forgejo-runner-arm64 (rpi, host docker)
├─ x86_64 jobs → forgejo-runner-amd64 (siriussec, dind)
└─ site deploys → forgejo-runner-deploy-arm64 (rpi)
→ image pushed to the Forgejo registry (forgejo.siriusdevops.com/sirius/<image>:latest)
→ Deployments use imagePullPolicy: Always, so the pod must be recreated
(rollout restart alone can keep the old digest — verify the pod's imageID)
```
**Cluster manifests**
```
edit apps/base/<app>/* → push to sirius/homek8s master
→ Flux GitRepository polls (interval 1m) → artifact at new SHA
→ kustomization infrastructure (path ./infrastructure/home)
→ kustomization apps (path ./apps/home, dependsOn infrastructure)
```
New app = new `apps/base/<app>/` (namespace, Deployment, Service, HTTPRoute) **plus** one line in `apps/home/kustomization.yaml`. New public hostname = that HTTPRoute **plus** one ingress entry on the existing `sirius home` tunnel.
Force a recheck when Flux's status line is stale (a push is not applied until the GitRepository artifact is that SHA):
```bash
kubectl -n flux-system annotate gitrepository flux-system \
reconcile.fluxcd.io/requestedAt="$(date +%s)" --overwrite
kubectl -n flux-system annotate kustomization apps \
reconcile.fluxcd.io/requestedAt="$(date +%s)" --overwrite
```
**Live Flux state:** GitRepository `flux-system` → `https://forgejo.siriusdevops.com/sirius/homek8s`, Ready, artifact `master@sha1:d5d1d28`; all five Kustomizations (`flux-system`, `gateway-api-crds`, `databases`, `infrastructure`, `apps`) `Ready=True` on the same revision. Cilium is managed as a HelmRelease **by Flux** — never `helm upgrade` it by hand.
Repository layout:
```
clusters/homek8s/ flux-system GitRepository + 5 Kustomizations
infrastructure/home/ entrypoint for infra (cilium, gateway, storage)
infrastructure/databases/base/ CloudNativePG 1.30.0 operator, vendored + patched
(own Flux Kustomization `databases`, prune: false — CRDs)
apps/home/ forgejo, siriusdevops, piedmont, sirius-growth
monitoring/controllers/home/ (present in repo, NOT deployed — no monitoring namespace exists)
```
---
## 8. Storage and data
*(live — `kubectl get pvc,pv -A`, `du` on siriussec)*
StorageClass `local-path` (default, `WaitForFirstConsumer`, no expansion), provisioner pinned to siriussec, root `/opt/local-path-provisioner`.
| PVC | NS | Size | On-disk dir | Used | Holds |
|---|---|---|---|---|---|
| `forgejo-data` | forgejo | 20 Gi | `pvc-75ba7bc3…_forgejo_forgejo-data` | **19 G** | Forgejo repos, LFS, avatars, attachments (13.6 G of that is package-registry blobs) — **backed up nightly** |
| `forgejo-runner-amd64` | forgejo | 20 Gi | `pvc-b867904c…_forgejo_forgejo-runner-amd64` | **22 G** (the dind `/docker` data-root) | CI scratch — **disposable**, but see the hazard below |
| `pg-1` | forgejo | 10 Gi | `pvc-3c0ba824…_forgejo_pg-1` | 653 M | Forgejo Postgres data — **backed up nightly (pg_dump)** |
| `portal-1` | sirius-growth | 5 Gi | `pvc-3348c52c…_sirius-growth_portal-1` | 595 M | SGS portal Postgres data — **backed up nightly (pg_dump)** |
| `osint-pgdata` / `osint-camera-snapshots` | osint | 15 Gi / 3 Gi | — | 289 M / 4 K | plain Postgres — **backed up nightly (pg_dump)**; the camera snapshot dir is 4 K of throwaway frames — **accepted gap** |
| `sgs-leadgen-data` | sirius-growth | 1 Gi | — | 4.9 M | lead-gen capture — **mirrored nightly** |
| `kube-prometheus-stack-grafana` | monitoring | 5 Gi | — | 55 M | Grafana sqlite: users/orgs/prefs/API keys/annotations (dashboards, datasources and alert rules are provisioned from git, so they are *not* in the db) — **snapshotted nightly** |
| `…prometheus-…-db-…prometheus-0` | monitoring | 10 Gi | — | 2.4 G | Prometheus TSDB — rebuildable metrics history, **not backed up** |
**Dind growth hazard.** The amd64 runner's PVC is nominally 20 Gi and currently sits at **~22 G**: it has previously grown to ~50 GB from heavy Android/Rust builds and pushed the node into `DiskPressure`, which evicted the runner and left Forgejo and `pg-1` Pending. Docker image GC does not reclaim the data-root. Rule: when it approaches the cap, scale the runner to 0 **first**, then wipe `.../docker/*` (keeping `runner.ini` beside it), then scale back and re-pull the job image — wiping it under a live or restarting pod leaves `dockerd` half-initialised and every pull fails. Note the data-root also hosts the named volumes CI depends on (`cargo-target`, Android SDK, Gradle cache), so a wipe makes the next run fully cold.
Host disks *(live)*: siriussec `/` 214 G, 167 G used (**83 %**, 37 G free); rpi `/` 917 G, 506 G used (58 %, 374 G free); linode `/` 79 G, 29 G used (**39 %**, 46 G free — this is the backup target, and since 2026-11-19 it also hosts the `pg-wal-archive` Garage node).
### 8.1 Backup coverage
Five independent scheduled paths, all **off** the T480 and **off** the Pi:
1. **Cluster state → Linode VPS**, CronJob `forgejo/cluster-backup`
(`apps/base/forgejo/cluster-backup.yaml`; exec-only RBAC in
`apps/base/sirius-growth/backup-exec-rbac.yaml` and
`apps/base/osint/backup-exec-rbac.yaml`). Schedule `37 2 * * *`
UTC, `concurrencyPolicy: Forbid`. Destination is
`[email protected]:/root/cluster-backup` — **the mesh address, never the public
IP**. Everything is streamed: no dump is staged on siriussec.
2. **Two small PVC mirrors into the same tree**, because a PVC can only be
mounted by a pod in its own namespace: `monitoring/grafana-backup`
(`monitoring/controllers/home/grafana-backup.yaml`, `0 3 * * *`) and
`sirius-growth/leadgen-backup` (`apps/base/sirius-growth/leadgen-backup.yaml`,
`7 3 * * *`). Both mount the claim on siriussec and stream to
`[email protected]:/root/cluster-backup`, so retention and the manifest habit
are shared with path 1.
3. **Garage object store (Pi) → same Linode**, `infrastructure/garage/backup/`
`garage-meta-backup.timer` (hourly) + `garage-data-backup.timer` (nightly) →
`[email protected]:/root/garage-backup`.
4. **Point-in-time recovery for `sirius-growth/portal`**, continuous WAL archiving
+ a daily base backup straight from the CNPG operator into a **second Garage
node running on the Linode** (`infrastructure/garage-linode/`, bucket
`pg-wal-archive`, bucket-private, `10.10.0.5:3900` WireGuard-only). This is the
only path with a **sub-24 h RPO**: recovery to any second inside the last 14
days, not just "the state at 02:37". Config:
`apps/base/sirius-growth/cluster.yaml` `spec.backup.barmanObjectStore` +
`apps/base/sirius-growth/scheduled-backup.yaml` (`ScheduledBackup portal-daily`,
`20 3 * * *` UTC in **six**-field cron, seconds first).
A fifth path covers the Pi's own hub state: `infrastructure/wireguard/backup/`
`wireguard-backup.timer` (nightly 04:13) → `[email protected]:/root/pihost-backup`.
| Artifact | Method | On the Linode | Retention |
|---|---|---|---|
| `forgejo-data` PVC (`/data`) | `rsync -a --delete --link-dest` snapshot mirror, PVC mounted read-only | `forgejo-data/<stamp>/` + `latest` symlink | 7 snapshots (hardlinked: 1 full copy + nightly deltas) |
| `forgejo/pg` | `pg_dump -Fc -Z6` **inside the CNPG primary** over the local socket — no DB password exists in git or in the Job | `db/forgejo-pg-<stamp>.dump` | 14 |
| `sirius-growth/portal` | two independent copies, on purpose. **(a)** `pg_dump -Fc -Z6` **inside the CNPG primary** over the local socket, through exec RBAC in `sirius-growth` — logical, human-readable with any `pg_restore`. **(b)** barman-cloud **continuous WAL archive + daily base backup** (path 4) | (a) `db/sirius-growth-portal-<stamp>.dump`; (b) `pg-wal-archive` bucket on the Linode: `portal/base/<stamp>/` + `portal/wals/…` | (a) 14 dumps; (b) 14 days of WAL (`retentionPolicy: 14d`) |
| `osint/osint-db` (plain Postgres Deployment, has TimescaleDB + PostGIS) | `pg_dump -Fc -Z6` **inside the pod** over the local socket, using its own `POSTGRES_USER`/`POSTGRES_DB` via exec RBAC in `osint` | `db/osint-osint-db-<stamp>.dump` | 14 |
| `grafana.db` (sqlite) | **sqlite backup API** in a `python:3.12-alpine` pod that mounts the PVC — a `cp` of a live db can capture a torn page; the image is `-distroless`, so there is no shell to exec into | `grafana/grafana-<stamp>.db` | 14 |
| `sgs-leadgen-data` PVC | `rsync -a --delete --link-dest` snapshot mirror, PVC mounted read-only | `leadgen-data/<stamp>/` + `latest` | 7 |
| Pi `/etc/wireguard/` + wgportal `sqlite.db` | Pi-side systemd timer: tarball (`/etc/wireguard` verbatim incl. `.bak` history + a sqlite-API copy of the peer db), sha256 checked on both sides | `[email protected]:/root/pihost-backup/wireguard/wireguard-<stamp>.tar.gz` | 14 |
- The data mirror is a *snapshot* mirror, not a rolling one: each night writes a
new directory whose unchanged files are hardlinks to the previous night's, so
a corrupted file in the source cannot rewrite history.
- DB dumps are checksummed on **both** sides (`sha256sum` on the pod's copy of
the stream vs the remote file) before the `.part` file is renamed; a short
stream fails the Job instead of silently shipping a broken archive.
- Each run appends sizes + checksums to `/root/cluster-backup/manifests/<stamp>.txt`.
- The Job fails (a red Job, not a silent skip) if the Linode has less than
8 GiB free, so a growing registry cannot quietly eat the last snapshot's room.
- The only secret is the backup SSH key: `forgejo/cluster-backup-ssh` (created
out of band, **not in git**, so Flux never reverts it) holding an ed25519 key
that is `from="10.10.0.0/24,10.244.0.0/16,10.20.0.0/24"`-restricted,
`no-pty`, no forwarding in `root@linode:~/.ssh/authorized_keys`. Host key is
pinned (`known_hosts` for `10.10.0.5`), so a MITM on the mesh fails closed.
- The Job lives in namespace `forgejo` (not a `backup` namespace) because a PVC
cannot be mounted cross-namespace and `forgejo-data` is the largest artifact.
- **The WAL archive lives in a second Garage node on the Linode, and only there.**
Pointing barman at the Pi's Garage would put the archive in the same building,
power domain and uplink as the CNPG primary — a second copy of the same
failure. `infrastructure/garage-linode/` is a *separate* single-node store
(node `994fd2f42ae72da6`, capacity 20 GB, no relation to the Pi's
`d053db4dfc97bf78`): podman + a quadlet unit (this host has no Docker — it is a
kubelet node), `garage.toml` binding `10.10.0.5:3900`/`:3903` only, and an nft
table `inet wal_archive_guard` (PREROUTING -140) that drops 3900/3903 from
anything but `lo`/`wg0`. Measured off-mesh (from this laptop, straight to the
Linode's public IP, no VPN in the path): 3900 and 3903 **filtered**, and the
drop counter increments. Anonymous S3 GET on the bucket → **403 AccessDenied**.
- **Disk sizing for the WAL archive** *(measured 2026-11-19)*: Linode `/` is 79 G
with **46 G free**; Garage is capped at 20 GB. Actual usage after the first
base backup + 7 WAL segments: **4.9 MB** in 8 bucket objects (`data/` 9.3 MB
with Garage's block-store overhead, `meta/` 4.6 MB). `archive_timeout` is 5 min
and `wal_segment_size` 16 MB, so the archive takes at most 288 segments/day;
gzip turns a segment into 16–25 KB when the database is quiet (measured) →
~6 MB WAL/day + a 4.5 MB base backup/day ≈ **150 MB for the whole 14-day
window**. Worst case on a busy database (every segment full at a typical 3–5×
gzip ratio) is ~1.5 GB/day → 21 GB for 14 days, i.e. it would hit the 20 GB
cap. The cap is deliberate: Garage answers `507 InsufficientStorage` and
`barman-cloud-backup` fails loudly (red `Backup`/`ScheduledBackup`) rather
than filling the Linode disk. If that ever fires, the lever is
`spec.backup.retentionPolicy` (7d) — not deleting WALs by hand.
- **The barman credentials are a namespaced Secret, not git**:
`sirius-growth/portal-wal-s3` (`ACCESS_KEY_ID` / `ACCESS_SECRET_KEY` /
`REGION`), created out of band from Garage key `cnpg-portal-wal`
(`GK7f2b4bb1fc9abaec50fde37b`, scope **read+write on `pg-wal-archive` only**,
no bucket-create). Recording key IDs is fine; the values are not in git, in the
docs, or in any comment.
- **CNPG 1.30 still ships the in-tree barman-cloud integration, and it warns that
1.31 removes it** (`Warning: Native support for Barman Cloud backups and
recovery is deprecated ... Please migrate existing clusters to the new Barman
Cloud Plugin`). That is why this is on 1.30 only: the plugin (an extra
Deployment + CNPG-I registration + TLS) is the migration path, and it must land
before the operator goes to 1.31. Nothing else here changes when it does — the
bucket layout stays `portal/base` + `portal/wals`.
**Accepted gaps (with the reason, not just a TODO):**
- **Prometheus TSDB** (2.4 GiB) — deliberately excluded: regenerated metrics
history, and a volume loss only costs graphs, not state.
- **`osint/osint-camera-snapshots`** (4 K) — throwaway camera frames; the
camera re-captures on demand and nothing reads old frames.
- **Runner PVCs** (`forgejo-runner-amd64`, `*-dind`) — CI scratch, rebuildable
by design (the dind data-root only holds named build caches).
- **Grafana dashboards / datasources / alert rules are not in the backup and do
not need to be**: they are provisioned from `monitoring/controllers/home/`
in git. The sqlite db carries the parts git cannot rebuild — users, orgs,
preferences, annotations and API keys.
- **Pi `/etc/wireguard` is only as fresh as the last nightly run** — a peer
added today is in the db and on the Pi, and reaches the Linode at 04:13.
**Closed 2026-11-19 — point-in-time recovery.** There is no longer a "restore to
02:37 or lose the day" gap: `sirius-growth/portal` can be recovered to any second
inside the 14-day window, and that restore has been rehearsed end to end (§8.3).
`forgejo/pg` is deliberately **not** on barman yet — a day of git history is
annoying, not costly, and one cluster proves the pattern; `osint/osint-db` is a
plain Deployment and cannot use CNPG backup at all.
A new CloudNativePG cluster is **not** picked up automatically by either
mechanism. For dumps: add `<ns>/<cluster>` to `CNPG_TARGETS` in the CronJob env
*and* an equivalent exec-only Role/RoleBinding for the `forgejo/cluster-backup`
ServiceAccount in that namespace. For barman: add `spec.backup.barmanObjectStore`
with a `destinationPath` of `s3://pg-wal-archive` (the bucket root — the server
name, defaulting to the cluster name, becomes the prefix, so clusters share one
bucket without colliding), the same `sirius-growth/portal-wal-s3`-shaped Secret
in that namespace, and a `ScheduledBackup`.
### 8.2 Restoring
Rehearsed on 2026-11-19 (see the completion note on task `t_dcad85f6`); the DB
restore below was exercised against a throwaway Postgres pod and produced the
live row count.
```bash
# 1. Forgejo data: stop Forgejo, then mirror the newest snapshot back.
kubectl -n forgejo scale deploy/forgejo --replicas=0
# on the node holding the PVC (siriussec), or from any pod that mounts it:
# rsync -a --delete [email protected]:/root/cluster-backup/forgejo-data/latest/ /data/
kubectl -n forgejo scale deploy/forgejo --replicas=1
# 2. A CNPG database: pull the dump and restore it with pg_restore, e.g. into a
# scratch pod or a scratch database on the cluster:
ssh [email protected] 'cat /root/cluster-backup/db/forgejo-pg-<stamp>.dump' \
| kubectl -n forgejo exec -i <pod> -c postgres -- \
pg_restore -U postgres -d <target-db> --no-owner --no-privileges
```
`pg_restore` is **not** installed on the Linode — pull the dump and restore with
a Postgres client (the `ghcr.io/cloudnative-pg/postgresql:16` primary has one).
```bash
# 3. osint-db (plain Postgres **with TimescaleDB**): a naive pg_restore into a
# fresh database fails on hypertable catalog rows ("could not find hypertable
# with id N" / "ONLY option not supported on hypertable operations") and
# silently drops one hypertable's data. Pre/post-restore commands are
# mandatory, and the extensions must exist BEFORE them.
kubectl -n osint exec deploy/osint-db -- psql -U osint -d postgres \
-c 'create database osint_restore'
kubectl -n osint exec deploy/osint-db -- psql -U osint -d osint_restore \
-c 'create extension if not exists timescaledb' \
-c 'create extension if not exists postgis' \
-c 'select timescaledb_pre_restore()'
ssh [email protected] 'cat /root/cluster-backup/db/osint-osint-db-<stamp>.dump' \
| kubectl -n osint exec -i deploy/osint-db -- \
pg_restore -U osint -d osint_restore --no-owner --no-privileges
kubectl -n osint exec deploy/osint-db -- psql -U osint -d osint_restore \
-c 'select timescaledb_post_restore()'
# 4. Grafana: readable with the sqlite backup API and integrity_check=ok.
# Stop Grafana first (it also runs `strategy: Recreate`) so the restored file
# is not overwritten by the running instance's open handle.
kubectl -n monitoring scale deploy/kube-prometheus-stack-grafana --replicas=0
ssh [email protected] 'cat /root/cluster-backup/grafana/grafana-<stamp>.db' \
| kubectl -n monitoring exec -i <helper-pod-with-the-pvc-mounted> -- \
sh -c 'cat > /var/lib/grafana/grafana.db && chown 472:472 /var/lib/grafana/grafana.db'
kubectl -n monitoring scale deploy/kube-prometheus-stack-grafana --replicas=1
# Users come back from the db; dashboards/datasources re-provision from git.
# 5. Lead-gen capture: plain mirror — pull it back onto the claim with rsync.
rsync -a --delete [email protected]:/root/cluster-backup/leadgen-data/latest/ /leadgen/
# 6. Pi hub state (keys included — pull it to a root-only path, never a shared one).
ssh -i /home/sirius/.ssh/linode_admin [email protected] \
'cat /root/pihost-backup/wireguard/wireguard-<stamp>.tar.gz' | sudo tar -tzf -
# stop wg-quick first: SaveConfig = true rewrites wg0.conf from the live iface
sudo wg-quick down wg0 || true
ssh -i /home/sirius/.ssh/linode_admin [email protected] \
'cat /root/pihost-backup/wireguard/wireguard-<stamp>.tar.gz' | sudo tar -xzf - -C /
sudo systemctl start wg-quick@wg0 && sudo wg show
```
### 8.3 Point-in-time recovery (`sirius-growth/portal`)
Rehearsed end to end on **2026-11-19** (task `t_ce7d6772`) against the live
archive: a marker row was written, 10 s later a second, unwanted row was written,
and a throwaway cluster was restored with `targetTime` between the two. The
marker came back, the later row did not.
**Step 1 — establish the target time.** Take it from the data, never from
memory:
```bash
kubectl -n sirius-growth exec portal-1 -c postgres -- \
psql -U postgres -d portal -tAc "select max(updated_at) from leads" # or pg_last_xact_replay_timestamp-style reasoning
date -u +%FT%TZ
```
**Step 2 — restore into a throwaway cluster.** Never into `portal` itself while
it is serving: CNPG recovery bootstraps a *new* data dir from the archive.
```yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: portal-pitr-test
namespace: sirius-growth
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:16
storage: {size: 5Gi, storageClass: local-path}
affinity: {nodeSelector: {kubernetes.io/hostname: siriussec}}
bootstrap:
recovery:
source: portal-wal
recoveryTarget:
targetTime: "2026-11-19T22:35:15Z" # UTC, RFC3339
externalClusters:
- name: portal-wal
barmanObjectStore:
destinationPath: s3://pg-wal-archive
endpointURL: http://10.10.0.5:3900
serverName: portal # MUST be the *source* cluster name
s3Credentials:
accessKeyId: {name: portal-wal-s3, key: ACCESS_KEY_ID}
secretAccessKey: {name: portal-wal-s3, key: ACCESS_SECRET_KEY}
region: {name: portal-wal-s3, key: REGION}
```
```bash
kubectl apply -f portal-pitr-test.yaml
kubectl -n sirius-growth get cluster portal-pitr-test -w # Ready=True, "Cluster in healthy state"
```
**Step 3 — verify the cut, and then promote the result.**
```bash
# the restore must stop before the unwanted transaction
kubectl -n sirius-growth exec portal-pitr-test-1 -c postgres -- \
psql -U postgres -d portal -c "select id, note, at from <the table> order by id"
kubectl -n sirius-growth exec portal-pitr-test-1 -c postgres -- \
psql -U postgres -tAc "select pg_is_in_recovery(), pg_last_xact_replay_timestamp()"
```
`pg_is_in_recovery() = f` on a single-instance recovery cluster means replay
finished and it has already been promoted. **A recovery cluster is writable the
moment it is Ready** — do not leave `portal-pitr-test` running, and do not point
application traffic at it.
**Step 4 — make it the real one.** Two supported shapes: cut the app over to the
restored cluster (preferred — reversible), or re-point the PVC:
```bash
# cut over: patch the API/portal Deployments' POSTGRES_HOST to portal-pitr-test-rw,
# then, once verified, keep it and delete the old cluster.
# in-place: let the recovery cluster finish, stop portal, and restore the portal-1
# PVC from the test cluster's data dir — only after the app is confirmed correct.
```
**What recovery does not do:** it does not replay anything after the target, so
a "restore to now" is only as good as the last archived WAL. If
`pg_stat_archiver.failed_count` is non-zero, fix archiving *before* relying on a
timestamp near the present.
**If the archive is lost or corrupt:** fall back to the nightly `pg_dump`
(§8.2 step 2) — 24 h RPO, logical, and readable without barman. That is exactly
why `sirius-growth/portal` stayed in `CNPG_TARGETS`.
---
## 9. Known hazards and runbook pointers
### 9.1 The four that actually bite
1. **A Pi reboot loses `wg0` and silently breaks the cluster.** `wg-quick@wg0` is *enabled now* (a past gap was fixed), but after any reboot re-check the route pins: `ip route get 10.10.0.2` must say `dev wg0`. The Pi's kubelet symptom is `node "rpi" not found`, while cloudflared and Forgejo look perfectly healthy — see `references/pi-reboot-recovery.md` in the `home-k8s` skill. Work outside-in: LAN SSH → power-event check → `wg-quick@wg0` → **route pins** → per-hop curls.
2. **DiskPressure on siriussec takes the whole ingress stack with it.** Forgejo 503 from Cloudflare with `no healthy upstream` is almost always node `DiskPressure` (dind growth, §8), not the tunnel. Check `curl http://127.0.0.1:20241/ready` on rpi first; `readyConnections ≥ 1` means the tunnel is fine.
3. **`10.10.0.0/24` claimed by two interfaces on the Pi** (§3.4). Any edit to `wg-remote` AllowedIPs or a peer change can reintroduce it. Re-check both `ip route get 10.10.0.2` and `ip route get 10.10.0.5` after touching WireGuard.
4. **The T480 must boot `linux-lts`.** Running `6.18.50-2-lts` now; `7.2.3-arch1-3` is installed on disk and Cilium's BPF probe fails on it. GRUB default must stay on LTS, and never reboot onto a kernel whose `/lib/modules/$(uname -r)` was already removed by a pacman upgrade.
### 9.2 Smaller, still real
- **Leader-election fatals are an I/O-contention problem, and the two GitOps operators are now fixed for it.** The root cause is *shared-NVMe contention from CI build I/O*, not a slow or failing disk: etcd `wal_fsync` on `/dev/nvme0n1p3` (the same device as the dind data-root and `forgejo-data`) records **158 samples >8.192 s and 2,518 >2.048 s out of 14,813,192**, while 99.6 % land ≤32 ms — i.e. tail stalls of 5–10.4 s, worst **10.39 s at `2026-10-23T02:48:44Z`**. Every one of the 8 hours containing a ≥2 s stall had CI build I/O running (7 of 8 the amd64 dind runner); light deploy-only hours with the runner present produced none. A single stall exceeds client-go's 5 s lease-renewal HTTP timeout, controller-runtime reports `leader election lost`, and the manager fatals by design (`exit 1`).
- `cnpg-controller-manager` — **223 restarts / 45 d, fixed in `d5d1d28`** with `--leader-lease-duration=60 --leader-renew-deadline=45` (integer **seconds**; CNPG has no `resource-lock-timeout` flag, unlike Cilium). The same commit vendors the pinned 1.30.0 operator manifest into `infrastructure/databases/base/` and gives it its own Flux Kustomization `databases` (`prune: false` — the bundle carries the 11 CNPG CRDs, and pruning those would delete both clusters), so the args are declared state instead of a hand patch. The patch also preserves the pre-existing live deltas upstream does not ship (overlay API env `10.10.0.2:6443`, 500m/512Mi limits, 3 min startup probe). Live lease `cnpg-system/db9c8771.cnpg.io` reports `leaseDurationSeconds: 60`.
- `cilium-operator` — widened earlier in `bd5057c` (`--leader-election-lease-duration=60s`, `renew-deadline=45s`, `resource-lock-timeout=20s`) in `infrastructure/networking/cilium/values.yaml`.
- `kube-controller-manager` (~227) and `kube-scheduler` (~230) restarts are the *same stall event*, but they are kubeadm static pods, not GitOps: they were **not** changed and need their own `--leader-elect` tuning pass.
- Honest gap: one stall hour (`2026-10-24 22`, 18 events, worst 5.95 s) had **no** amd64 runner job and began the same minute a Pi-side `onionwire` job started. Unexplained but observed — do not claim dind-on-siriussec is the sole source.
- 60 s is a tourniquet, comfortably above the 10.4 s worst case; widening further fixes nothing. The remedy now shipped is **`infrastructure/node-io`** (`etcd-io-guard`, a one-node DaemonSet on siriussec): `vm.dirty_bytes=64 MiB` / `dirty_background_bytes=16 MiB` bound the host writeback backlog, and `io.max wbps=40 MiB/s` caps the **dind container's own cgroup** (never a slice — etcd is in `kubepods-burstable.slice`). Both are re-applied on drift every 30 s and re-discovered after a runner pod recreation, so a new dind cgroup is capped within one tick.
- Why not `io.latency`/iocost: this kernel exposes **no** `/sys/block/nvme0n1/queue/io.cost.*`, and cgroup-v2 applies `io.latency` targets only between **peers of the same parent** — kubelet gives every pod its own slice, so an etcd target can never throttle the dind pod (measured: dind's `io.stat` stayed `depth=max`). `io.max` is the available lever.
- Measured 2026-10-26 (identical 150 s, 4×128 MiB `dd conv=fsync` load run **inside** the dind container): worst `slow fdatasync` **1.40 s** and **1** warning line vs 11, **0** fsyncs >8.192 s, **no** apiserver/KCM/scheduler restarts during the run, and exactly 6.0 GiB written in 157 s (41 MB/s — the cap binds). Unmitigated baseline on the same device: 68.9 s / 26.6 s / 17.6 s stalls with apiserver restart and lost KCM/scheduler leases.
- Cost and limits: the 40 MiB/s cap costs ~11 % of dind write bandwidth and the 64 MiB dirty bound is host-global (every writer on siriussec). Moving the dind data-root off `/dev/nvme0n1p3` is still the only change that lets both knobs go back to default. Verify per the `node-io/README.md` checklist; `fstrim.timer` should also be enabled (it was disabled while the device reports `DISC-MAX 2T`).
- Pi ufw allows `22/tcp` from anywhere, plus `10.10.0.0/24`, `10.244.0.0/16` and `51820/udp`; the WG forward rules between `wg0` and `wg-remote` are in place. The Linode hub also needs its own `FORWARD` accepts or spoke traffic dies past the hub.
- Two stale WireGuard peers exist: mesh `10.10.0.4` (6 days, Tailscale endpoint) and Linode-hub `10.20.0.4` (no handshake). Harmless but misleading in `wg show`.
- The Pi runs **Tailscale** (`tailscale0`, `100.71.235.119`) alongside WireGuard. Do not plan recovery around Tailscale-only paths; treat WireGuard/LAN as the primary.
- Pi still runs three leftover Docker services outside Kubernetes: `registry:2` on `127.0.0.1:5000`, and two containers of site images (`handyman-site` on `:8082`, `sirius-growth-site`). The in-cluster GitOps deployments supersede the site containers; the local registry is still what `deploy-handyman.yml`/`deploy-site.yml` push to.
### 9.3 Drift found: this document vs the `home-k8s` skill
| Skill says | Reality (live 2026-10-26) |
|---|---|
| Cilium **1.18.13** | Cilium **v1.20.1**, Envoy `v1.37.5` |
| `linode` worker retired / "not down, gone" (task spec) | `linode` is **back as a Ready worker**, joined ~60 min before this reading, pod CIDR `10.244.2.0/24` |
| `linode` tainted `dedicated=network:PreferNoSchedule` | label present, **no taint** (same for rpi) |
| Public origin `10.10.0.5:8080` in the older paragraph | origin is **`10.10.0.2:8080`** (the skill's newer paragraph is right; the older one is stale) |
| Gateway listener on `10.10.0.5` / one Gateway | Gateway `public` advertises **three** addresses (`.1/.2/.5`) but only `.2:8080` completes requests; a second Gateway `internal:8081` exists |
| Garage: systemd unit, loopback only | **Docker container** `dxflrs/garage:v1.1.0`; `10.10.0.1:3900` (S3) + `10.10.0.1:3903` (metrics) + `127.0.0.1:3900`, nothing on `0.0.0.0`; compose now committed at `infrastructure/garage/` |
| wgportal is the peer manager on the Pi | **wgportal is not running** — dir + compose remain, no container, no unit; peers are edited manually |
| "Only wgportal compose should stay on the Pi" | Pi also runs `registry`, `handyman-site`, `sirius-growth-site` containers |
| PHS/piedmont pods pinned to `linode` | pinned to **siriussec** (`nodeSelector: kubernetes.io/hostname`) |
| Two Actions runners | **Three** — `forgejo-runner-deploy-arm64` (`deploy-arm64` only) added |
| — | `metrics-server` absent, so `kubectl top` does not work |
| — | `paaas.siriusdevops.com` is in the tunnel with **no** HTTPRoute → 404 |
---
## 10. Verification log
All times 2026-10-26 UTC. `kubeconfig` on the Legion admin laptop → `https://10.10.0.2:6443`; SSH `[email protected]` (rpi) and `[email protected]` (siriussec, capital L), key `~/.ssh/lancelot_priv`; Linode only via the Pi hop (`ssh -i ~/.ssh/linode_admin [email protected]`).
| # | Command | Key result |
|---|---|---|
| 1 | `kubectl get nodes -o wide` | 3 nodes, all Ready, v1.36.4, `linode` age 60 m |
| 2 | `kubectl get nodes -o json` (labels/taints/conditions) | no taints anywhere; `gateway=true` on rpi + siriussec; `dedicated=network` on rpi + linode |
| 3 | `kubectl get pods -A -o wide` | 37 rows = **31 Running** + 6 Completed |
| 4 | `kubectl get svc,ingress,httproute,gateway -A` | no Ingress objects; 4 HTTPRoutes; Gateways `public` (8080) and `internal` (8081) |
| 5 | `kubectl get pvc,pv -A`, `kubectl get sc` | 4 Bound PVs, all `local-path`, all on siriussec |
| 6 | `kubectl get cluster -A` | `forgejo/pg` and `sirius-growth/portal`, both `ClusterIsReady`, 1 instance each |
| 7 | `kubectl -n flux-system get gitrepository,kustomization -o wide` | all Ready, revision `master@sha1:bd5057c` |
| 8 | `kubectl -n kube-system get cm cilium-config -o jsonpath=…` | `routing-mode: native`, `ipv4-native-routing-cidr 10.244.0.0/16`, `kube-proxy-replacement true`, `bpf-lb-external-clusterip true` |
| 9 | `kubectl -n kube-system get ds,deploy` / image tags | cilium `v1.20.1`, envoy `v1.37.5` |
| 10 | `kubectl -n kube-system exec ds/cilium -- cilium-dbg status --brief` | `OK` |
| 11 | `kubectl top nodes` | `error: Metrics API not available` → no metrics-server |
| 12 | `kubectl -n forgejo get deploy -o json` | 3 runner Deployments + nodeSelectors; pod/container securityContext as documented |
| 13 | `kubectl -n forgejo get cm forgejo-runner-config -o jsonpath` | three TOMLs: `amd64.toml`, `arm64.toml`, `deploy-arm64.toml`, all `capacity: 1` |
| 14 | `kubectl -n forgejo exec deploy/forgejo -- forgejo --version` | `16.0.5` |
| 15 | rpi: `sudo wg show` | `wg0` 3 peers (handshakes 1 min / 48 min / 6 d); `wg-remote` 1 peer, 35 s |
| 16 | rpi: `sudo wg show wg0 dump \| wc -l` | `4` |
| 17 | rpi: `systemctl is-enabled/is-active wg-quick@{wg0,wg-remote} cloudflared` | enabled/enabled/enabled; active state: wg0 **inactive**, wg-remote **active** |
| 18 | rpi: `ip route get 10.10.0.2 / 10.10.0.5 / 10.10.0.3` | `dev wg0` / `dev wg-remote` / `dev wg0` — pins correct |
| 19 | rpi: `curl -s http://127.0.0.1:20241/ready` | `{"status":200,"readyConnections":4}` |
| 20 | rpi: `curl -s http://127.0.0.1:20241/config` | 8 hostnames + catch-all, **all** → `http://10.10.0.2:8080` |
| 21 | rpi: `curl -H 'Host: <h>' http://10.10.0.2:8080/` ×5 | 200/31813 / 200/15008 / 200/72640 / 200/7067 / **404 paaas** |
| 22 | rpi: same against `10.10.0.1:8080` and `10.10.0.5:8080` | rpi → **503 in 5.000 s**; linode → no listener (000) |
| 23 | Cloudflare API `GET /accounts/…/cfd_tunnel` | `sirius home` healthy, 4 connections; `piedmontomesvc` tunnel inactive, 0 |
| 24 | rpi: `docker ps -a` | garage, registry, handyman-site, sirius-growth-site up; **no wg-portal**; 5 exited `onionwire-ci-*` containers |
| 25 | rpi: `docker exec garage /garage status` and `bucket list` | node `d053db4dfc97bf78` healthy, 3 buckets |
| 26 | rpi: `ss -ltnp \| grep 390` | `127.0.0.1:3900` **and `10.10.0.1:3900`/`:3903`** — no `0.0.0.0`, no 3901/3902 |
| 27 | rpi: `df -h`, `free -h`, `vcgencmd get_throttled` | 58% used; 7.9 GiB RAM; `throttled=0x0` |
| 28 | siriussec: `wg show` | peer = Pi hub, `AllowedIPs 10.10.0.0/24, 10.244.0.0/16`, handshake 1 min |
| 29 | siriussec: `sudo nft list table inet k8s-api` | lo / wg0 / `10.244.0.0/16` accept, else drop |
| 30 | siriussec: `sudo du -sh /opt/local-path-provisioner/pvc-*` | 224 M / 643 M / 12 G / **18 G** (dind) |
| 31 | siriussec: `uname -r`, `pacman -Q linux-lts` | `6.18.50-2-lts`; `7.2.3-arch1-3` also installed |
| 32 | linode (via Pi hop): `hostname`, `ip -br addr`, `wg show wg0` | `dummy-k8s 10.10.0.5/32`, `wg0 10.20.0.1/24`, 4 peers, uptime 3 d 17 h |
**CNPG leader-election fix, re-verified 2026-10-26 19:37–19:45 UTC (commit `d5d1d28`):**
| # | Command | Key result |
|---|---|---|
| 33 | `kubectl -n cnpg-system get deploy cnpg-controller-manager` (`--show-managed-fields`) | args `--leader-lease-duration=60`, `--leader-renew-deadline=45`; preserved `KUBERNETES_SERVICE_HOST=10.10.0.2`, 500m/512Mi, startupProbe 36; managedFields owner `kustomize-controller` `Apply` → Flux owns it |
| 34 | `kubectl -n cnpg-system get lease db9c8771.cnpg.io -o jsonpath` | `leaseDurationSeconds: 60` (was 15), holder = new pod `78484bd58d-m6rtk`, `renewTime` advancing; `leader election lost` count in the new pod's log: **0**; restarts 223 → **0** on the new ReplicaSet |
| 35 | `kubectl -n flux-system get kustomization`; `kubectl get cluster -A` | new `databases` Kustomization `Ready=True` at `master@sha1:d5d1d28`; all 5 Ready; `forgejo/pg` + `sirius-growth/portal` both `Ready=True`; `forgejo.siriusdevops.com` **200** public and `Host:` curl to `10.10.0.2:8080` **200** |
| 36 | siriussec: `curl :2381/metrics` (etcd) | `wal_fsync` 158 >8.192 s / 2,518 >2.048 s of 14,813,192; `backend_commit` 187 >8.192 s of 6,652,027; 99.6 %/99.7 % ≤32 ms — matches the stated stall profile, so this is spiky contention, not a failing disk |
**Not verified, deliberately:** Cloudflare DNS records, Forgejo's `app.ini`, any secret material, and the SG-VPS/phone spoke routing beyond what the Linode's `wg show` reports.