2026-09-11 22:24:41 -04:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
2026-09-11 22:34:33 -04:00
|
|
|
name: forgejo-runner-arm64
|
2026-09-11 22:24:41 -04:00
|
|
|
namespace: forgejo
|
|
|
|
|
labels:
|
|
|
|
|
app: forgejo-runner
|
2026-09-11 22:34:33 -04:00
|
|
|
arch: arm64
|
2026-09-11 22:24:41 -04:00
|
|
|
spec:
|
|
|
|
|
replicas: 1
|
|
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: forgejo-runner
|
2026-09-11 22:34:33 -04:00
|
|
|
arch: arm64
|
2026-10-27 02:03:11 -04:00
|
|
|
# RWO PVC: never two pods on one data-root.
|
2026-09-11 22:24:41 -04:00
|
|
|
strategy:
|
|
|
|
|
type: Recreate
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
|
|
|
|
labels:
|
|
|
|
|
app: forgejo-runner
|
2026-09-11 22:34:33 -04:00
|
|
|
arch: arm64
|
2026-09-11 22:24:41 -04:00
|
|
|
spec:
|
|
|
|
|
nodeSelector:
|
|
|
|
|
kubernetes.io/hostname: rpi
|
|
|
|
|
tolerations:
|
|
|
|
|
- key: dedicated
|
|
|
|
|
operator: Equal
|
|
|
|
|
value: network
|
|
|
|
|
effect: PreferNoSchedule
|
2026-10-27 02:03:11 -04:00
|
|
|
# No supplementalGroups: there is no host docker socket and no host
|
|
|
|
|
# docker gid to match any more. The only daemon this runner talks to is
|
|
|
|
|
# the privileged `dind` sidecar below.
|
2026-09-11 22:24:41 -04:00
|
|
|
containers:
|
2026-10-27 02:03:11 -04:00
|
|
|
# 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
|
|
|
|
|
- |
|
2026-11-16 20:41:20 -05:00
|
|
|
# A reboot restarts this container inside the same pod, so the
|
|
|
|
|
# dind-run emptyDir keeps the previous daemon's pid file. dockerd
|
|
|
|
|
# then refuses to start ("process with PID N is still running")
|
|
|
|
|
# and the runner crashloops until the pod is deleted by hand.
|
|
|
|
|
# Clear the stale runtime state first so a restart is
|
|
|
|
|
# self-healing.
|
|
|
|
|
rm -f /var/run/docker.pid /var/run/docker.sock
|
2026-10-27 02:57:48 -04:00
|
|
|
# --insecure-registry: the Pi registry is plain HTTP on the WG
|
|
|
|
|
# hub IP. Docker only treats 127.0.0.0/8 as insecure by default,
|
|
|
|
|
# so without this `docker push 10.10.0.1:5000/...` from a job
|
|
|
|
|
# fails with "server gave HTTP response to HTTPS client".
|
|
|
|
|
dockerd --host=unix:///var/run/docker.sock --tls=false --mtu=1420 \
|
|
|
|
|
--insecure-registry=10.10.0.1:5000 &
|
2026-10-27 02:03:11 -04:00
|
|
|
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
|
2026-09-11 22:24:41 -04:00
|
|
|
- name: runner
|
2026-09-18 23:50:30 -04:00
|
|
|
# code.forgejo.org/forgejo/runner is genuinely multi-arch and works on
|
|
|
|
|
# both the amd64 (siriussec) and arm64 (rpi) runners. Do NOT swap this
|
|
|
|
|
# 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
|
2026-10-27 02:03:11 -04:00
|
|
|
# with "exec format error" and the pi runner (the only runner declaring
|
2026-09-18 23:50:30 -04:00
|
|
|
# the bare `docker` label) goes offline, stalling every `runs-on: docker`
|
|
|
|
|
# job in onionwire/siriusdevops-contact.
|
|
|
|
|
image: code.forgejo.org/forgejo/runner:5.0.1
|
2026-09-11 22:24:41 -04:00
|
|
|
imagePullPolicy: IfNotPresent
|
2026-10-27 02:03:11 -04:00
|
|
|
# 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
|
2026-09-11 22:24:41 -04:00
|
|
|
command:
|
2026-10-27 02:03:11 -04:00
|
|
|
- sh
|
|
|
|
|
- -c
|
|
|
|
|
- |
|
|
|
|
|
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
|
2026-09-11 22:24:41 -04:00
|
|
|
env:
|
|
|
|
|
- name: DOCKER_HOST
|
|
|
|
|
value: unix:///var/run/docker.sock
|
|
|
|
|
volumeMounts:
|
|
|
|
|
- name: config-toml
|
|
|
|
|
mountPath: /config/config.toml
|
2026-09-11 22:34:33 -04:00
|
|
|
subPath: arm64.toml
|
2026-10-27 02:03:11 -04:00
|
|
|
# runner.ini + actions cache live on the same PVC as the dind
|
|
|
|
|
# data-root (subPath docker), so one Retain PV holds the whole
|
|
|
|
|
# runner identity. Copied from the Pi host before first start —
|
|
|
|
|
# never registered here, the uuid must survive.
|
|
|
|
|
- name: data
|
|
|
|
|
mountPath: /data
|
|
|
|
|
- name: dind-run
|
|
|
|
|
mountPath: /var/run
|
2026-09-11 22:24:41 -04:00
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
cpu: 50m
|
|
|
|
|
memory: 128Mi
|
|
|
|
|
limits:
|
|
|
|
|
memory: 512Mi
|
|
|
|
|
volumes:
|
|
|
|
|
- name: config-toml
|
|
|
|
|
configMap:
|
|
|
|
|
name: forgejo-runner-config
|
2026-10-27 02:03:11 -04:00
|
|
|
- name: data
|
|
|
|
|
persistentVolumeClaim:
|
|
|
|
|
claimName: forgejo-runner-arm64-dind
|
|
|
|
|
- name: dind-run
|
|
|
|
|
emptyDir: {}
|