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
|
|
@ -29,7 +29,8 @@
|
||||||
# Named volumes are NEVER pruned (docker volume prune is forbidden): they hold
|
# Named volumes are NEVER pruned (docker volume prune is forbidden): they hold
|
||||||
# the shared CI caches (onionwire-target-ci, the Android SDK/Gradle/registry
|
# the shared CI caches (onionwire-target-ci, the Android SDK/Gradle/registry
|
||||||
# volumes). Their sizes are printed every run and their growth is covered by
|
# volumes). Their sizes are printed every run and their growth is covered by
|
||||||
# the `RunnerDindPvc*` / `NodeFilesystemFillingUp` alerts.
|
# the `RunnerDindDisk*` / `NodeFilesystemFillingUp` alerts (per-PVC bytes are
|
||||||
|
# not exported by kubelet 1.34+, so those alerts are node-filesystem scoped).
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ServiceAccount
|
kind: ServiceAccount
|
||||||
metadata:
|
metadata:
|
||||||
|
|
|
||||||
|
|
@ -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.
|
**`docker volume prune` is forbidden** so `onionwire-target-ci` survives.
|
||||||
Requirement for the cutover: name the container `dind` and keep
|
Requirement for the cutover: name the container `dind` and keep
|
||||||
`app: forgejo-runner` (§1.6).
|
`app: forgejo-runner` (§1.6).
|
||||||
2. **Alerts exist, but know their blind spot.** `monitoring/controllers/home/prune-alerts.yaml`
|
2. **The alerts are node-scoped, because per-PVC bytes do not exist.** The old
|
||||||
ships `RunnerDindPvcHighWatermark` (85 %) and `RunnerDindPvcCritical` (95 %)
|
`RunnerDindPvcHighWatermark` / `RunnerDindPvcCritical` pair was **deleted** —
|
||||||
on `kubelet_volume_stats_used_bytes{persistentvolumeclaim=~"forgejo-runner-.*"}`
|
it selected `kubelet_volume_stats_*`, which kubelet 1.34+ no longer exports at
|
||||||
— and the file's own comment says this kubelet exports **no**
|
all (`/metrics/volumes` 404s on every node here; upstream
|
||||||
`kubelet_volume_stats_*` series, i.e. those two will not fire for a hostPath
|
kubernetes/kubernetes#133847), so it could never fire for *any* volume type,
|
||||||
PV (which is what §6.1 recommends). The honest guard today is
|
hostPath or not. `monitoring/controllers/home/prune-alerts.yaml` instead ships
|
||||||
`NodeFilesystemFillingUp` at **> 85 %** of rpi's root and
|
two complementary node-filesystem guards, both on the disk that holds the
|
||||||
`NodeFilesystemCritical` at > 92 %: 85 % of 917 G leaves **137 G** — plenty
|
dind data-root:
|
||||||
to act on, but only if someone is watching. **Recommended addition for card
|
- `dind-disk-cap` → `RpiDindDataRootFillingUp` (**> 70 %** on rpi), which landed
|
||||||
2**: a Pi-specific rule at 70 % (`node_filesystem_avail_bytes{mountpoint="/",
|
with the arm64 cutover: 70 % of 917 G still leaves the room to run the prune
|
||||||
instance=~"10.10.0.1:.*"} < 275e9`), because rpi now carries 240 GiB of CI
|
job, and a static PV does not enforce its claim;
|
||||||
PVCs on the same filesystem as the kubelet.
|
- `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
|
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
|
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.
|
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-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/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/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 |
|
| `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 |
|
| 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 (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
|
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
|
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
|
`dind` container name), and rpi's root filesystem is capped by
|
||||||
PVs, so a Pi-specific 70 % node-fs rule should land with the cutover.
|
`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):
|
**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.
|
- 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
|
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
|
therefore unavailable — the board shows rpi's root filesystem instead, because
|
||||||
that is where those containers write.
|
that is where those containers write.
|
||||||
- **No per-PV usage.** local-path provisions `hostPath` PVs; kubelet publishes no
|
- **No per-PV usage.** kubelet 1.34+ no longer exports the alpha
|
||||||
`kubelet_volume_stats_used_bytes` for hostPath volumes (on this cluster the only
|
`kubelet_volume_stats_*` metrics: its `/metrics/volumes` endpoint 404s on every
|
||||||
`kubelet_volume_*` series are the collector-duration histograms). The dind PVC's
|
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,
|
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
|
- **Single-instance Postgres.** Both clusters run `instances: 1`, so replication
|
||||||
lag, streaming replicas and in-recovery are structurally zero. The panels show
|
lag, streaming replicas and in-recovery are structurally zero. The panels show
|
||||||
the zero and say why instead of being hidden.
|
the zero and say why instead of being hidden.
|
||||||
|
|
|
||||||
|
|
@ -219,10 +219,12 @@ runner liveness as *Forgejo* sees it (`action_runner.last_online`), queue depth
|
||||||
plain host containers with no pod identity. cAdvisor/kube-state-metrics see only the runner
|
plain host containers with no pod identity. cAdvisor/kube-state-metrics see only the runner
|
||||||
pod itself. There is no per-job CPU/mem/disk on rpi and there cannot be one without changing
|
pod itself. There is no per-job CPU/mem/disk on rpi and there cannot be one without changing
|
||||||
the runner to dind — which this board deliberately does not propose.
|
the runner to dind — which this board deliberately does not propose.
|
||||||
- **Per-PV bytes for the dind PVC.** local-path PVs are `hostPath`, and kubelet publishes no
|
- **Per-PV bytes for the dind PVC.** kubelet 1.34+ no longer exports the alpha
|
||||||
`kubelet_volume_stats_*` for hostPath volumes (verified: the only `kubelet_volume_*` series on
|
`kubelet_volume_stats_*` set at all: its `/metrics/volumes` endpoint returns 404 on every node
|
||||||
this cluster are the collector-duration histograms). The usable proxy is siriussec's root
|
here (kubelet v1.36.4; upstream kubernetes/kubernetes#133847), so no scrape config can produce
|
||||||
filesystem usage plus the PVC's requested size, both on this row.
|
those series and it is not a hostPath quirk. The usable proxy is the runner node's root
|
||||||
|
filesystem usage plus the PVC's requested size, both on this row — and the `RunnerDindDisk*`
|
||||||
|
alerts watch that same filesystem, scoped to nodes that run a runner.
|
||||||
""", {"h": 7, "w": 24, "x": 0, "y": 33}),
|
""", {"h": 7, "w": 24, "x": 0, "y": 33}),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -364,10 +366,10 @@ workloads = [
|
||||||
desc="Root filesystem per node — the local-path PVs, the dind data-root and the Pi's host-docker job containers all land on these."),
|
desc="Root filesystem per node — the local-path PVs, the dind data-root and the Pi's host-docker job containers all land on these."),
|
||||||
|
|
||||||
note("Known unknowns on this board", """\
|
note("Known unknowns on this board", """\
|
||||||
- **PVC usage is not charted, only requested capacity.** local-path provisions `hostPath` PVs and kubelet
|
- **PVC usage is not charted, only requested capacity.** kubelet 1.34+ dropped the alpha
|
||||||
publishes no `kubelet_volume_stats_used_bytes` for them (this cluster only emits the
|
`kubelet_volume_stats_*` metrics (its `/metrics/volumes` endpoint 404s on every node here), so
|
||||||
`kubelet_volume_metric_collection_duration_seconds` histograms). Node filesystem usage is the honest
|
there is nothing to chart per PV. Node filesystem usage is the honest proxy for "how full is
|
||||||
proxy for "how full is the disk these PVs live on".
|
the disk these PVs live on".
|
||||||
- **Namespaces are not filtered.** With this few workloads an unfiltered board is more useful than a
|
- **Namespaces are not filtered.** With this few workloads an unfiltered board is more useful than a
|
||||||
variable that hides the one namespace you needed to see.
|
variable that hides the one namespace you needed to see.
|
||||||
- **No Alertmanager.** Alerts from `PrometheusRule` objects are visible in Prometheus /alerts and in
|
- **No Alertmanager.** Alerts from `PrometheusRule` objects are visible in Prometheus /alerts and in
|
||||||
|
|
|
||||||
|
|
@ -1201,7 +1201,7 @@ data:
|
||||||
"showLineNumbers": false,
|
"showLineNumbers": false,
|
||||||
"showMiniMap": false
|
"showMiniMap": false
|
||||||
},
|
},
|
||||||
"content": "**Measured:** runner Deployments (kube-state-metrics), runner pods CPU/mem/net/restarts (cAdvisor),\nrunner liveness as *Forgejo* sees it (`action_runner.last_online`), queue depth and job outcomes\n(`action_run_job` via the CNPG exporter), and the host filesystems that CI fills (node-exporter).\n\n**Not measurable \u2014 by design, not by omission:**\n\n- **Per-job breakdown on the arm64 runner.** `forgejo-runner-arm64` and\n `forgejo-runner-deploy-arm64` drive the **host** Docker socket (gid 984), so their jobs are\n plain host containers with no pod identity. cAdvisor/kube-state-metrics see only the runner\n pod itself. There is no per-job CPU/mem/disk on rpi and there cannot be one without changing\n the runner to dind \u2014 which this board deliberately does not propose.\n- **Per-PV bytes for the dind PVC.** local-path PVs are `hostPath`, and kubelet publishes no\n `kubelet_volume_stats_*` for hostPath volumes (verified: the only `kubelet_volume_*` series on\n this cluster are the collector-duration histograms). The usable proxy is siriussec's root\n filesystem usage plus the PVC's requested size, both on this row.\n"
|
"content": "**Measured:** runner Deployments (kube-state-metrics), runner pods CPU/mem/net/restarts (cAdvisor),\nrunner liveness as *Forgejo* sees it (`action_runner.last_online`), queue depth and job outcomes\n(`action_run_job` via the CNPG exporter), and the host filesystems that CI fills (node-exporter).\n\n**Not measurable \u2014 by design, not by omission:**\n\n- **Per-job breakdown on the arm64 runner.** `forgejo-runner-arm64` and\n `forgejo-runner-deploy-arm64` drive the **host** Docker socket (gid 984), so their jobs are\n plain host containers with no pod identity. cAdvisor/kube-state-metrics see only the runner\n pod itself. There is no per-job CPU/mem/disk on rpi and there cannot be one without changing\n the runner to dind \u2014 which this board deliberately does not propose.\n- **Per-PV bytes for the dind PVC.** kubelet 1.34+ no longer exports the alpha\n `kubelet_volume_stats_*` set at all: its `/metrics/volumes` endpoint returns 404 on every node\n here (kubelet v1.36.4; upstream kubernetes/kubernetes#133847), so no scrape config can produce\n those series and it is not a hostPath quirk. The usable proxy is the runner node's root\n filesystem usage plus the PVC's requested size, both on this row \u2014 and the `RunnerDindDisk*`\n alerts watch that same filesystem, scoped to nodes that run a runner.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1141,7 +1141,7 @@ data:
|
||||||
"showLineNumbers": false,
|
"showLineNumbers": false,
|
||||||
"showMiniMap": false
|
"showMiniMap": false
|
||||||
},
|
},
|
||||||
"content": "- **PVC usage is not charted, only requested capacity.** local-path provisions `hostPath` PVs and kubelet\n publishes no `kubelet_volume_stats_used_bytes` for them (this cluster only emits the\n `kubelet_volume_metric_collection_duration_seconds` histograms). Node filesystem usage is the honest\n proxy for \"how full is the disk these PVs live on\".\n- **Namespaces are not filtered.** With this few workloads an unfiltered board is more useful than a\n variable that hides the one namespace you needed to see.\n- **No Alertmanager.** Alerts from `PrometheusRule` objects are visible in Prometheus /alerts and in\n Grafana \u2192 Alerting, but nothing pages.\n"
|
"content": "- **PVC usage is not charted, only requested capacity.** kubelet 1.34+ dropped the alpha\n `kubelet_volume_stats_*` metrics (its `/metrics/volumes` endpoint 404s on every node here), so\n there is nothing to chart per PV. Node filesystem usage is the honest proxy for \"how full is\n the disk these PVs live on\".\n- **Namespaces are not filtered.** With this few workloads an unfiltered board is more useful than a\n variable that hides the one namespace you needed to see.\n- **No Alertmanager.** Alerts from `PrometheusRule` objects are visible in Prometheus /alerts and in\n Grafana \u2192 Alerting, but nothing pages.\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -8,21 +8,31 @@
|
||||||
# What is measurable here:
|
# What is measurable here:
|
||||||
# - node filesystem utilisation per node (node-exporter, all three nodes);
|
# - node filesystem utilisation per node (node-exporter, all three nodes);
|
||||||
# on siriussec the local-path PVs — including the runner's dind data-root —
|
# on siriussec the local-path PVs — including the runner's dind data-root —
|
||||||
# live on `/`, so this is the DiskPressure precursor and the PVC watchdog
|
# live on `/`, so this is the DiskPressure precursor and the closest thing
|
||||||
# in one series.
|
# to a PVC watchdog this cluster can have (runner-scoped rules below).
|
||||||
# - CronJob last-success timestamp and Job failure counters
|
# - CronJob last-success timestamp and Job failure counters
|
||||||
# (kube-state-metrics).
|
# (kube-state-metrics).
|
||||||
#
|
#
|
||||||
# What is NOT measurable here: kubelet_volume_stats_* does not exist on this
|
# What is NOT measurable here — per-PVC bytes. kubelet_volume_stats_* was an
|
||||||
# cluster. Verified 2026-10-27: kubelet v1.36.4 exposes
|
# ALPHA metric set served from kubelet's /metrics/volumes endpoint; that
|
||||||
# kubelet_volume_metric_collection_duration_seconds but no
|
# endpoint is gone in this cluster's kubelet. Verified 2026-10-27 on kubelet
|
||||||
# kubelet_volume_stats_used_bytes / _capacity_bytes on any node
|
# v1.36.4: `https://<node>:10250/metrics/volumes` returns **404 on all three
|
||||||
# (`kubectl get --raw /api/v1/nodes/<node>/proxy/metrics | grep volume_stats`
|
# nodes** (10.10.0.2 / 10.10.0.1 / 10.10.0.5) while /metrics, /metrics/probes,
|
||||||
# is empty, and Prometheus has zero series). So the per-PVC rules below are
|
# /metrics/cadvisor and /metrics/resource return 200, `/metrics` contains no
|
||||||
# written against those metric names but stay inert until a kubelet exports
|
# kubelet_volume_stats_* series at all, and Prometheus has zero series for
|
||||||
# them; the node-filesystem rules are the live coverage. Per-PVC and per-Docker
|
# either name. This is the upstream loss of the alpha volume-stats metrics in
|
||||||
# -volume sizes are printed by the prune job every night
|
# kubelet 1.34 (kubernetes/kubernetes#133847, regression fix #133890), not a
|
||||||
# (`docker system df -v`), which is the record of growth.
|
# hostPath/PVC-type quirk and not something a scrape config can bring back:
|
||||||
|
# there is no endpoint left to scrape, and re-deriving it would mean a new
|
||||||
|
# exporter parsing kubelet's /stats/summary JSON (new Deployment + nodes/stats
|
||||||
|
# RBAC) — out of proportion for a three-node lab. So: no alert here selects a
|
||||||
|
# metric that does not exist. Coverage is the node filesystem that actually
|
||||||
|
# holds the data: `RunnerDindDisk*` below (runner-scoped, 80/90 %, every node
|
||||||
|
# running a runner except rpi), `RpiDindDataRootFillingUp` in group
|
||||||
|
# `dind-disk-cap` (rpi, 70 %, because its 240 GiB of dind PVCs sit on a 917 G
|
||||||
|
# disk) and the generic `disk-capacity` group (85/92 %). Per-PVC and
|
||||||
|
# per-Docker-volume sizes are still printed by the prune job every night
|
||||||
|
# (`docker system df -v`) — that output is the record of growth.
|
||||||
#
|
#
|
||||||
# Alertmanager is disabled in this stack (monitoring card), so these surface in
|
# Alertmanager is disabled in this stack (monitoring card), so these surface in
|
||||||
# Prometheus → Alerts and Grafana → Alerting. No external receiver is added.
|
# Prometheus → Alerts and Grafana → Alerting. No external receiver is added.
|
||||||
|
|
@ -81,60 +91,102 @@ spec:
|
||||||
not reachable over the exec API, so that daemon is growing
|
not reachable over the exec API, so that daemon is growing
|
||||||
unpruned. One retry is allowed by backoffLimit; persistent
|
unpruned. One retry is allowed by backoffLimit; persistent
|
||||||
failures need the RBAC or the pod checked.
|
failures need the RBAC or the pod checked.
|
||||||
# Per-PVC rules: correct expressions, currently inert (see the header —
|
# Runner-scoped filesystem rules: this is the honest replacement for the
|
||||||
# this cluster's kubelet exports no kubelet_volume_stats_* series). They
|
# old per-PVC pair (kubelet_volume_stats_* has no producer — header).
|
||||||
# start working the day that comes back, and they cost nothing until
|
# They measure the filesystem that actually backs the dind data-root, on
|
||||||
# then. Coverage today is NodeFilesystemFillingUp on siriussec, where
|
# the nodes that actually run a forgejo-runner pod. On siriussec that is
|
||||||
# every local-path PV physically lives.
|
# /opt/local-path-provisioner/pvc-*_forgejo_forgejo-runner-amd64 (dind's
|
||||||
- alert: RunnerDindPvcHighWatermark
|
# /var/lib/docker) on the root ext4.
|
||||||
|
# Scoping by *pod* rather than by PVC name is deliberate: the PVCs are
|
||||||
|
# shared-filesystem consumers, arm64 dind PVCs are covered the moment
|
||||||
|
# their runner pod is scheduled, and nodes that run no runner (linode) do
|
||||||
|
# not duplicate the generic disk-capacity group.
|
||||||
|
# rpi is deliberately excluded (nodename!="rpi"): it carries 240 GiB of
|
||||||
|
# dind PVCs on a 917 G disk, so 80 % (~734 G) would be far too late to run
|
||||||
|
# the prune job. Group `dind-disk-cap` holds its tighter 70 % cap
|
||||||
|
# (RpiDindDataRootFillingUp). Two rules, two disks, no double page.
|
||||||
|
# Thresholds here are 5 points tighter than NodeFilesystemFillingUp /
|
||||||
|
# Critical so CI fill is reported as CI fill, with the runner runbook.
|
||||||
|
- alert: RunnerDindDiskHighWatermark
|
||||||
expr: |
|
expr: |
|
||||||
max by (namespace, persistentvolumeclaim) (
|
(
|
||||||
kubelet_volume_stats_used_bytes{namespace="forgejo", persistentvolumeclaim=~"forgejo-runner-.*"}
|
(
|
||||||
)
|
(
|
||||||
/
|
1 - (
|
||||||
max by (namespace, persistentvolumeclaim) (
|
node_filesystem_avail_bytes{mountpoint="/", fstype=~"ext4|xfs|btrfs"}
|
||||||
kubelet_volume_stats_capacity_bytes{namespace="forgejo", persistentvolumeclaim=~"forgejo-runner-.*"}
|
/
|
||||||
) > 0.85
|
node_filesystem_size_bytes{mountpoint="/", fstype=~"ext4|xfs|btrfs"}
|
||||||
for: 15m
|
)
|
||||||
|
) * on (instance) group_left (nodename) node_uname_info{nodename!="rpi"}
|
||||||
|
)
|
||||||
|
and on (nodename)
|
||||||
|
label_replace(
|
||||||
|
max by (node) (kube_pod_info{namespace="forgejo", pod=~"forgejo-runner-.*"}),
|
||||||
|
"nodename", "$1", "node", "(.+)"
|
||||||
|
)
|
||||||
|
) > 0.80
|
||||||
|
for: 30m
|
||||||
labels:
|
labels:
|
||||||
severity: warning
|
severity: warning
|
||||||
annotations:
|
annotations:
|
||||||
summary: >-
|
summary: >-
|
||||||
dind PVC {{ $labels.persistentvolumeclaim }} is over 85% full
|
{{ $labels.nodename }} is {{ $value | humanizePercentage }} full —
|
||||||
|
the filesystem carrying this node's Forgejo runner dind data-root
|
||||||
description: >-
|
description: >-
|
||||||
The image/build-cache/volume footprint on this runner's dind
|
A forgejo-runner pod runs on {{ $labels.nodename }}, and the dind
|
||||||
daemon is approaching the 20Gi PVC. Inspect it with
|
data-root lives under /opt/local-path-provisioner on this node's
|
||||||
`kubectl -n forgejo exec <runner-pod> -c dind -- docker system df -v`;
|
root filesystem, so CI images, build cache and named volumes fill
|
||||||
the nightly prune caps build cache but never deletes named
|
the same disk as Forgejo/Postgres (siriussec) or the host Docker
|
||||||
volumes.
|
daemon (rpi). Per-PVC bytes cannot be measured here — kubelet 1.34+
|
||||||
- alert: RunnerDindPvcCritical
|
no longer exports kubelet_volume_stats_* and /metrics/volumes is
|
||||||
|
404 — so this node-level rule is the guard. Inspect the offenders:
|
||||||
|
`kubectl -n forgejo exec <runner-pod> -c dind -- docker system df -v`
|
||||||
|
and `du -sh /opt/local-path-provisioner/pvc-*` on the node, then let
|
||||||
|
the nightly prune reclaim (or force it: kubectl -n forgejo create job
|
||||||
|
--from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)).
|
||||||
|
- alert: RunnerDindDiskCritical
|
||||||
expr: |
|
expr: |
|
||||||
max by (namespace, persistentvolumeclaim) (
|
(
|
||||||
kubelet_volume_stats_used_bytes{namespace="forgejo", persistentvolumeclaim=~"forgejo-runner-.*"}
|
(
|
||||||
)
|
(
|
||||||
/
|
1 - (
|
||||||
max by (namespace, persistentvolumeclaim) (
|
node_filesystem_avail_bytes{mountpoint="/", fstype=~"ext4|xfs|btrfs"}
|
||||||
kubelet_volume_stats_capacity_bytes{namespace="forgejo", persistentvolumeclaim=~"forgejo-runner-.*"}
|
/
|
||||||
) > 0.95
|
node_filesystem_size_bytes{mountpoint="/", fstype=~"ext4|xfs|btrfs"}
|
||||||
for: 5m
|
)
|
||||||
|
) * on (instance) group_left (nodename) node_uname_info{nodename!="rpi"}
|
||||||
|
)
|
||||||
|
and on (nodename)
|
||||||
|
label_replace(
|
||||||
|
max by (node) (kube_pod_info{namespace="forgejo", pod=~"forgejo-runner-.*"}),
|
||||||
|
"nodename", "$1", "node", "(.+)"
|
||||||
|
)
|
||||||
|
) > 0.90
|
||||||
|
for: 10m
|
||||||
labels:
|
labels:
|
||||||
severity: critical
|
severity: critical
|
||||||
annotations:
|
annotations:
|
||||||
summary: >-
|
summary: >-
|
||||||
dind PVC {{ $labels.persistentvolumeclaim }} is over 95% full
|
{{ $labels.nodename }} is {{ $value | humanizePercentage }} full —
|
||||||
|
runner builds will fail with ENOSPC
|
||||||
description: >-
|
description: >-
|
||||||
Builds will start failing with ENOSPC. Scale the runner to 0,
|
DiskPressure is imminent on a node running CI: kubelet starts
|
||||||
raise the PVC, or clear the dind data-root deliberately (see the
|
evicting (Forgejo + pg-1 went Pending on siriussec this way) and
|
||||||
DiskPressure runbook in the home-k8s skill) — do not wipe it
|
dind builds fail with "no space left on device". Act now: scale the
|
||||||
while the runner pod is up.
|
runner to 0 (`kubectl -n forgejo scale deploy/<runner> --replicas=0`),
|
||||||
|
force the prune, and only then clear the dind data-root by hand
|
||||||
|
(`/opt/local-path-provisioner/pvc-*_forgejo_forgejo-runner-*/` on
|
||||||
|
the node) — never wipe it while the runner pod is up. The 20Gi PVC
|
||||||
|
request does not cap the directory: local-path PVs are plain
|
||||||
|
directories, so the filesystem fills first.
|
||||||
- name: dind-disk-cap
|
- name: dind-disk-cap
|
||||||
rules:
|
rules:
|
||||||
# Pi-specific cap, added with the arm64 dind cutover (kanban
|
# Pi-specific cap, added with the arm64 dind cutover (kanban
|
||||||
# t_0da0a1cc). The two arm64 runners now hold 240 GiB of dind PVCs
|
# t_0da0a1cc). The two arm64 runners now hold 240 GiB of dind PVCs
|
||||||
# (200Gi shared + 40Gi deploy) on rpi's single root filesystem, which
|
# (200Gi shared + 40Gi deploy) on rpi's single root filesystem, which
|
||||||
# is the same disk the kubelet lives on. A static hostPath PV does NOT
|
# is the same disk the kubelet lives on. A static hostPath PV does NOT
|
||||||
# enforce its claim, and the `RunnerDindPvc*` rules cannot fire for it
|
# enforce its claim, and per-PVC usage cannot be alerted on at all
|
||||||
# (no kubelet_volume_stats_* series on this cluster), so this node
|
# (kubelet 1.34+ exports no kubelet_volume_stats_*, header), so this node
|
||||||
# filesystem rule is the real growth cap: 70 % of 917 G leaves ~275 G,
|
# filesystem rule is the real growth cap: 70 % of 917 G leaves ~275 G,
|
||||||
# i.e. reachable while there is still room to run the prune job.
|
# i.e. reachable while there is still room to run the prune job.
|
||||||
# `NodeFilesystemFillingUp` below stays at 85 % as the backstop.
|
# `NodeFilesystemFillingUp` below stays at 85 % as the backstop.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue