monitoring: replace the dead kubelet_volume_stats alerts with runner-scoped disk rules

kubelet_volume_stats_* was an ALPHA metric set served from kubelet's
/metrics/volumes endpoint; that endpoint returns 404 on every node of this
cluster (kubelet v1.36.4 — upstream loss in 1.34, kubernetes#133847), and
/metrics carries no volume-stats series. RunnerDindPvcHighWatermark and
RunnerDindPvcCritical therefore could never fire while showing as healthy.

Per-PVC bytes are not measurable here and no scrape config can change that,
so the pair is replaced by RunnerDindDiskHighWatermark (80%) and
RunnerDindDiskCritical (90%): root-filesystem usage on nodes that actually
run a forgejo-runner pod, which is the filesystem holding the dind data-root
under /opt/local-path-provisioner. New arm64 dind PVCs are covered as soon
as their runner is scheduled; nodes without runners (linode) do not
duplicate the generic disk-capacity group.

Also corrects the cause in docs, the dashboard notes and the prune CronJob
comment (it is not a hostPath quirk, the endpoint is gone).
This commit is contained in:
Lance Walters 2026-10-27 02:05:57 -04:00
commit e572f84b0b
8 changed files with 145 additions and 80 deletions

View file

@ -418,18 +418,23 @@ went `Pending` for days. What exists today (all live, all GitOps):
**`docker volume prune` is forbidden** so `onionwire-target-ci` survives.
Requirement for the cutover: name the container `dind` and keep
`app: forgejo-runner` (§1.6).
2. **Alerts exist, but know their blind spot.** `monitoring/controllers/home/prune-alerts.yaml`
ships `RunnerDindPvcHighWatermark` (85 %) and `RunnerDindPvcCritical` (95 %)
on `kubelet_volume_stats_used_bytes{persistentvolumeclaim=~"forgejo-runner-.*"}`
— and the file's own comment says this kubelet exports **no**
`kubelet_volume_stats_*` series, i.e. those two will not fire for a hostPath
PV (which is what §6.1 recommends). The honest guard today is
`NodeFilesystemFillingUp` at **> 85 %** of rpi's root and
`NodeFilesystemCritical` at > 92 %: 85 % of 917 G leaves **137 G** — plenty
to act on, but only if someone is watching. **Recommended addition for card
2**: a Pi-specific rule at 70 % (`node_filesystem_avail_bytes{mountpoint="/",
instance=~"10.10.0.1:.*"} < 275e9`), because rpi now carries 240 GiB of CI
PVCs on the same filesystem as the kubelet.
2. **The alerts are node-scoped, because per-PVC bytes do not exist.** The old
`RunnerDindPvcHighWatermark` / `RunnerDindPvcCritical` pair was **deleted** —
it selected `kubelet_volume_stats_*`, which kubelet 1.34+ no longer exports at
all (`/metrics/volumes` 404s on every node here; upstream
kubernetes/kubernetes#133847), so it could never fire for *any* volume type,
hostPath or not. `monitoring/controllers/home/prune-alerts.yaml` instead ships
two complementary node-filesystem guards, both on the disk that holds the
dind data-root:
- `dind-disk-cap` → `RpiDindDataRootFillingUp` (**> 70 %** on rpi), which landed
with the arm64 cutover: 70 % of 917 G still leaves the room to run the prune
job, and a static PV does not enforce its claim;
- `forgejo-prune` → `RunnerDindDiskHighWatermark` (**> 80 %**) and
`RunnerDindDiskCritical` (**> 90 %**) on every *other* node that runs a
`forgejo-runner` pod (i.e. siriussec; `nodename!="rpi"` keeps the Pi from
being paged twice) with the runner-specific runbook.
Both sit inside `NodeFilesystemFillingUp` (**> 85 %**) / `NodeFilesystemCritical`
(**> 92 %**), which still cover every node as the backstop.
3. **A dedicated data-root per runner** (200 GiB + 40 GiB PVCs) so a runaway
cache cannot touch the 26 GB of unrelated host volumes on the same disk, and
so `docker system df -v` inside each pod attributes growth to one runner.
@ -797,7 +802,7 @@ dind Deployments.
| `homek8s/apps/base/forgejo/runner-deploy-arm64.yaml` | dind rewrite + guarded init container | |
| `homek8s/apps/base/forgejo/runner-configmap.yaml` | `arm64.toml`/`deploy-arm64.toml` (§6.2) | |
| `homek8s/apps/base/forgejo/prune-cronjob.yaml` | **no change** — it already prunes every dind by label; only the naming contract matters (`app=forgejo-runner` + a container named `dind`) | §1.6 |
| `homek8s/monitoring/controllers/home/prune-alerts.yaml` | optional: a rpi-specific 70 % node-fs rule, because the `RunnerDindPvc*` rules cannot fire for hostPath PVs | §4.4 |
| `homek8s/monitoring/controllers/home/prune-alerts.yaml` | **already done**: `RpiDindDataRootFillingUp` (rpi, 70 %) plus `RunnerDindDisk*` (80 % / 90 %, other runner nodes) | §4.4 |
| `homek8s/apps/base/forgejo/{pv,pvc}.yaml` (new) | 2 PVs, 2 PVCs, `local-static` SC | §6.1 |
| Pi `/home/sirius/websites/docker-compose.yml` | add `10.10.0.1:5000:5000` to `registry` | §8 |
@ -840,5 +845,7 @@ targets loopback and gets `Connection refused` from inside dind. Disk is not the
constraint (240 GiB of 387 GiB free, 146.5 GiB measured steady state); the
constraint is that a static PV does not enforce that 240 GiB either — the nightly
prune already reaches dind daemons by label (so it needs no change, only the
`dind` container name), but the `RunnerDindPvc*` alerts cannot fire for hostPath
PVs, so a Pi-specific 70 % node-fs rule should land with the cutover.
`dind` container name), and rpi's root filesystem is capped by
`RpiDindDataRootFillingUp` at 70 % (`dind-disk-cap` group) — per-PVC bytes are
simply not exported by kubelet 1.34+, so the filesystem is the only honest
measure.