monitoring: suppress the dead kubelet_volume_stats rules in kubernetes-storage
kube-prometheus-stack's kubernetes-storage group ships five rules; four of them (both severities of KubePersistentVolumeFillingUp and of KubePersistentVolumeInodesFillingUp) select kubelet_volume_stats_*. Those series have no producer here: kubelet v1.36.4 404s on /metrics/volumes on all three nodes (404s since kubelet 1.34, kubernetes/kubernetes#133847) and count(kubelet_volume_stats_used_bytes) returns 0 series. The rules loaded fine and reported health=ok/active=false, which reads as 'no PVC is filling' when nothing can ever fire. Disabled per rule via defaultRules.disabled (not by dropping the group): the group's fifth alert, KubePersistentVolumeErrors, uses kube-state-metrics' kube_persistentvolume_status_phase, which is live (40 series), so it stays. Verified by rendering the chart with these values: group kubernetes-storage now contains exactly one rule.
This commit is contained in:
parent
af73b261b3
commit
c2eb2b2fa3
3 changed files with 30 additions and 2 deletions
|
|
@ -414,7 +414,7 @@ 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.
|
||||
- **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.
|
||||
- **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.
|
||||
|
||||
|
|
|
|||
|
|
@ -220,7 +220,13 @@ deploying another exporter.
|
|||
20Gi is shown as *requested capacity* next to siriussec's root-filesystem usage,
|
||||
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.
|
||||
alert on, scoped to nodes that run a runner. The chart's own
|
||||
`KubePersistentVolumeFillingUp` / `KubePersistentVolumeInodesFillingUp` rules
|
||||
had the same defect and are suppressed too — both are listed under
|
||||
`defaultRules.disabled` in `monitoring/controllers/home/values.yaml`, so the
|
||||
`kubernetes-storage` group keeps only its live rule,
|
||||
`KubePersistentVolumeErrors` (kube-state-metrics). No loaded rule in this
|
||||
stack selects `kubelet_volume_stats_*`.
|
||||
- **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.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,28 @@ defaultRules:
|
|||
kubeControllerManager: false
|
||||
kubeScheduler: false
|
||||
kubeEtcd: false
|
||||
# Per-rule opt-out (chart: `defaultRules.disabled.<alertName>`), used instead
|
||||
# of dropping a whole group.
|
||||
#
|
||||
# Group `kubernetes-storage` has five rules. Four of them — both severities of
|
||||
# KubePersistentVolumeFillingUp and of KubePersistentVolumeInodesFillingUp —
|
||||
# use kubelet_volume_stats_*. That ALPHA metric set was served
|
||||
# from kubelet's /metrics/volumes, which was removed in kubelet 1.34
|
||||
# (kubernetes/kubernetes#133847, fix #133890). This cluster runs kubelet
|
||||
# v1.36.4, /metrics/volumes returns 404 on all three nodes, and Prometheus
|
||||
# holds zero series: count(kubelet_volume_stats_used_bytes) -> [] (0 series).
|
||||
# Those rules therefore load `health=ok, state=inactive` and can never fire —
|
||||
# which reads as "no PVC is filling up" when in reality nothing is measured.
|
||||
# Both severities of one alert name are gated by a single `disabled` key.
|
||||
#
|
||||
# The group's fifth rule, KubePersistentVolumeErrors, is NOT dead — it is
|
||||
# built on kube-state-metrics' `kube_persistentvolume_status_phase`, which is
|
||||
# live here (40 series across 6 PVs when this landed). It stays in the chart
|
||||
# and is deliberately not disabled: this way no working alert is dropped and
|
||||
# no chart rule is duplicated by hand.
|
||||
disabled:
|
||||
KubePersistentVolumeFillingUp: true
|
||||
KubePersistentVolumeInodesFillingUp: true
|
||||
|
||||
# --- Control-plane targets that are unreachable or lift-heavy for a lab box
|
||||
kubeProxy:
|
||||
|
|
|
|||
Loading…
Reference in a new issue