Talos/testing1/first-cluster/apps/gitea/runner-deployment.yaml
0xWheatyz af0403d330 feat(apps): add Gitea Git service with container registry
Deploy Gitea 1.22 with integrated container registry and CI/CD runner.

Features:
- Git repository hosting
- Container registry on port 5000
- Gitea Act Runner for CI/CD (GitHub Actions compatible)
- LoadBalancer service at 10.0.1.10 (HTTP:80, SSH:22)
- NFS-backed persistent storage (50Gi data, 5Gi config)
- Automatic failover across control plane nodes

Access:
- Web UI: http://10.0.1.10
- SSH: ssh://10.0.1.10:22
- Registry: 10.0.1.10:5000

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-04 01:47:12 +00:00

77 lines
2.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea-runner
namespace: gitea
labels:
app: gitea-runner
spec:
replicas: 1
selector:
matchLabels:
app: gitea-runner
template:
metadata:
labels:
app: gitea-runner
spec:
restartPolicy: Always
volumes:
- name: docker-certs
emptyDir: {}
- name: runner-data
emptyDir: {}
containers:
- name: runner
image: gitea/act_runner:latest
imagePullPolicy: IfNotPresent
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; act_runner register --no-interactive --instance $GITEA_INSTANCE_URL --token $GITEA_RUNNER_REGISTRATION_TOKEN --name $GITEA_RUNNER_NAME --labels $GITEA_RUNNER_LABELS && act_runner daemon"]
env:
- name: DOCKER_HOST
value: tcp://localhost:2376
- name: DOCKER_CERT_PATH
value: /certs/client
- name: DOCKER_TLS_VERIFY
value: "1"
- name: GITEA_INSTANCE_URL
value: "http://gitea:3000"
- name: GITEA_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: runner-secret
key: token
- name: GITEA_RUNNER_NAME
value: "kubernetes-runner"
- name: GITEA_RUNNER_LABELS
value: "ubuntu-latest:docker://node:20-bullseye,ubuntu-22.04:docker://node:20-bullseye"
volumeMounts:
- name: docker-certs
mountPath: /certs
- name: runner-data
mountPath: /data
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "512Mi"
- name: daemon
image: docker:26-dind
imagePullPolicy: IfNotPresent
env:
- name: DOCKER_TLS_CERTDIR
value: /certs
securityContext:
privileged: true
volumeMounts:
- name: docker-certs
mountPath: /certs
resources:
requests:
cpu: "200m"
memory: "256Mi"
limits:
cpu: "1000m"
memory: "1Gi"