turash/k8s/gitea-runners/deployment.yaml
Damir Mukimov f3e6e9d44a
Some checks failed
CI/CD Pipeline / backend-lint (push) Failing after 31s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / frontend-lint (push) Successful in 1m38s
CI/CD Pipeline / frontend-build (push) Failing after 25s
CI/CD Pipeline / e2e-test (push) Has been skipped
feat: switch to containerd-native CI/CD with buildah
- Replace Docker-based CI/CD with buildah for containerd compatibility
- Remove Docker-in-Docker setup from Gitea runner deployment
- Use buildah/podman which work natively with containerd runtime
- Install buildah and podman in runner container during startup
- Maintain Harbor registry integration and caching capabilities

Benefits:
- Native containerd compatibility (no Docker daemon needed)
- Lighter resource usage (no DinD overhead)
- Better integration with K3s containerd runtime
- Same Harbor registry functionality with cleaner architecture
2025-12-25 16:13:58 +01:00

67 lines
1.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea-runner
namespace: gitea-runners
labels:
app: gitea-runner
spec:
replicas: 4
selector:
matchLabels:
app: gitea-runner
template:
metadata:
labels:
app: gitea-runner
spec:
containers:
- name: runner
image: gitea/act_runner:latest
command:
- sh
- -c
- |
apk add --no-cache nodejs npm buildah podman || true
cd /data
if [ ! -f .runner ]; then
/usr/local/bin/act_runner register --instance "$GITEA_INSTANCE_URL" --token "$GITEA_RUNNER_REGISTRATION_TOKEN" --name "$GITEA_RUNNER_NAME" --labels "$GITEA_RUNNER_LABELS" --no-interactive || true
fi
exec /usr/local/bin/act_runner daemon
env:
- name: GITEA_INSTANCE_URL
value: "http://gitea.gitea.svc.cluster.local:3000"
- name: GITEA_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: gitea-runner-secret
key: GITEA_RUNNER_REGISTRATION_TOKEN
- name: GITEA_RUNNER_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: GITEA_RUNNER_LABELS
value: "ubuntu-latest:host,ubuntu-22.04:host,ubuntu-20.04:host"
- name: ACT_RUNNER_CONFIG
value: "/data/.runner_config.yaml"
volumeMounts:
- name: runner-data
mountPath: /data
- name: runner-config
mountPath: /data/.runner_config.yaml
subPath: config.yaml
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "2Gi"
cpu: "2000m"
volumes:
- name: runner-data
emptyDir: {}
- name: runner-config
configMap:
name: gitea-runner-config
dnsPolicy: ClusterFirst