forgejo runners(arm64): run both arm64 runners as in-cluster dind pods
The Pi's host Docker is no longer the arm64 job-container daemon. Both forgejo-runner-arm64 and forgejo-runner-deploy-arm64 now run a privileged docker:27-dind sidecar (--mtu=1420, socket on an emptyDir shared with the runner, data-root on a PVC), the same shape as forgejo-runner-amd64. - labels preserved verbatim: shared keeps docker-arm64/arm64/docker, deploy keeps deploy-arm64 only; capacity 1 on both - runner.ini moved from hostPath to the data PVC by copy, uuid preserved (4e07c1e9... / a41aad73...); the deploy runner's register init container is inverted into a guard so a missing file cannot burn a token and create a second runner - dind limits.memory 4Gi (measured peak 3.10GiB) and 2Gi for the deploy runner so a CI run and a deploy cannot both claim the Pi's 7GiB - static hostPath PVs pinned to rpi with Retain: dynamic local-path cannot provision there (helper pod hardcoded to siriussec) - docker CLI/buildx come from the dind image instead of the host's docker-static - Pi registry additionally published on 10.10.0.1:5000 (out of band on the Pi) - RpiDindDataRootFillingUp at 70%: the real cap, since a static PV does not enforce its claim and kubelet_volume_stats_* does not exist here Design and measured proof: docs/arm64-runner-dind.md (t_627c231c).
This commit is contained in:
parent
a243af6591
commit
131b9bc7c9
6 changed files with 359 additions and 125 deletions
|
|
@ -10,6 +10,10 @@ resources:
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- runner-configmap.yaml
|
- runner-configmap.yaml
|
||||||
|
# Static PVs/PVCs pinned to rpi: dynamic local-path cannot provision there
|
||||||
|
# (its helper pod is hardcoded to siriussec). Must sort before the runner
|
||||||
|
# Deployments that consume the claims.
|
||||||
|
- runner-dind-storage.yaml
|
||||||
- runner-arm64.yaml
|
- runner-arm64.yaml
|
||||||
- runner-amd64.yaml
|
- runner-amd64.yaml
|
||||||
- runner-deploy-arm64.yaml
|
- runner-deploy-arm64.yaml
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: forgejo-runner
|
app: forgejo-runner
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
# RWO PVC: never two pods on one data-root.
|
||||||
strategy:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
|
|
@ -27,49 +28,100 @@ spec:
|
||||||
operator: Equal
|
operator: Equal
|
||||||
value: network
|
value: network
|
||||||
effect: PreferNoSchedule
|
effect: PreferNoSchedule
|
||||||
securityContext:
|
# No supplementalGroups: there is no host docker socket and no host
|
||||||
supplementalGroups: [984]
|
# docker gid to match any more. The only daemon this runner talks to is
|
||||||
|
# the privileged `dind` sidecar below.
|
||||||
containers:
|
containers:
|
||||||
|
# In-pod Docker daemon. Same shape as forgejo-runner-amd64: privileged,
|
||||||
|
# socket on an emptyDir shared with the runner, data-root on the PVC.
|
||||||
|
# The container MUST be named `dind`, not `docker`/`dockerd`: the
|
||||||
|
# nightly prune (prune-cronjob.yaml) discovers daemons by
|
||||||
|
# `app=forgejo-runner` plus a container literally named `dind`, and
|
||||||
|
# silently prunes nothing for any other name while still reporting
|
||||||
|
# success.
|
||||||
|
- name: dind
|
||||||
|
image: docker:27-dind
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
dockerd --host=unix:///var/run/docker.sock --tls=false --mtu=1420 &
|
||||||
|
pid=$!
|
||||||
|
i=0
|
||||||
|
while [ "$i" -lt 30 ]; do
|
||||||
|
if [ -S /var/run/docker.sock ]; then
|
||||||
|
chmod 666 /var/run/docker.sock
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
wait "$pid"
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: dind-run
|
||||||
|
mountPath: /var/run
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/lib/docker
|
||||||
|
subPath: docker
|
||||||
|
resources:
|
||||||
|
# Measured peak RSS of a real ci.yml-shaped Rust job inside dind on
|
||||||
|
# this Pi: 3.10 GiB (docs/arm64-runner-dind.md §2.6). The previous
|
||||||
|
# 512Mi limit OOM-killed the daemon on the first build; 4Gi copies
|
||||||
|
# the amd64 runner, which runs the same load shape.
|
||||||
|
requests:
|
||||||
|
cpu: 200m
|
||||||
|
memory: 512Mi
|
||||||
|
limits:
|
||||||
|
memory: 4Gi
|
||||||
- name: runner
|
- name: runner
|
||||||
# code.forgejo.org/forgejo/runner is genuinely multi-arch and works on
|
# code.forgejo.org/forgejo/runner is genuinely multi-arch and works on
|
||||||
# both the amd64 (siriussec) and arm64 (rpi) runners. Do NOT swap this
|
# both the amd64 (siriussec) and arm64 (rpi) runners. Do NOT swap this
|
||||||
# for alex3305/forgejo-runner-dind:* on the arm64 runner: that image's
|
# for alex3305/forgejo-runner-dind:* on the arm64 runner: that image's
|
||||||
# arm64 manifest ships an x86-64 forgejo-runner binary, so the Pi dies
|
# arm64 manifest ships an x86-64 forgejo-runner binary, so the Pi dies
|
||||||
# with "exec format error" and the pi-runner (the only runner declaring
|
# with "exec format error" and the pi runner (the only runner declaring
|
||||||
# the bare `docker` label) goes offline, stalling every `runs-on: docker`
|
# the bare `docker` label) goes offline, stalling every `runs-on: docker`
|
||||||
# job in onionwire/siriusdevops-contact.
|
# job in onionwire/siriusdevops-contact.
|
||||||
image: code.forgejo.org/forgejo/runner:5.0.1
|
image: code.forgejo.org/forgejo/runner:5.0.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
# uid 1000 in this image vs a `660 root:docker` dind socket: the dind
|
||||||
|
# container's one-shot chmod 666 can race a dockerd restart and the
|
||||||
|
# runner's wait loop only checks that the socket exists, so it would
|
||||||
|
# crashloop on "permission denied". Running as root is what the amd64
|
||||||
|
# runner proved deterministic (2eff85b).
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
command:
|
command:
|
||||||
- forgejo-runner
|
- sh
|
||||||
- --config
|
- -c
|
||||||
- /config/config.toml
|
- |
|
||||||
- daemon
|
set -e
|
||||||
|
i=0
|
||||||
|
while [ "$i" -lt 60 ]; do
|
||||||
|
if [ -S /var/run/docker.sock ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
exec forgejo-runner --config /config/config.toml daemon
|
||||||
env:
|
env:
|
||||||
- name: DOCKER_HOST
|
- name: DOCKER_HOST
|
||||||
value: unix:///var/run/docker.sock
|
value: unix:///var/run/docker.sock
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
runAsUser: 0
|
|
||||||
runAsGroup: 0
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: docker-sock
|
|
||||||
mountPath: /var/run/docker.sock
|
|
||||||
- name: docker-static
|
|
||||||
mountPath: /usr/bin/docker
|
|
||||||
readOnly: true
|
|
||||||
- name: cli-plugins
|
|
||||||
mountPath: /usr/local/lib/docker/cli-plugins
|
|
||||||
readOnly: true
|
|
||||||
- name: config-toml
|
- name: config-toml
|
||||||
mountPath: /config/config.toml
|
mountPath: /config/config.toml
|
||||||
subPath: arm64.toml
|
subPath: arm64.toml
|
||||||
- name: runner-ini
|
# runner.ini + actions cache live on the same PVC as the dind
|
||||||
mountPath: /config/runner.ini
|
# data-root (subPath docker), so one Retain PV holds the whole
|
||||||
- name: cache
|
# runner identity. Copied from the Pi host before first start —
|
||||||
mountPath: /opt/siriusdevops/runner/cache
|
# never registered here, the uuid must survive.
|
||||||
- name: siriusdevops
|
- name: data
|
||||||
mountPath: /opt/siriusdevops
|
mountPath: /data
|
||||||
|
- name: dind-run
|
||||||
|
mountPath: /var/run
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 50m
|
||||||
|
|
@ -77,30 +129,11 @@ spec:
|
||||||
limits:
|
limits:
|
||||||
memory: 512Mi
|
memory: 512Mi
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-sock
|
|
||||||
hostPath:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
type: Socket
|
|
||||||
- name: docker-static
|
|
||||||
hostPath:
|
|
||||||
path: /usr/local/bin/docker-static
|
|
||||||
type: File
|
|
||||||
- name: cli-plugins
|
|
||||||
hostPath:
|
|
||||||
path: /opt/siriusdevops/runner/cli-plugins
|
|
||||||
type: DirectoryOrCreate
|
|
||||||
- name: config-toml
|
- name: config-toml
|
||||||
configMap:
|
configMap:
|
||||||
name: forgejo-runner-config
|
name: forgejo-runner-config
|
||||||
- name: runner-ini
|
- name: data
|
||||||
hostPath:
|
persistentVolumeClaim:
|
||||||
path: /opt/siriusdevops/runner/config/runner.ini
|
claimName: forgejo-runner-arm64-dind
|
||||||
type: File
|
- name: dind-run
|
||||||
- name: cache
|
emptyDir: {}
|
||||||
hostPath:
|
|
||||||
path: /opt/siriusdevops/runner/cache
|
|
||||||
type: DirectoryOrCreate
|
|
||||||
- name: siriusdevops
|
|
||||||
hostPath:
|
|
||||||
path: /opt/siriusdevops
|
|
||||||
type: Directory
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,10 @@ data:
|
||||||
log:
|
log:
|
||||||
level: info
|
level: info
|
||||||
runner:
|
runner:
|
||||||
file: /config/runner.ini
|
# runner.ini lives on the runner's data PVC now (was a hostPath file), so
|
||||||
|
# the registration survives the move to in-cluster dind with the same
|
||||||
|
# uuid. Nothing in the Deployment registers a runner.
|
||||||
|
file: /data/runner.ini
|
||||||
# capacity 1: ci.yml builds every job's Rust target into ONE shared named
|
# capacity 1: ci.yml builds every job's Rust target into ONE shared named
|
||||||
# volume (onionwire-target-ci, mounted at /target). Two jobs writing that
|
# volume (onionwire-target-ci, mounted at /target). Two jobs writing that
|
||||||
# volume concurrently clobber each other's freshly-linked test binaries,
|
# volume concurrently clobber each other's freshly-linked test binaries,
|
||||||
|
|
@ -18,16 +21,25 @@ data:
|
||||||
# runs of the same group on this runner (446 + 447 overlapped).
|
# runs of the same group on this runner (446 + 447 overlapped).
|
||||||
capacity: 1
|
capacity: 1
|
||||||
timeout: 1h
|
timeout: 1h
|
||||||
cache: /opt/siriusdevops/runner/cache
|
cache: /data/cache
|
||||||
cache:
|
cache:
|
||||||
enabled: true
|
enabled: true
|
||||||
dir: /opt/siriusdevops/runner/cache
|
dir: /data/cache
|
||||||
container:
|
container:
|
||||||
privileged: true
|
privileged: true
|
||||||
# No docker_host here: setting it makes the runner inject the host socket
|
# No docker_host here: setting it makes the runner inject the socket bind
|
||||||
# bind into the job container itself, which collides with the explicit
|
# into the job container itself, which collides with the explicit
|
||||||
# -v /var/run/docker.sock in options ("Duplicate mount point").
|
# -v /var/run/docker.sock in options ("Duplicate mount point"). The
|
||||||
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
|
# options bind is the deliberate choice — nested `docker create/start` in
|
||||||
|
# ci.yml, fuzz.yml and release.yml depends on it.
|
||||||
|
#
|
||||||
|
# The docker CLI/plugins come out of the `dind` sidecar's own filesystem
|
||||||
|
# (docker:27-dind ships /usr/local/bin/docker, docker-buildx,
|
||||||
|
# docker-compose), not the Pi host's docker-static. Paths resolve inside
|
||||||
|
# the dind container, which is what the daemon bind-mounts from. This
|
||||||
|
# keeps `docker buildx` working without installing a CLI in five
|
||||||
|
# workflows.
|
||||||
|
options: -v /usr/local/bin/docker:/usr/bin/docker:ro -v /usr/local/libexec/docker/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
|
||||||
valid_volumes:
|
valid_volumes:
|
||||||
- "**"
|
- "**"
|
||||||
# Dedicated runner for site deploys. It declares ONLY the `deploy-arm64`
|
# Dedicated runner for site deploys. It declares ONLY the `deploy-arm64`
|
||||||
|
|
@ -36,13 +48,19 @@ data:
|
||||||
# can never occupy the Pi's `docker` runner, whose capacity 1 exists to
|
# can never occupy the Pi's `docker` runner, whose capacity 1 exists to
|
||||||
# serialize onionwire jobs sharing the onionwire-target-ci volume.
|
# serialize onionwire jobs sharing the onionwire-target-ci volume.
|
||||||
#
|
#
|
||||||
# It runs on the Pi because deploy-site.yml needs Pi-local resources:
|
# It runs on the Pi because deploy-site.yml needs Pi-local resources: the Pi
|
||||||
# 127.0.0.1:5000 (registry), 127.0.0.1:3900 (Garage) via `--network host`,
|
# registry and Garage are now addressed over the WireGuard hub IP
|
||||||
# and the host docker socket to build the arm64 site image.
|
# (10.10.0.1:5000, 10.10.0.1:3900) instead of loopback, because 127.0.0.1
|
||||||
|
# inside a pod is the pod. Its own `dind` sidecar builds the arm64 site image;
|
||||||
|
# no host Docker is involved.
|
||||||
deploy-arm64.toml: |
|
deploy-arm64.toml: |
|
||||||
log:
|
log:
|
||||||
level: info
|
level: info
|
||||||
runner:
|
runner:
|
||||||
|
# Copied onto the data PVC from /opt/siriusdevops/runner-deploy/data on
|
||||||
|
# the Pi host before first start. The require-registration init container
|
||||||
|
# refuses to start without it (registering would burn the single-use
|
||||||
|
# token and create a second action_runner row).
|
||||||
file: /data/runner.ini
|
file: /data/runner.ini
|
||||||
capacity: 1
|
capacity: 1
|
||||||
timeout: 30m
|
timeout: 30m
|
||||||
|
|
@ -54,11 +72,13 @@ data:
|
||||||
privileged: true
|
privileged: true
|
||||||
# Same injection as arm64.toml: the job container is node:20-bullseye,
|
# Same injection as arm64.toml: the job container is node:20-bullseye,
|
||||||
# which has no docker CLI and no buildx, and deploy-site.yml needs both.
|
# which has no docker CLI and no buildx, and deploy-site.yml needs both.
|
||||||
# buildx is the host's cli-plugins binary and binfmt/QEMU is registered on
|
# Both come from the dind sidecar's own filesystem. binfmt/QEMU is
|
||||||
# the Pi host, so amd64 cross-builds work here exactly as on the arm64
|
# registered kernel-globally on the Pi (the POC pod's
|
||||||
# runner. --memory caps the job container only (sibling `docker run`
|
# /proc/sys/fs/binfmt_misc was empty yet an amd64 build ran as x86_64),
|
||||||
# containers a workflow spawns are outside the runner's control).
|
# so the `--platform linux/amd64` cross build works inside the pod.
|
||||||
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
|
# --memory caps the job container only (sibling `docker run` containers a
|
||||||
|
# workflow spawns are outside the runner's control).
|
||||||
|
options: -v /usr/local/bin/docker:/usr/bin/docker:ro -v /usr/local/libexec/docker/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
|
||||||
valid_volumes:
|
valid_volumes:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@
|
||||||
# cheap; the labels are disjoint in both directions, so neither class can
|
# cheap; the labels are disjoint in both directions, so neither class can
|
||||||
# starve the other. Keep capacity 1: a deploy must not overlap itself (the Pi
|
# starve the other. Keep capacity 1: a deploy must not overlap itself (the Pi
|
||||||
# registry tag :latest and the k8s restartedAt patch are last-writer-wins).
|
# registry tag :latest and the k8s restartedAt patch are last-writer-wins).
|
||||||
|
#
|
||||||
|
# Since the arm64 dind cutover this runner has its own in-pod daemon too, so a
|
||||||
|
# deploy no longer shares the Pi's host Docker with anything.
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|
@ -43,80 +46,106 @@ spec:
|
||||||
operator: Equal
|
operator: Equal
|
||||||
value: network
|
value: network
|
||||||
effect: PreferNoSchedule
|
effect: PreferNoSchedule
|
||||||
securityContext:
|
|
||||||
supplementalGroups: [984]
|
|
||||||
initContainers:
|
initContainers:
|
||||||
# Self-registration, like the amd64 runner. runner.ini lives on the Pi
|
# Registration guard, NOT a registration step. The runner's identity
|
||||||
# host (/opt/siriusdevops/runner-deploy/data) so a pod restart reuses the
|
# (`runner.ini`, action_runner id 14 / uuid a41aad73-…) is copied onto
|
||||||
# existing registration instead of burning a single-use runner token.
|
# the PVC from the Pi host before the first start. The previous version
|
||||||
- name: register
|
# of this init container registered a *new* runner whenever the file was
|
||||||
# Must be the multi-arch code.forgejo.org image: alex3305/
|
# missing, which burns a single-use token and leaves a second
|
||||||
# forgejo-runner-dind ships an x86-64 binary in its arm64 manifest and
|
# action_runner row polling under a new uuid. Refuse instead: a missing
|
||||||
# dies with "exec format error" on the Pi.
|
# file is an operator error, not something to paper over.
|
||||||
|
- name: require-registration
|
||||||
image: code.forgejo.org/forgejo/runner:5.0.1
|
image: code.forgejo.org/forgejo/runner:5.0.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
# The hostPath /data dir is created root:root by kubelet, and the
|
|
||||||
# runner image's default user cannot write runner.ini into it.
|
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 0
|
runAsUser: 0
|
||||||
runAsGroup: 0
|
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
if [ -s /data/runner.ini ]; then
|
if [ ! -s /data/runner.ini ]; then
|
||||||
echo already-registered
|
echo "runner.ini missing on the data PVC — refusing to register a second uuid" >&2
|
||||||
exit 0
|
echo "restore it: ssh rpi sudo install -m600 -o root -g root /opt/siriusdevops/runner-deploy/data/runner.ini /opt/local-path-provisioner/forgejo-runner-deploy-arm64-dind/runner.ini" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
forgejo-runner register --no-interactive \
|
echo "registration present: $(grep -o '\"uuid\": \"[^\"]*\"' /data/runner.ini)"
|
||||||
--instance https://forgejo.siriusdevops.com \
|
|
||||||
--token "$RUNNER_TOKEN" \
|
|
||||||
--name pi-deploy-arm64 \
|
|
||||||
--labels 'deploy-arm64:docker://node:20-bullseye' \
|
|
||||||
--config /config/config.toml
|
|
||||||
env:
|
|
||||||
- name: RUNNER_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: forgejo-runner-deploy-arm64-token
|
|
||||||
key: token
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: config-toml
|
|
||||||
mountPath: /config/config.toml
|
|
||||||
subPath: deploy-arm64.toml
|
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
containers:
|
containers:
|
||||||
|
- name: dind
|
||||||
|
image: docker:27-dind
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
dockerd --host=unix:///var/run/docker.sock --tls=false --mtu=1420 &
|
||||||
|
pid=$!
|
||||||
|
i=0
|
||||||
|
while [ "$i" -lt 30 ]; do
|
||||||
|
if [ -S /var/run/docker.sock ]; then
|
||||||
|
chmod 666 /var/run/docker.sock
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
wait "$pid"
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumeMounts:
|
||||||
|
- name: dind-run
|
||||||
|
mountPath: /var/run
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/lib/docker
|
||||||
|
subPath: docker
|
||||||
|
resources:
|
||||||
|
# Deliberately smaller than the shared runner's 4Gi. A deploy is two
|
||||||
|
# nginx-based site images (112-143 MB each) plus buildx's
|
||||||
|
# docker-container driver and one `--platform linux/amd64` cross
|
||||||
|
# build under qemu; nothing like the Rust ci.yml job that peaked at
|
||||||
|
# 3.10 GiB. The Pi has 7.0 GiB available and capacity 1 per runner
|
||||||
|
# bounds each runner but nothing bounds both: 4Gi + 2Gi limits leave
|
||||||
|
# ~1 GiB for kubelet/Cilium/cloudflared/host Docker even if a CI run
|
||||||
|
# and a deploy overlap, and an OOM here fails one deploy visibly.
|
||||||
|
# (A 4Gi deploy limit would let two runners claim every byte.)
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
memory: 2Gi
|
||||||
- name: runner
|
- name: runner
|
||||||
image: code.forgejo.org/forgejo/runner:5.0.1
|
image: code.forgejo.org/forgejo/runner:5.0.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 0
|
||||||
command:
|
command:
|
||||||
- forgejo-runner
|
- sh
|
||||||
- --config
|
- -c
|
||||||
- /config/config.toml
|
- |
|
||||||
- daemon
|
set -e
|
||||||
|
i=0
|
||||||
|
while [ "$i" -lt 60 ]; do
|
||||||
|
if [ -S /var/run/docker.sock ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
exec forgejo-runner --config /config/config.toml daemon
|
||||||
env:
|
env:
|
||||||
- name: DOCKER_HOST
|
- name: DOCKER_HOST
|
||||||
value: unix:///var/run/docker.sock
|
value: unix:///var/run/docker.sock
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
runAsUser: 0
|
|
||||||
runAsGroup: 0
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: docker-sock
|
|
||||||
mountPath: /var/run/docker.sock
|
|
||||||
- name: docker-static
|
|
||||||
mountPath: /usr/bin/docker
|
|
||||||
readOnly: true
|
|
||||||
- name: cli-plugins
|
|
||||||
mountPath: /usr/local/lib/docker/cli-plugins
|
|
||||||
readOnly: true
|
|
||||||
- name: config-toml
|
- name: config-toml
|
||||||
mountPath: /config/config.toml
|
mountPath: /config/config.toml
|
||||||
subPath: deploy-arm64.toml
|
subPath: deploy-arm64.toml
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
- name: dind-run
|
||||||
|
mountPath: /var/run
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 50m
|
||||||
|
|
@ -124,22 +153,11 @@ spec:
|
||||||
limits:
|
limits:
|
||||||
memory: 512Mi
|
memory: 512Mi
|
||||||
volumes:
|
volumes:
|
||||||
- name: docker-sock
|
|
||||||
hostPath:
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
type: Socket
|
|
||||||
- name: docker-static
|
|
||||||
hostPath:
|
|
||||||
path: /usr/local/bin/docker-static
|
|
||||||
type: File
|
|
||||||
- name: cli-plugins
|
|
||||||
hostPath:
|
|
||||||
path: /opt/siriusdevops/runner/cli-plugins
|
|
||||||
type: DirectoryOrCreate
|
|
||||||
- name: config-toml
|
- name: config-toml
|
||||||
configMap:
|
configMap:
|
||||||
name: forgejo-runner-config
|
name: forgejo-runner-config
|
||||||
- name: data
|
- name: data
|
||||||
hostPath:
|
persistentVolumeClaim:
|
||||||
path: /opt/siriusdevops/runner-deploy/data
|
claimName: forgejo-runner-deploy-arm64-dind
|
||||||
type: DirectoryOrCreate
|
- name: dind-run
|
||||||
|
emptyDir: {}
|
||||||
|
|
|
||||||
122
apps/base/forgejo/runner-dind-storage.yaml
Normal file
122
apps/base/forgejo/runner-dind-storage.yaml
Normal file
|
|
@ -0,0 +1,122 @@
|
||||||
|
---
|
||||||
|
# Static storage for the arm64 runners' in-cluster dind daemons.
|
||||||
|
#
|
||||||
|
# Why static PVs and not the default `local-path` StorageClass: the
|
||||||
|
# provisioner's helper pod is hardcoded to siriussec
|
||||||
|
# (infrastructure/storage/local-path-storage.yaml, helper-pod nodeSelector) and
|
||||||
|
# for a local filesystem it never sets spec.nodeName, so a `local-path` PVC
|
||||||
|
# consumed by a pod on rpi stays Pending forever ("NodeAffinity failed").
|
||||||
|
# Measured 2026-10-27 in a throwaway namespace; see
|
||||||
|
# docs/arm64-runner-dind.md §6.1.
|
||||||
|
#
|
||||||
|
# `persistentVolumeReclaimPolicy: Retain` is deliberate: the runner's
|
||||||
|
# registration (`runner.ini`, uuid of the Forgejo action_runner row) lives in
|
||||||
|
# this directory. Deleting the PVC must never delete the identity — a re-
|
||||||
|
# registered runner burns a single-use token and leaves an orphaned
|
||||||
|
# action_runner row behind.
|
||||||
|
#
|
||||||
|
# Sizes come from measured steady state (docs/arm64-runner-dind.md §4):
|
||||||
|
# shared runner 146.5 GiB steady -> 200Gi request (named CI volumes)
|
||||||
|
# deploy runner ~0.3 GiB steady -> 40Gi request (image + buildx generations)
|
||||||
|
# 240 GiB of the Pi's 390 GiB free. A static PV does not enforce the request —
|
||||||
|
# the 70 % node-filesystem alert in monitoring/controllers/home/prune-alerts.yaml
|
||||||
|
# is the real cap.
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: local-static
|
||||||
|
# No provisioner: every PV with this class is hand-made, so a typo'd claim
|
||||||
|
# hangs in Pending instead of silently landing somewhere unexpected.
|
||||||
|
provisioner: kubernetes.io/no-provisioner
|
||||||
|
volumeBindingMode: WaitForFirstConsumer
|
||||||
|
reclaimPolicy: Retain
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: forgejo-runner-arm64-dind
|
||||||
|
labels:
|
||||||
|
app: forgejo-runner
|
||||||
|
arch: arm64
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 200Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
storageClassName: local-static
|
||||||
|
volumeMode: Filesystem
|
||||||
|
hostPath:
|
||||||
|
# Same filesystem/tree the local-path provisioner uses, so df and the
|
||||||
|
# existing node-exporter alerting see it as ordinary node disk.
|
||||||
|
path: /opt/local-path-provisioner/forgejo-runner-arm64-dind
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- rpi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: forgejo-runner-arm64-dind
|
||||||
|
namespace: forgejo
|
||||||
|
labels:
|
||||||
|
app: forgejo-runner
|
||||||
|
arch: arm64
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: local-static
|
||||||
|
volumeName: forgejo-runner-arm64-dind
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 200Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: forgejo-runner-deploy-arm64-dind
|
||||||
|
labels:
|
||||||
|
app: forgejo-runner
|
||||||
|
role: deploy
|
||||||
|
spec:
|
||||||
|
capacity:
|
||||||
|
storage: 40Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
storageClassName: local-static
|
||||||
|
volumeMode: Filesystem
|
||||||
|
hostPath:
|
||||||
|
path: /opt/local-path-provisioner/forgejo-runner-deploy-arm64-dind
|
||||||
|
type: DirectoryOrCreate
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- rpi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: forgejo-runner-deploy-arm64-dind
|
||||||
|
namespace: forgejo
|
||||||
|
labels:
|
||||||
|
app: forgejo-runner
|
||||||
|
role: deploy
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: local-static
|
||||||
|
volumeName: forgejo-runner-deploy-arm64-dind
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 40Gi
|
||||||
|
|
@ -127,6 +127,43 @@ spec:
|
||||||
raise the PVC, or clear the dind data-root deliberately (see the
|
raise the PVC, or clear the dind data-root deliberately (see the
|
||||||
DiskPressure runbook in the home-k8s skill) — do not wipe it
|
DiskPressure runbook in the home-k8s skill) — do not wipe it
|
||||||
while the runner pod is up.
|
while the runner pod is up.
|
||||||
|
- name: dind-disk-cap
|
||||||
|
rules:
|
||||||
|
# Pi-specific cap, added with the arm64 dind cutover (kanban
|
||||||
|
# t_0da0a1cc). The two arm64 runners now hold 240 GiB of dind PVCs
|
||||||
|
# (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
|
||||||
|
# enforce its claim, and the `RunnerDindPvc*` rules cannot fire for it
|
||||||
|
# (no kubelet_volume_stats_* series on this cluster), so this node
|
||||||
|
# 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.
|
||||||
|
# `NodeFilesystemFillingUp` below stays at 85 % as the backstop.
|
||||||
|
- alert: RpiDindDataRootFillingUp
|
||||||
|
expr: |
|
||||||
|
(
|
||||||
|
1 - (
|
||||||
|
node_filesystem_avail_bytes{mountpoint="/", fstype=~"ext4|xfs|btrfs", instance=~"10.10.0.1:.*"}
|
||||||
|
/
|
||||||
|
node_filesystem_size_bytes{mountpoint="/", fstype=~"ext4|xfs|btrfs", instance=~"10.10.0.1:.*"}
|
||||||
|
)
|
||||||
|
) * on (instance) group_left (nodename) node_uname_info{nodename="rpi"} > 0.70
|
||||||
|
for: 30m
|
||||||
|
labels:
|
||||||
|
severity: warning
|
||||||
|
annotations:
|
||||||
|
summary: >-
|
||||||
|
rpi root filesystem is {{ $value | humanizePercentage }} full
|
||||||
|
(dind CI data-roots live here)
|
||||||
|
description: >-
|
||||||
|
The arm64 runners' dind data-roots (PVCs forgejo-runner-arm64-dind
|
||||||
|
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 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 create job --from=cronjob/forgejo-runner-prune prune-manual-$(date +%s)`.
|
||||||
|
See docs/arm64-runner-dind.md §4.4.
|
||||||
- name: disk-capacity
|
- name: disk-capacity
|
||||||
rules:
|
rules:
|
||||||
- alert: NodeFilesystemFillingUp
|
- alert: NodeFilesystemFillingUp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue