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

@ -19,7 +19,7 @@ first thing that must change. See §15.
> **Namespace note (2026-11-27, card `t_2bbe34a8`):** the three runner
> Deployments, their PVCs and the prune CronJob moved from `forgejo` to
> `forgejo-runners` so `forgejo` can enforce Pod Security `baseline`. Commands
> `ci-runners` so `forgejo` can enforce Pod Security `baseline`. Commands
> below use the new namespace; the dind design and every measurement are
> unchanged.
---
@ -628,7 +628,7 @@ difference between the two runners).
`docker:27-dind` already contains the client and the plugins:
```
$ kubectl -n forgejo-runners exec deploy/forgejo-runner-amd64 -c dind -- sh -c 'command -v docker; ls /usr/local/libexec/docker/cli-plugins/'
$ kubectl -n ci-runners exec deploy/forgejo-runner-amd64 -c dind -- sh -c 'command -v docker; ls /usr/local/libexec/docker/cli-plugins/'
/usr/local/bin/docker
docker-buildx
docker-compose
@ -705,7 +705,7 @@ risk of migrating a target dir that has already caused `os error 13` corruption.
Pre-flight — every one is read-only and proves the next step:
1. `kubectl -n forgejo-runners get deploy,pvc` and `ssh rpi docker ps` — record before.
1. `kubectl -n ci-runners get deploy,pvc` and `ssh rpi docker ps` — record before.
2. Confirm `onionwire`'s in-flight work: no `running` run on the `docker` label
(`action_task`), or accept that the cutover kills it (see §14).
3. Publish the Pi registry on `10.10.0.1:5000` and prove
@ -717,7 +717,7 @@ Pre-flight — every one is read-only and proves the next step:
Cutover — shared runner first (it owns `docker`):
6. `kubectl -n forgejo-runners scale deploy/forgejo-runner-arm64 --replicas=0`, then
6. `kubectl -n ci-runners scale deploy/forgejo-runner-arm64 --replicas=0`, then
`ssh rpi docker ps --filter name=GITEA-ACTIONS` and `docker kill`/`rm` any
job containers **still running on the host daemon** (a Deployment restart does
not stop them; they keep writing to the volumes we are about to abandon).
@ -744,10 +744,10 @@ Cutover — shared runner first (it owns `docker`):
landed in the Pi registry (`curl -s http://10.10.0.1:5000/v2/_catalog`) and
the Garage sync succeeded.
12. Prove the existing prune discovers the new pod before trusting the night:
`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)`
and check its `dind-daemons` container log lists both new pods (label +
container-name contract, §1.6) and reports `docker system df` per daemon.
13. `df -h /` on rpi before/after, `kubectl -n forgejo-runners get pvc` (both Bound),
13. `df -h /` on rpi before/after, `kubectl -n ci-runners get pvc` (both Bound),
`kubectl get deploy -n forgejo -o wide`.
## 11. Rollback
@ -766,9 +766,9 @@ Kept in place for this purpose, and none of it is deleted by the cutover:
Rollback, ~5 minutes:
```
kubectl -n forgejo-runners apply -f <git show HEAD~1:apps/base/forgejo/runner-arm64.yaml>
kubectl -n forgejo-runners apply -f <git show HEAD~1:apps/base/forgejo/runner-deploy-arm64.yaml>
kubectl -n forgejo-runners scale deploy/forgejo-runner-arm64 --replicas=1
kubectl -n ci-runners apply -f <git show HEAD~1:apps/base/forgejo/runner-arm64.yaml>
kubectl -n ci-runners apply -f <git show HEAD~1:apps/base/forgejo/runner-deploy-arm64.yaml>
kubectl -n ci-runners scale deploy/forgejo-runner-arm64 --replicas=1
```
(down the dind deployment first, kill any job container inside dind, then apply.)
@ -932,7 +932,7 @@ The `dind` container is named exactly `dind` (§1.6 naming contract).
an in-pod daemon the socket is still `unix:///var/run/docker.sock` (in
`DOCKER_HOST`, the shim, and `container.options`), so the string appears 5×
per Deployment. The meaningful test is **no hostPath at all**:
`kubectl -n forgejo-runners get deploy <n> -o yaml | grep -c hostPath` = 0 for both,
`kubectl -n ci-runners get deploy <n> -o yaml | grep -c hostPath` = 0 for both,
and every `docker.sock` reference resolves to the `emptyDir` shared by the
`dind` and `runner` containers.
@ -962,7 +962,7 @@ The `dind` container is named exactly `dind` (§1.6 naming contract).
PVCs bound on rpi, static, `Retain`:
```
$ kubectl -n forgejo-runners get pvc -o wide | grep dind
$ kubectl -n ci-runners get pvc -o wide | grep dind
forgejo-runner-arm64-dind Bound forgejo-runner-arm64-dind 200Gi RWO local-static
forgejo-runner-deploy-arm64-dind Bound forgejo-runner-deploy-arm64-dind 40Gi RWO local-static
$ kubectl get pv forgejo-runner-arm64-dind forgejo-runner-deploy-arm64-dind
@ -975,10 +975,10 @@ Pods on rpi, two containers each, daemon `27.5.1` (the dind image — the Pi hos
daemon is `29.7.2`, so a job can never be talking to it):
```
$ kubectl -n forgejo-runners get deploy -o wide
$ kubectl -n ci-runners get deploy -o wide
forgejo-runner-arm64 1/1 dind,runner docker:27-dind,code.forgejo.org/forgejo/runner:5.0.1
forgejo-runner-deploy-arm64 1/1 dind,runner docker:27-dind,code.forgejo.org/forgejo/runner:5.0.1
$ kubectl -n forgejo-runners exec <arm64-pod> -c dind -- docker version --format 'server={{.Server.Version}}'
$ kubectl -n ci-runners exec <arm64-pod> -c dind -- docker version --format 'server={{.Server.Version}}'
server=27.5.1
```
@ -1007,8 +1007,8 @@ task 1737 in 1782 s (warm); deploy runner: task 1736 (`deploy-site.yml`) green i
Nightly prune reaches both new daemons (R10 proof, forced Job):
```
$ kubectl -n forgejo-runners create job --from=cronjob/forgejo-runner-prune prune-manual-1793084490
$ kubectl -n forgejo-runners logs job/prune-manual-1793084490 -c dind-daemons | grep -E "daemon: dind in pod/|summary:"
$ kubectl -n ci-runners create job --from=cronjob/forgejo-runner-prune prune-manual-1793084490
$ kubectl -n ci-runners logs job/prune-manual-1793084490 -c dind-daemons | grep -E "daemon: dind in pod/|summary:"
== daemon: dind in pod/forgejo-runner-amd64-f7bb99fb-mbv5f
== daemon: dind in pod/forgejo-runner-arm64-7c84998bb8-mmwqd
== daemon: dind in pod/forgejo-runner-deploy-arm64-5dcbd9f7fc-6nj2g
@ -1022,7 +1022,7 @@ $ ssh rpi 'ss -lntH "sport = :5000"'
LISTEN 0 4096 10.10.0.1:5000 0.0.0.0:*
LISTEN 0 4096 127.0.0.1:5000 0.0.0.0:*
$ ssh rpi 'curl -m5 -o /dev/null -w "%{http_code}" http://192.168.1.125:5000/v2/' → 000 (refused)
$ kubectl -n forgejo-runners exec <arm64-pod> -c dind -- wget -qO- http://10.10.0.1:5000/v2/
$ kubectl -n ci-runners exec <arm64-pod> -c dind -- wget -qO- http://10.10.0.1:5000/v2/
{} # from the job daemon itself
```
@ -1066,8 +1066,8 @@ regrown inside dind — they rebuild cold by design, §4.2).
```
# 1. stop the dind pods (a job container lives inside them, so it dies with them)
kubectl -n forgejo-runners scale deploy/forgejo-runner-arm64 --replicas=0
kubectl -n forgejo-runners scale deploy/forgejo-runner-deploy-arm64 --replicas=0
kubectl -n ci-runners scale deploy/forgejo-runner-arm64 --replicas=0
kubectl -n ci-runners scale deploy/forgejo-runner-deploy-arm64 --replicas=0
# 2. Flux owns these files: suspend the apps Kustomization, or the next
# reconcile puts the dind manifests straight back
flux -n flux-system suspend kustomization apps