gitea-runner: integrate buildkit, migrate runner to statefulset
This commit is contained in:
76
gitea-runner/statefulset.yaml
Normal file
76
gitea-runner/statefulset.yaml
Normal file
@@ -0,0 +1,76 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: act-runner
|
||||
namespace: gitea-runner
|
||||
labels:
|
||||
app: act-runner
|
||||
spec:
|
||||
serviceName: ""
|
||||
selector:
|
||||
matchLabels:
|
||||
app: act-runner
|
||||
replicas: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: act-runner
|
||||
spec:
|
||||
containers:
|
||||
- name: runner
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...';
|
||||
sleep 5; done; /sbin/tini -- run.sh
|
||||
image: gitea/act_runner:nightly
|
||||
imagePullPolicy: Always
|
||||
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: https://git.dubyatp.xyz
|
||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: token
|
||||
name: runner-secret
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
volumeMounts:
|
||||
- name: docker-certs
|
||||
mountPath: /certs
|
||||
- name: runner-data
|
||||
mountPath: /data
|
||||
- name: daemon
|
||||
env:
|
||||
- name: DOCKER_TLS_CERTDIR
|
||||
value: /certs
|
||||
image: docker:23.0.6-dind
|
||||
imagePullPolicy: IfNotPresent
|
||||
securityContext:
|
||||
privileged: true
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
volumeMounts:
|
||||
- mountPath: /certs
|
||||
name: docker-certs
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- name: docker-certs
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: runner-data
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: weyma-shared
|
||||
resources:
|
||||
requests:
|
||||
storage: 32Gi
|
||||
Reference in New Issue
Block a user