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:
parent
131b9bc7c9
commit
e572f84b0b
8 changed files with 145 additions and 80 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -414,9 +414,9 @@ kubectl -n forgejo logs job/prune-manual-<ts> -c dind-daemons # every dind da
|
|||
**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.
|
||||
- `kubelet_volume_stats_used_bytes` / `_capacity_bytes` **do not exist on this cluster**. kubelet v1.36.4 exposes `kubelet_volume_metric_collection_duration_seconds` but no volume stats for any node (`kubectl get --raw /api/v1/nodes/<node>/proxy/metrics | grep volume_stats` is empty, zero series in Prometheus). The per-PVC rules in `monitoring/controllers/home/prune-alerts.yaml` are therefore correct-but-inert; live coverage is the node-filesystem alert, because every local-path PV lives on siriussec's `/`.
|
||||
- **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.
|
||||
|
||||
**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 `RunnerDindPvcHighWatermark` / `RunnerDindPvcCritical` (85 % / 95 %, inert as above). Alertmanager is disabled in this stack, so they surface in Prometheus → Alerts and Grafana → Alerting, not as pages.
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -213,11 +213,14 @@ deploying another exporter.
|
|||
kube-state-metrics see only the runner pod. Per-job CPU/mem/disk on rpi is
|
||||
therefore unavailable — the board shows rpi's root filesystem instead, because
|
||||
that is where those containers write.
|
||||
- **No per-PV usage.** local-path provisions `hostPath` PVs; kubelet publishes no
|
||||
`kubelet_volume_stats_used_bytes` for hostPath volumes (on this cluster the only
|
||||
`kubelet_volume_*` series are the collector-duration histograms). The dind PVC's
|
||||
- **No per-PV usage.** kubelet 1.34+ no longer exports the alpha
|
||||
`kubelet_volume_stats_*` metrics: its `/metrics/volumes` endpoint 404s on every
|
||||
node here (kubelet v1.36.4, upstream kubernetes/kubernetes#133847), so there is
|
||||
nothing to chart per PV and no scrape config would change that. The dind PVC's
|
||||
20Gi is shown as *requested capacity* next to siriussec's root-filesystem usage,
|
||||
which is the number that actually produced the DiskPressure evictions.
|
||||
which is the number that actually produced the DiskPressure evictions — and the
|
||||
same filesystem is what `RunnerDindDiskHighWatermark` / `RunnerDindDiskCritical`
|
||||
alert on, scoped to nodes that run a runner.
|
||||
- **Single-instance Postgres.** Both clusters run `instances: 1`, so replication
|
||||
lag, streaming replicas and in-recovery are structurally zero. The panels show
|
||||
the zero and say why instead of being hidden.
|
||||
|
|
|
|||
Loading…
Reference in a new issue