From e6f55840e2f8aec6fd0407b2856b155f09966e0a Mon Sep 17 00:00:00 2001 From: SeanOMik <seanomik@gmail.com> Date: Thu, 2 Jan 2025 13:03:18 -0500 Subject: [PATCH] fix(forgejo-runner): use config file, convert to statefulset to create cache mount --- .../main/apps/dev/forgejo-runner/app/config.yaml | 2 +- .../apps/dev/forgejo-runner/app/runner-dep.yaml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/kubernetes/main/apps/dev/forgejo-runner/app/config.yaml b/kubernetes/main/apps/dev/forgejo-runner/app/config.yaml index 74e620a2..e5fdc202 100644 --- a/kubernetes/main/apps/dev/forgejo-runner/app/config.yaml +++ b/kubernetes/main/apps/dev/forgejo-runner/app/config.yaml @@ -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", diff --git a/kubernetes/main/apps/dev/forgejo-runner/app/runner-dep.yaml b/kubernetes/main/apps/dev/forgejo-runner/app/runner-dep.yaml index a8b98f0a..8b7f02d1 100644 --- a/kubernetes/main/apps/dev/forgejo-runner/app/runner-dep.yaml +++ b/kubernetes/main/apps/dev/forgejo-runner/app/runner-dep.yaml @@ -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