100 lines
2.5 KiB
YAML
100 lines
2.5 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:
|
|
nodeSelector:
|
|
kubernetes.io/hostname: chemavx-k8
|
|
restartPolicy: Always
|
|
volumes:
|
|
- name: runner-data
|
|
emptyDir: {}
|
|
- name: runner-config
|
|
configMap:
|
|
name: gitea-runner-config
|
|
- name: dind-storage
|
|
emptyDir:
|
|
sizeLimit: "10Gi"
|
|
- name: docker-daemon-config
|
|
configMap:
|
|
name: docker-daemon-config
|
|
containers:
|
|
- name: dind
|
|
image: docker:24-dind
|
|
imagePullPolicy: IfNotPresent
|
|
args:
|
|
- --host=tcp://0.0.0.0:2375
|
|
- --tls=false
|
|
env:
|
|
- name: DOCKER_TLS_CERTDIR
|
|
value: ""
|
|
securityContext:
|
|
privileged: true
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 2Gi
|
|
limits:
|
|
cpu: "2"
|
|
memory: 4Gi
|
|
livenessProbe:
|
|
exec:
|
|
command: ["docker", "info"]
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 30
|
|
failureThreshold: 3
|
|
volumeMounts:
|
|
- mountPath: /var/lib/docker
|
|
name: dind-storage
|
|
- mountPath: /etc/docker/daemon.json
|
|
name: docker-daemon-config
|
|
subPath: daemon.json
|
|
- name: runner
|
|
image: gitea/act_runner:latest
|
|
imagePullPolicy: Always
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
args:
|
|
- |
|
|
until nc -z localhost 2375 2>/dev/null; do sleep 1; done
|
|
exec /usr/local/bin/run.sh
|
|
env:
|
|
- name: GITEA_INSTANCE_URL
|
|
value: http://gitea.gitea.svc.cluster.local:3000
|
|
- name: GITEA_RUNNER_NAME
|
|
value: k8s-runner
|
|
- name: CONFIG_FILE
|
|
value: /etc/act_runner/config.yaml
|
|
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: gitea-runner-secret
|
|
key: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
- name: DOCKER_HOST
|
|
value: tcp://localhost:2375
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: "1"
|
|
memory: 512Mi
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: runner-data
|
|
- mountPath: /etc/act_runner
|
|
name: runner-config
|