fix(forgejo-runner): use config file, convert to statefulset to create cache mount

This commit is contained in:
SeanOMik 2025-01-02 13:03:18 -05:00
parent 9dceb4fe1f
commit e6f55840e2
Signed by: SeanOMik
GPG key ID: FEC9E2FC15235964
2 changed files with 14 additions and 3 deletions
kubernetes/main/apps/dev/forgejo-runner/app

View file

@ -46,7 +46,7 @@ data:
# If it's empty when executing the `daemon`, it will use labels in the `.runner` file.
labels: [
"docker:docker://node:20-bullseye",
// ubuntu
# ubuntu
"ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-latest",
"ubuntu-24.04:docker://ghcr.io/catthehacker/ubuntu:act-24.04",
"ubuntu-22.04:docker://ghcr.io/catthehacker/ubuntu:act-22.04",

View file

@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.4/deployment.json
apiVersion: apps/v1
kind: Deployment
kind: StatefulSet
metadata:
name: forgejo-runner
labels:
@ -53,7 +53,7 @@ spec:
containers:
- name: runner
image: *runnerImg
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner daemon"]
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner daemon --config /data/config.yml"]
env:
- name: DOCKER_HOST
value: tcp://localhost:2376
@ -69,6 +69,8 @@ spec:
- name: runner-config
mountPath: /data/config.yml
subPath: config.yml
- name: forgejo-runner-cache
mountPath: /cache
- name: daemon
image: docker:27.4.1-dind
env:
@ -79,3 +81,12 @@ spec:
volumeMounts:
- name: docker-certs
mountPath: /certs
volumeClaimTemplates:
- metadata:
name: forgejo-runner-cache
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi
storageClassName: openebs-zfs-mainpool