From 2f006b6359e1926439720f1c5ad9f866b645269e Mon Sep 17 00:00:00 2001 From: CTO Agent Date: Sat, 18 Jul 2026 16:10:57 +0000 Subject: [PATCH] fix: register runner with external URL so job containers can resolve Forgejo Docker containers launched by the runner on the host cannot resolve forgejo.forgejo.svc.cluster.local (k8s cluster DNS is not available from host Docker containers). Switching to https://forgejo.basicstack.de for runner registration so GITHUB_SERVER_URL in job context uses the externally reachable URL, fixing git fetch in actions/checkout. Also adds detection to force re-registration if a pod starts with the old internal-URL .runner file still present. Co-Authored-By: Paperclip --- apps/forgejo-runner/forgejo-runner-deployment.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/forgejo-runner/forgejo-runner-deployment.yaml b/apps/forgejo-runner/forgejo-runner-deployment.yaml index 8f49028..52f0ee8 100644 --- a/apps/forgejo-runner/forgejo-runner-deployment.yaml +++ b/apps/forgejo-runner/forgejo-runner-deployment.yaml @@ -25,17 +25,23 @@ spec: - sh - -c - | - # Wait for Forgejo to be ready - while ! wget -q -O- http://forgejo.forgejo.svc.cluster.local:3000/api/healthz > /dev/null 2>&1; do + # Wait for Forgejo to be ready (external URL) + while ! wget -q -O- https://forgejo.basicstack.de/api/healthz > /dev/null 2>&1; do echo "Waiting for Forgejo to be ready..." sleep 5 done + # Re-register if the stored address is the internal cluster URL + if [ -f /data/.runner ] && grep -q "svc.cluster.local" /data/.runner; then + echo "Detected internal cluster URL in .runner — forcing re-registration with external URL" + rm /data/.runner + fi + # Register runner if not already registered if [ ! -f /data/.runner ]; then forgejo-runner register \ --no-interactive \ - --instance http://forgejo.forgejo.svc.cluster.local:3000 \ + --instance https://forgejo.basicstack.de \ --token "$RUNNER_TOKEN" \ --name k3s-runner-1 \ --labels ubuntu-latest:docker://node:24-bookworm,ubuntu-22.04:docker://node:24-bookworm