ci(runners): name the CI capsule ci-runners and mark it privileged in warn/audit too

Renames the namespace introduced in #72 (`forgejo-runners` -> `ci-runners`) per
the orchestrator decision on card t_2bbe34a8, and sets the capsule's
warn/audit levels to `privileged` alongside `enforce: privileged`: everything
in it is allowed by design, so restricted-level warnings on every pod restart
would be noise, and the intent is explicit in Git rather than implied.

Storage is the same three PVs, rebound again by name (Retain + cleared
claimRef), so the runner registration uuids, dind image sets and action caches
survive: verified before/after (uuids 91124ee3/4e07c1e9/a41aad73, image counts
19/2/31, canary files intact). Monitoring selectors and docs follow the new
namespace; the Grafana dashboard keeps its `forgejo-runners` uid.
This commit is contained in:
Lancelot 2026-11-27 01:20:56 -05:00
commit aec63c4d56
18 changed files with 104 additions and 98 deletions

View file

@ -1,6 +1,6 @@
# Alerts for the disk-reclamation job and the daemons it prunes.
#
# Context: `forgejo-runners/forgejo-runner-prune` reclaims build cache nightly. Its
# Context: `ci-runners/forgejo-runner-prune` reclaims build cache nightly. Its
# own success/failure is invisible unless kube-state-metrics is watched, and
# the failure mode it exists to prevent (a full disk on siriussec → DiskPressure
# → Forgejo + Postgres evicted, public 503) shows up in node_exporter first.
@ -53,10 +53,10 @@ spec:
# never having succeeded at all.
expr: |
(
time() - kube_cronjob_status_last_successful_time{namespace="forgejo-runners", cronjob="forgejo-runner-prune"} > 26 * 3600
time() - kube_cronjob_status_last_successful_time{namespace="ci-runners", cronjob="forgejo-runner-prune"} > 26 * 3600
)
or
absent(kube_cronjob_status_last_successful_time{namespace="forgejo-runners", cronjob="forgejo-runner-prune"})
absent(kube_cronjob_status_last_successful_time{namespace="ci-runners", cronjob="forgejo-runner-prune"})
for: 10m
labels:
severity: warning
@ -66,10 +66,10 @@ spec:
description: >-
Build cache, exited containers and unused images are not being
reclaimed on the Pi host daemon or on the dind daemons. Check
`kubectl -n forgejo-runners get jobs -l role=prune` and the pod logs of
`kubectl -n ci-runners get jobs -l role=prune` and the pod logs of
the newest Job; the job skips (exit 0) when a build is live, but
a *stale* success means it has not run at all. Force one run:
kubectl -n forgejo-runners create job --from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)
kubectl -n ci-runners create job --from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)
- alert: ForgejoPruneJobFailed
# kube_job_failed was removed from kube-state-metrics; the supported
# series is kube_job_status_failed (0 for a successful job, >0 when a
@ -77,7 +77,7 @@ spec:
# transient failure ages out on its own after the history limit.
expr: |
max by (job_name) (
kube_job_status_failed{namespace="forgejo-runners", job_name=~"forgejo-runner-prune-.*"}
kube_job_status_failed{namespace="ci-runners", job_name=~"forgejo-runner-prune-.*"}
) > 0
for: 5m
labels:
@ -86,7 +86,7 @@ spec:
summary: forgejo-runner-prune Job {{ $labels.job_name }} has a failed pod
description: >-
A prune run failed (or its dind discovery/exec container did).
Read `kubectl -n forgejo-runners logs job/{{ $labels.job_name }} -c
Read `kubectl -n ci-runners logs job/{{ $labels.job_name }} -c
dind-daemons` — a failure there means a running dind daemon was
not reachable over the exec API, so that daemon is growing
unpruned. One retry is allowed by backoffLimit; persistent
@ -121,7 +121,7 @@ spec:
)
and on (nodename)
label_replace(
max by (node) (kube_pod_info{namespace="forgejo-runners", pod=~"forgejo-runner-.*"}),
max by (node) (kube_pod_info{namespace="ci-runners", pod=~"forgejo-runner-.*"}),
"nodename", "$1", "node", "(.+)"
)
) > 0.80
@ -141,9 +141,9 @@ spec:
Prometheus. Per-PVC bytes cannot be measured here — kubelet 1.34+
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-runners exec <runner-pod> -c dind -- docker system df -v`
`kubectl -n ci-runners 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-runners create job
the nightly prune reclaim (or force it: kubectl -n ci-runners create job
--from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)).
- alert: RunnerDindDiskCritical
expr: |
@ -159,7 +159,7 @@ spec:
)
and on (nodename)
label_replace(
max by (node) (kube_pod_info{namespace="forgejo-runners", pod=~"forgejo-runner-.*"}),
max by (node) (kube_pod_info{namespace="ci-runners", pod=~"forgejo-runner-.*"}),
"nodename", "$1", "node", "(.+)"
)
) > 0.90
@ -174,7 +174,7 @@ spec:
DiskPressure is imminent on a node running CI: kubelet starts
evicting (Forgejo + pg-1 went Pending on siriussec this way) and
dind builds fail with "no space left on device". Act now: scale the
runner to 0 (`kubectl -n forgejo-runners scale deploy/<runner> --replicas=0`),
runner to 0 (`kubectl -n ci-runners 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
@ -212,10 +212,10 @@ spec:
200Gi and forgejo-runner-deploy-arm64-dind 40Gi) share rpi's only
filesystem with the kubelet. Nothing enforces those claim sizes.
Attribute the growth with
`kubectl -n forgejo-runners exec <pod> -c dind -- docker system df -v`
`kubectl -n ci-runners exec <pod> -c dind -- docker system df -v`
(the nightly prune job prints this for every daemon and never
deletes named volumes), then reclaim with
`kubectl -n forgejo-runners create job --from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)`.
`kubectl -n ci-runners create job --from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)`.
See docs/arm64-runner-dind.md §4.4.
- name: disk-capacity
rules:
@ -238,7 +238,7 @@ spec:
annotations:
summary: "{{ $labels.nodename }} root filesystem is {{ $value | humanizePercentage }} full"
description: >-
Reclaim with `kubectl -n forgejo-runners create job
Reclaim with `kubectl -n ci-runners create job
--from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)` (it
prunes the Pi host daemon and every dind daemon), and read that
job's `docker system df -v` output for the volumes that are