This commit is contained in:
Eason(G Ray)
2024-06-28 13:43:34 +08:00
commit 14df1fb03b
11 changed files with 379 additions and 0 deletions

75
runner/deployment.yml Normal file
View File

@ -0,0 +1,75 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: gitea-runner
spec:
serviceName: "gitea-runner-service"
selector:
matchLabels:
app: gitea-runner
replicas: 1
template:
metadata:
labels:
app: gitea-runner
spec:
containers:
- name: gitea-runner-dind
securityContext:
privileged: true
image: docker:dind
env:
- name: DOCKER_DRIVER
value: "overlay2"
- name: DOCKER_TLS_CERTDIR
value: ""
volumeMounts:
- name: docker-socket
mountPath: "/var/run"
- name: gitea-runner
image: gitea/act_runner:nightly
env:
# FIXME: use secret
- name: GITEA_RUNNER_REGISTRATION_TOKEN
value: "MPAEFqYGNTXhkmgJFMyakT58epIpQMfxQ6d20yyb"
- name: GITEA_INSTANCE_URL
value: "http://gitea.k8s.example.com:30429/"
- name: CONFIG_FILE
value: "/config/config.yaml"
volumeMounts:
- name: config
mountPath: "/config"
readOnly: true
- name: runner-data
mountPath: "/data"
- name: docker-socket
mountPath: "/var/run"
# FIXME: use socat
startupProbe:
exec:
command: ["/bin/sh", "-c", "sleep 10"]
timeoutSeconds: 12
volumes:
- name: config
configMap:
name: gitea-runner
items:
- key: "config"
path: "config.yaml"
volumeClaimTemplates:
- metadata:
name: runner-data
spec:
accessModes:
- "ReadWriteOncePod"
resources:
requests:
storage: 256Mi
- metadata:
name: docker-socket
spec:
accessModes:
- "ReadWriteOncePod"
resources:
requests:
storage: 256Mi