mirror of
https://github.com/SamyRai/turash.git
synced 2025-12-26 23:01:33 +00:00
- Add Node.js installation in runner startup command - Use :host labels instead of docker paths (as recommended) - Add auto-registration check to handle emptyDir volume resets - Fix working directory to /data for .runner file location This fixes the 'Cannot find: node in PATH' error when running GitHub Actions like actions/checkout@v4 and actions/setup-node@v4
86 lines
2.2 KiB
YAML
86 lines
2.2 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: docker-daemon
|
|
image: docker:dind
|
|
env:
|
|
- name: DOCKER_TLS_CERTDIR
|
|
value: ""
|
|
securityContext:
|
|
privileged: true
|
|
volumeMounts:
|
|
- name: docker-graph-storage
|
|
mountPath: /var/lib/docker
|
|
- name: docker-config
|
|
mountPath: /root/.docker/
|
|
readOnly: true
|
|
- name: runner
|
|
image: gitea/act_runner:latest
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
apk add --no-cache nodejs npm || true
|
|
cd /data
|
|
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: DOCKER_HOST
|
|
value: "tcp://localhost:2375"
|
|
- name: ACT_RUNNER_CONFIG
|
|
value: "/data/.runner_config.yaml"
|
|
volumeMounts:
|
|
- name: runner-data
|
|
mountPath: /data
|
|
- name: docker-graph-storage
|
|
mountPath: /var/lib/docker
|
|
- 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: docker-graph-storage
|
|
emptyDir: {}
|
|
- name: runner-config
|
|
configMap:
|
|
name: gitea-runner-config
|
|
- name: docker-config
|
|
configMap:
|
|
name: docker-config
|
|
dnsPolicy: ClusterFirst
|