Enable k3s single-node server on ringtail (NixOS) for native amd64 container builds. Includes ArgoCD Application and manifests for a Forgejo Actions runner with the `k8s-amd64` label, Ansible bootstrap tasks for k3s token and runner secret, and containerd registry mirrors pulling through Zot on indri. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
89 lines
2.5 KiB
YAML
89 lines
2.5 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: forgejo-runner-amd64
|
|
namespace: forgejo-runner
|
|
labels:
|
|
app: forgejo-runner-amd64
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: forgejo-runner-amd64
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: forgejo-runner-amd64
|
|
spec:
|
|
containers:
|
|
# Forgejo runner daemon
|
|
- name: runner
|
|
image: code.forgejo.org/forgejo/runner:6.3.1
|
|
env:
|
|
- name: TZ
|
|
value: America/Los_Angeles
|
|
- name: DOCKER_HOST
|
|
value: tcp://localhost:2375
|
|
- name: FORGEJO_URL
|
|
value: "https://forge.ops.eblu.me"
|
|
- name: RUNNER_NAME
|
|
value: "k8s-amd64-runner"
|
|
- name: RUNNER_LABELS
|
|
value: "k8s-amd64:docker://registry.ops.eblu.me/blumeops/forgejo-runner:v3.2.0-amd64"
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
# Wait for DinD to be ready
|
|
echo "Waiting for Docker daemon..."
|
|
while ! wget -q -O /dev/null http://localhost:2375/_ping 2>/dev/null; do
|
|
sleep 1
|
|
done
|
|
echo "Docker daemon ready"
|
|
|
|
# Register if not already registered
|
|
if [ ! -f /data/.runner ]; then
|
|
echo "Registering runner..."
|
|
forgejo-runner register \
|
|
--instance "$FORGEJO_URL" \
|
|
--token "$RUNNER_TOKEN" \
|
|
--name "$RUNNER_NAME" \
|
|
--labels "$RUNNER_LABELS" \
|
|
--no-interactive
|
|
fi
|
|
|
|
# Start daemon
|
|
exec forgejo-runner daemon --config /config/config.yaml
|
|
envFrom:
|
|
- secretRef:
|
|
name: forgejo-runner-env
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
- name: config
|
|
mountPath: /config
|
|
|
|
# Docker-in-Docker sidecar
|
|
- name: dind
|
|
image: docker:27-dind
|
|
securityContext:
|
|
privileged: true
|
|
env:
|
|
- name: DOCKER_TLS_CERTDIR
|
|
value: ""
|
|
volumeMounts:
|
|
- name: dind-storage
|
|
mountPath: /var/lib/docker
|
|
- name: config
|
|
mountPath: /etc/docker/daemon.json
|
|
subPath: daemon.json
|
|
readOnly: true
|
|
|
|
volumes:
|
|
- name: data
|
|
emptyDir: {}
|
|
- name: dind-storage
|
|
emptyDir: {}
|
|
- name: config
|
|
configMap:
|
|
name: forgejo-runner-config
|