From cbe05754534d79927643a8474aeeb8fcbd895fd9 Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 00:37:41 -0400 Subject: [PATCH 01/10] Pin Cilium Gateway hostNetwork to siriussec. Cilium Envoy cannot reach overlay backends on another node (503 cx_connect_fail). Same-node listener next to workloads works; cloudflared origins point at the T480 LAN:8080. --- infrastructure/networking/cilium/values.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/infrastructure/networking/cilium/values.yaml b/infrastructure/networking/cilium/values.yaml index 51ece41..30abeee 100644 --- a/infrastructure/networking/cilium/values.yaml +++ b/infrastructure/networking/cilium/values.yaml @@ -4,13 +4,17 @@ k8sServicePort: "6443" l7Proxy: true +socketLB: + enabled: true + hostNamespaceOnly: false + gatewayAPI: enabled: true hostNetwork: enabled: true nodes: matchLabels: - dedicated: network + gateway: "true" envoy: enabled: true From 20f967ffa30d9e00a1594efdee7f1a9456e730c3 Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 21:54:13 -0400 Subject: [PATCH 02/10] Switch Cilium to native routing over WireGuard. Pod CIDRs ride the existing hub-and-spoke mesh (no VXLAN). Envoy cross-node handshake is still identity-8; Gateway stays on siriussec. --- infrastructure/networking/cilium/values.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/infrastructure/networking/cilium/values.yaml b/infrastructure/networking/cilium/values.yaml index 30abeee..5ca43e9 100644 --- a/infrastructure/networking/cilium/values.yaml +++ b/infrastructure/networking/cilium/values.yaml @@ -30,5 +30,7 @@ ipam: clusterPoolIPv4PodCIDRList: - 10.244.0.0/16 -routingMode: tunnel -tunnelProtocol: vxlan +routingMode: native +autoDirectNodeRoutes: true +ipv4NativeRoutingCIDR: 10.244.0.0/16 +enableIPv4Masquerade: true From 5e1a2b4f8d3e06ebd373e54c5a1a84105de1105b Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 22:24:41 -0400 Subject: [PATCH 03/10] Run Forgejo Actions runner as a cluster Deployment on rpi. Reuses the existing pi-runner registration and host Docker socket. Compose runner is stopped so it cannot double-poll. --- apps/base/forgejo/kustomization.yaml | 2 + apps/base/forgejo/runner-configmap.yaml | 22 ++++++ apps/base/forgejo/runner-deployment.yaml | 92 ++++++++++++++++++++++++ 3 files changed, 116 insertions(+) create mode 100644 apps/base/forgejo/runner-configmap.yaml create mode 100644 apps/base/forgejo/runner-deployment.yaml diff --git a/apps/base/forgejo/kustomization.yaml b/apps/base/forgejo/kustomization.yaml index 5f575b3..f46508d 100644 --- a/apps/base/forgejo/kustomization.yaml +++ b/apps/base/forgejo/kustomization.yaml @@ -7,3 +7,5 @@ resources: - cluster.yaml - deployment.yaml - service.yaml + - runner-configmap.yaml + - runner-deployment.yaml diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml new file mode 100644 index 0000000..e442487 --- /dev/null +++ b/apps/base/forgejo/runner-configmap.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: forgejo-runner-config + namespace: forgejo +data: + config.toml: | + log: + level: info + runner: + file: /config/runner.ini + capacity: 2 + timeout: 1h + cache: /opt/siriusdevops/runner/cache + cache: + enabled: true + dir: /opt/siriusdevops/runner/cache + container: + privileged: true + 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 + valid_volumes: + - "**" diff --git a/apps/base/forgejo/runner-deployment.yaml b/apps/base/forgejo/runner-deployment.yaml new file mode 100644 index 0000000..1514f0c --- /dev/null +++ b/apps/base/forgejo/runner-deployment.yaml @@ -0,0 +1,92 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: forgejo-runner + namespace: forgejo + labels: + app: forgejo-runner +spec: + replicas: 1 + selector: + matchLabels: + app: forgejo-runner + strategy: + type: Recreate + template: + metadata: + labels: + app: forgejo-runner + spec: + nodeSelector: + kubernetes.io/hostname: rpi + tolerations: + - key: dedicated + operator: Equal + value: network + effect: PreferNoSchedule + containers: + - name: runner + image: code.forgejo.org/forgejo/runner:5.0.1 + imagePullPolicy: IfNotPresent + command: + - forgejo-runner + - --config + - /config/config.toml + - daemon + env: + - name: DOCKER_HOST + value: unix:///var/run/docker.sock + securityContext: + privileged: true + 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 + mountPath: /config/config.toml + subPath: config.toml + - name: runner-ini + mountPath: /config/runner.ini + - name: cache + mountPath: /opt/siriusdevops/runner/cache + - name: siriusdevops + mountPath: /opt/siriusdevops + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + memory: 512Mi + 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 + configMap: + name: forgejo-runner-config + - name: runner-ini + hostPath: + path: /opt/siriusdevops/runner/config/runner.ini + type: File + - name: cache + hostPath: + path: /opt/siriusdevops/runner/cache + type: DirectoryOrCreate + - name: siriusdevops + hostPath: + path: /opt/siriusdevops + type: Directory From 8783d77d5e4c2bac07c6ad2da8a91692a6eeeb9c Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 22:25:44 -0400 Subject: [PATCH 04/10] Give the k8s Forgejo runner docker.sock access as root+docker gid. --- apps/base/forgejo/runner-deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/base/forgejo/runner-deployment.yaml b/apps/base/forgejo/runner-deployment.yaml index 1514f0c..dea2c47 100644 --- a/apps/base/forgejo/runner-deployment.yaml +++ b/apps/base/forgejo/runner-deployment.yaml @@ -24,6 +24,8 @@ spec: operator: Equal value: network effect: PreferNoSchedule + securityContext: + supplementalGroups: [984] containers: - name: runner image: code.forgejo.org/forgejo/runner:5.0.1 @@ -38,6 +40,8 @@ spec: value: unix:///var/run/docker.sock securityContext: privileged: true + runAsUser: 0 + runAsGroup: 0 volumeMounts: - name: docker-sock mountPath: /var/run/docker.sock From 455c85b01cafc6aaa7eb346960cbe3ee72190e8f Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 22:34:33 -0400 Subject: [PATCH 05/10] Split Forgejo runners: arm64 on rpi, amd64 dind on siriussec. Pi keeps host Docker and labels docker-arm64/arm64/docker. T480 runs privileged docker:dind; jobs use docker-amd64/amd64. --- apps/base/forgejo/kustomization.yaml | 3 +- apps/base/forgejo/runner-amd64.yaml | 136 ++++++++++++++++++ ...nner-deployment.yaml => runner-arm64.yaml} | 7 +- apps/base/forgejo/runner-configmap.yaml | 19 ++- 4 files changed, 161 insertions(+), 4 deletions(-) create mode 100644 apps/base/forgejo/runner-amd64.yaml rename apps/base/forgejo/{runner-deployment.yaml => runner-arm64.yaml} (95%) diff --git a/apps/base/forgejo/kustomization.yaml b/apps/base/forgejo/kustomization.yaml index f46508d..307bfaf 100644 --- a/apps/base/forgejo/kustomization.yaml +++ b/apps/base/forgejo/kustomization.yaml @@ -8,4 +8,5 @@ resources: - deployment.yaml - service.yaml - runner-configmap.yaml - - runner-deployment.yaml + - runner-arm64.yaml + - runner-amd64.yaml diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml new file mode 100644 index 0000000..84982f3 --- /dev/null +++ b/apps/base/forgejo/runner-amd64.yaml @@ -0,0 +1,136 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: forgejo-runner-amd64 + namespace: forgejo +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: 20Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: forgejo-runner-amd64 + namespace: forgejo + labels: + app: forgejo-runner + arch: amd64 +spec: + replicas: 1 + selector: + matchLabels: + app: forgejo-runner + arch: amd64 + strategy: + type: Recreate + template: + metadata: + labels: + app: forgejo-runner + arch: amd64 + spec: + nodeSelector: + kubernetes.io/hostname: siriussec + securityContext: + fsGroup: 0 + initContainers: + - name: register + image: code.forgejo.org/forgejo/runner:5.0.1 + imagePullPolicy: IfNotPresent + command: + - sh + - -c + - | + set -e + if [ -s /data/runner.ini ]; then + echo already-registered + exit 0 + fi + forgejo-runner register --no-interactive \ + --instance https://forgejo.siriusdevops.com \ + --token "$RUNNER_TOKEN" \ + --name siriussec-amd64 \ + --labels 'docker-amd64:docker://node:20-bullseye,amd64:docker://node:20-bullseye' \ + --config /config/config.toml + env: + - name: RUNNER_TOKEN + valueFrom: + secretKeyRef: + name: forgejo-runner-amd64-token + key: token + volumeMounts: + - name: config-toml + mountPath: /config/config.toml + subPath: amd64.toml + - name: data + mountPath: /data + containers: + - name: dind + image: docker:27-dind + imagePullPolicy: IfNotPresent + args: + - --host=tcp://0.0.0.0:2375 + - --host=unix:///var/run/docker.sock + - --tls=false + env: + - name: DOCKER_TLS_CERTDIR + value: "" + securityContext: + privileged: true + volumeMounts: + - name: dind-run + mountPath: /var/run + - name: data + mountPath: /var/lib/docker + subPath: docker + resources: + requests: + cpu: 200m + memory: 512Mi + limits: + memory: 4Gi + - name: runner + image: code.forgejo.org/forgejo/runner:5.0.1 + imagePullPolicy: IfNotPresent + command: + - sh + - -c + - | + set -e + i=0 + while [ "$i" -lt 60 ]; do + if wget -qO- http://127.0.0.1:2375/_ping >/dev/null 2>&1; then + break + fi + i=$((i+1)) + sleep 2 + done + exec forgejo-runner --config /config/config.toml daemon + env: + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + volumeMounts: + - name: config-toml + mountPath: /config/config.toml + subPath: amd64.toml + - name: data + mountPath: /data + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + memory: 512Mi + volumes: + - name: config-toml + configMap: + name: forgejo-runner-config + - name: data + persistentVolumeClaim: + claimName: forgejo-runner-amd64 + - name: dind-run + emptyDir: {} diff --git a/apps/base/forgejo/runner-deployment.yaml b/apps/base/forgejo/runner-arm64.yaml similarity index 95% rename from apps/base/forgejo/runner-deployment.yaml rename to apps/base/forgejo/runner-arm64.yaml index dea2c47..f3012c9 100644 --- a/apps/base/forgejo/runner-deployment.yaml +++ b/apps/base/forgejo/runner-arm64.yaml @@ -1,21 +1,24 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: forgejo-runner + name: forgejo-runner-arm64 namespace: forgejo labels: app: forgejo-runner + arch: arm64 spec: replicas: 1 selector: matchLabels: app: forgejo-runner + arch: arm64 strategy: type: Recreate template: metadata: labels: app: forgejo-runner + arch: arm64 spec: nodeSelector: kubernetes.io/hostname: rpi @@ -53,7 +56,7 @@ spec: readOnly: true - name: config-toml mountPath: /config/config.toml - subPath: config.toml + subPath: arm64.toml - name: runner-ini mountPath: /config/runner.ini - name: cache diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml index e442487..7297164 100644 --- a/apps/base/forgejo/runner-configmap.yaml +++ b/apps/base/forgejo/runner-configmap.yaml @@ -4,7 +4,7 @@ metadata: name: forgejo-runner-config namespace: forgejo data: - config.toml: | + arm64.toml: | log: level: info runner: @@ -17,6 +17,23 @@ data: dir: /opt/siriusdevops/runner/cache container: privileged: true + docker_host: "unix:///var/run/docker.sock" 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 valid_volumes: - "**" + amd64.toml: | + log: + level: info + runner: + file: /data/runner.ini + capacity: 2 + timeout: 1h + cache: /data/cache + cache: + enabled: true + dir: /data/cache + container: + privileged: true + docker_host: "tcp://127.0.0.1:2375" + valid_volumes: + - "**" From 9a3ed8311f945aa6363ac743b7838ecc175df6bc Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 22:34:49 -0400 Subject: [PATCH 06/10] Bind T480 dind API to localhost only. --- apps/base/forgejo/runner-amd64.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml index 84982f3..9cdbbef 100644 --- a/apps/base/forgejo/runner-amd64.yaml +++ b/apps/base/forgejo/runner-amd64.yaml @@ -73,7 +73,7 @@ spec: image: docker:27-dind imagePullPolicy: IfNotPresent args: - - --host=tcp://0.0.0.0:2375 + - --host=tcp://127.0.0.1:2375 - --host=unix:///var/run/docker.sock - --tls=false env: From 42509aacd92883035bf924f58372603785e670f7 Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 22:37:09 -0400 Subject: [PATCH 07/10] amd64 runner: unix-socket dind only, no TCP 2375. --- apps/base/forgejo/runner-amd64.yaml | 29 +++++++++++++++++-------- apps/base/forgejo/runner-configmap.yaml | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml index 9cdbbef..b6384af 100644 --- a/apps/base/forgejo/runner-amd64.yaml +++ b/apps/base/forgejo/runner-amd64.yaml @@ -72,13 +72,22 @@ spec: - name: dind image: docker:27-dind imagePullPolicy: IfNotPresent - args: - - --host=tcp://127.0.0.1:2375 - - --host=unix:///var/run/docker.sock - - --tls=false - env: - - name: DOCKER_TLS_CERTDIR - value: "" + command: + - sh + - -c + - | + dockerd --host=unix:///var/run/docker.sock --tls=false & + 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: @@ -103,7 +112,7 @@ spec: set -e i=0 while [ "$i" -lt 60 ]; do - if wget -qO- http://127.0.0.1:2375/_ping >/dev/null 2>&1; then + if [ -S /var/run/docker.sock ]; then break fi i=$((i+1)) @@ -112,13 +121,15 @@ spec: exec forgejo-runner --config /config/config.toml daemon env: - name: DOCKER_HOST - value: tcp://127.0.0.1:2375 + value: unix:///var/run/docker.sock volumeMounts: - name: config-toml mountPath: /config/config.toml subPath: amd64.toml - name: data mountPath: /data + - name: dind-run + mountPath: /var/run resources: requests: cpu: 50m diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml index 7297164..a6311d9 100644 --- a/apps/base/forgejo/runner-configmap.yaml +++ b/apps/base/forgejo/runner-configmap.yaml @@ -34,6 +34,6 @@ data: dir: /data/cache container: privileged: true - docker_host: "tcp://127.0.0.1:2375" + docker_host: "unix:///var/run/docker.sock" valid_volumes: - "**" From 62392be60aed1f92876a1df06ee97c1f0a49a805 Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Fri, 11 Sep 2026 23:05:36 -0400 Subject: [PATCH 08/10] forgejo arm64 runner: drop container.docker_host Setting docker_host makes the runner bind the docker socket into the job container itself, colliding with the explicit -v /var/run/docker.sock:/var/run/docker.sock in container.options, so every job died at create with 'Duplicate mount point: /var/run/docker.sock'. Restores the config the Pi compose runner ran green for months. --- apps/base/forgejo/runner-configmap.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml index a6311d9..8cfa3bd 100644 --- a/apps/base/forgejo/runner-configmap.yaml +++ b/apps/base/forgejo/runner-configmap.yaml @@ -17,7 +17,9 @@ data: dir: /opt/siriusdevops/runner/cache container: privileged: true - docker_host: "unix:///var/run/docker.sock" + # No docker_host here: setting it makes the runner inject the host socket + # bind into the job container itself, which collides with the explicit + # -v /var/run/docker.sock in options ("Duplicate mount point"). 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 valid_volumes: - "**" From a3a2c600d61cae2d5311a98165c19b4fd5699ee2 Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Sat, 12 Sep 2026 01:25:51 -0400 Subject: [PATCH 09/10] forgejo amd64 runner: capacity 1 and dockerd --mtu=1420 Two concurrent x86_64 builds on the dind daemon made the second one's egress fail (apt looping on Ign: for Debian InRelease) while a single build on the same daemon succeeded. Serialize the amd64 runner, and match the docker bridge MTU to the pod's 1420 so containers stop assuming a 1500-byte path. --- apps/base/forgejo/runner-amd64.yaml | 2 +- apps/base/forgejo/runner-configmap.yaml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml index b6384af..54813f6 100644 --- a/apps/base/forgejo/runner-amd64.yaml +++ b/apps/base/forgejo/runner-amd64.yaml @@ -76,7 +76,7 @@ spec: - sh - -c - | - dockerd --host=unix:///var/run/docker.sock --tls=false & + dockerd --host=unix:///var/run/docker.sock --tls=false --mtu=1420 & pid=$! i=0 while [ "$i" -lt 30 ]; do diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml index 8cfa3bd..e11e3c1 100644 --- a/apps/base/forgejo/runner-configmap.yaml +++ b/apps/base/forgejo/runner-configmap.yaml @@ -28,7 +28,11 @@ data: level: info runner: file: /data/runner.ini - capacity: 2 + # capacity 1: the dind daemon on this runner holds the release/CI build + # containers and images. Two concurrent x86_64 builds on it made the + # *second* build's egress fail (apt looping on "Ign:" for Debian + # InRelease) while a single build on the same daemon succeeded. + capacity: 1 timeout: 1h cache: /data/cache cache: From 4b0303a58d3d05b04020124238a5abee51e68677 Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Sat, 12 Sep 2026 01:48:10 -0400 Subject: [PATCH 10/10] forgejo arm64 runner: capacity 1 ci.yml builds every test job's Rust target into one shared named volume (onionwire-target-ci at /target). Two jobs writing it concurrently clobber each other's freshly-linked binaries, which then fail with 'could not execute process ... (never executed) Permission denied (os error 13)'. Forgejo's concurrency.group did not serialize two same-group runs (446+447 overlapped), so capacity 1 is the enforced serializer. Cleared the corrupted volume. --- apps/base/forgejo/runner-configmap.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml index e11e3c1..f8cfa31 100644 --- a/apps/base/forgejo/runner-configmap.yaml +++ b/apps/base/forgejo/runner-configmap.yaml @@ -9,7 +9,14 @@ data: level: info runner: file: /config/runner.ini - capacity: 2 + # 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 concurrently clobber each other's freshly-linked test binaries, + # which then fail with "could not execute process ... (never executed) + # Permission denied (os error 13)". capacity 1 is the enforced serializer + # because Forgejo's `concurrency.group` was observed NOT serializing two + # runs of the same group on this runner (446 + 447 overlapped). + capacity: 1 timeout: 1h cache: /opt/siriusdevops/runner/cache cache: