ci: fix runner labels + CoreDNS rewrite + cleanup

- Runners use public images (code.forgejo.org/forgejo/runner:6)
- Labels pull from Docker Hub: golang:1.26, node:22, rust:1-bookworm
- Add CoreDNS api.riotpiao.com rewrite
- Fix runner re-registration to keep labels in sync
- Add unified CI pattern docs to CLAUDE.example.md
- Remove dead .forgejo/ workflow dir (Forgejo uses .gitea/)
This commit is contained in:
2026-09-07 13:01:56 -07:00
parent 1777188f85
commit 1a8e87131b
9 changed files with 143 additions and 295 deletions
@@ -36,3 +36,4 @@ data:
valid_volumes:
- /docker-certs/client
network: host
docker_host: automount
@@ -34,7 +34,11 @@ spec:
command: ["sh", "-c"]
args:
- |
test -f /data/.runner || forgejo-runner register --no-interactive \
# Always re-register to keep labels in sync with values.yaml.
# Without this, changing a runner label requires manually deleting
# the PVC or .runner file — not GitOps-friendly.
rm -f /data/.runner
forgejo-runner register --no-interactive \
--instance {{ .Values.runner.forgejoUrl }} \
--token $(RUNNER_TOKEN) \
--name {{ .Values.runner.name }} \
@@ -70,6 +74,8 @@ spec:
mountPath: /data
- name: docker-certs
mountPath: /docker-certs
- name: docker-sock
mountPath: /run
- name: homelab-ca
mountPath: /etc/ssl/certs/homelab-ca.pem
subPath: ca.crt
@@ -89,6 +95,8 @@ spec:
volumeMounts:
- name: docker-certs
mountPath: /docker-certs
- name: docker-sock
mountPath: /run
- name: dind-storage
mountPath: /var/lib/docker
- name: homelab-ca
@@ -113,6 +121,8 @@ spec:
claimName: {{ .Release.Name }}-dind
- name: docker-certs
emptyDir: {} # DinD regenerates mTLS certs on each start
- name: docker-sock
emptyDir: {} # Shared docker socket between dind and runner
- name: homelab-ca
# homelab-ca is a ConfigMap (public CA trust bundle), not a Secret.
# The volumeMounts use subPath: ca.crt to project the single cert file.
+5 -2
View File
@@ -2,9 +2,12 @@
# runner instance. Only runner.name and runner.labels differ -- everything
# else (image, dind, persistence, tolerations, nodeSelector) is shared.
#
# node:22-bookworm ships Node natively. Docker client installed via workflow step if needed.
# (homelab has no CI; custom runner images built manually if desired)
# Label image: node:22-bookworm — Debian, root, apt-get, Node.js, npm, git.
# Install docker in workflow steps as needed.
runner:
image:
repository: code.forgejo.org/forgejo/runner
tag: "6"
name: node-runner
labels: "node:docker://node:22-bookworm"
+7 -11
View File
@@ -2,20 +2,16 @@
# runner instance. Only runner.name and runner.labels differ -- everything
# else (image, dind, persistence, tolerations, nodeSelector) is shared.
#
# Use docker:27-cli instead of rust:1.83-bookworm because:
# - Needs Node.js for GitHub Actions (actions/checkout@v4, etc.)
# - Has docker CLI + git + full dev tools
# - rust:1.83-bookworm lacks Node.js (causes action failures)
#
# docker:27-cli verified: docker manifest inspect docker:27-cli ✓
# Label image: rust:1-bookworm — Debian, root, apt-get, Rust, cargo, git.
# Install Node.js/docker in workflow steps as needed.
runner:
image:
repository: code.forgejo.org/forgejo/runner
tag: "6"
name: rust-runner
labels: "rust:docker://docker:27-cli"
labels: "rust:docker://rust:1-bookworm"
persistence:
reg:
storageClass: longhorn
size: 20Gi
# GC CronJob renders only from the default (golang) values to avoid duplicates
gc:
+5 -12
View File
@@ -1,20 +1,13 @@
runner:
image:
repository: code.forgejo.org/forgejo/runner
tag: "6" # pin exact release before apply
tag: "6"
name: golang-runner
# Use docker:27-cli instead of golang:1.26-bookworm because:
# - Needs Node.js for GitHub Actions (actions/checkout@v4, etc.)
# - Has docker CLI + git + golang + all build tools
# - golang:1.26-bookworm lacks Node.js (causes action failures)
# docker:27-cli includes Go toolchain via base debian + additional packages
# Verified tag: docker manifest inspect docker:27-cli ✓
labels: "golang:docker://docker:27-cli"
# In-cluster Service (:3000) — direct, avoids the ingress/public-hostname hop
# (the public URL is :443 which forgejo doesn't serve; runner got i/o timeout).
# Label image is what workflow steps run in (NOT the runner daemon image).
# golang:1.26-bookworm: Debian, root, apt-get, Go, git.
# TODO: Switch to custom image once build-runner-images.yml pushes images
labels: "golang:docker://golang:1.26-bookworm"
forgejoUrl: http://forgejo-gitea-http.cicd.svc.cluster.local:3000
# tokenSecret: name of the K8s Secret that holds the runner registration token
# created automatically by the helmfile presync hook (see helmfile.yaml.gotmpl)
tokenSecret: runner-token
resources:
requests: