From a2d688657cca49b43e7683b0393cb15c49d97c5d Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Thu, 13 Jun 2024 21:20:05 -0400 Subject: [PATCH] feat: add forgejo-runner --- cluster/apps/dev/forgejo-runner/deploy.yaml | 82 +++++++++++++++++++ .../dev/forgejo-runner/kustomization.yaml | 5 ++ .../dev/forgejo-runner/reg-token.sops.yaml | 70 ++++++++++++++++ cluster/apps/dev/kustomization.yaml | 1 + 4 files changed, 158 insertions(+) create mode 100644 cluster/apps/dev/forgejo-runner/deploy.yaml create mode 100644 cluster/apps/dev/forgejo-runner/kustomization.yaml create mode 100644 cluster/apps/dev/forgejo-runner/reg-token.sops.yaml diff --git a/cluster/apps/dev/forgejo-runner/deploy.yaml b/cluster/apps/dev/forgejo-runner/deploy.yaml new file mode 100644 index 0000000..1c02e71 --- /dev/null +++ b/cluster/apps/dev/forgejo-runner/deploy.yaml @@ -0,0 +1,82 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.4/deployment.json +apiVersion: apps/v1 +kind: Deployment +metadata: + name: forgejo-runner + namespace: dev + labels: + app: forgejo-runner +spec: + replicas: 5 + selector: + matchLabels: + app: forgejo-runner + template: + metadata: + labels: + app: forgejo-runner + spec: + restartPolicy: Always + + volumes: + - name: docker-certs + emptyDir: {} + - name: runner-data + emptyDir: {} + + initContainers: + - name: runner-config-generation + image: code.forgejo.org/forgejo/runner:3.3.0 + command: + - sh + - -c + - forgejo-runner register --no-interactive --instance $FORGEJO_INSTANCE_URL --token $RUNNER_TOKEN + + env: + - name: RUNNER_TOKEN + valueFrom: + secretKeyRef: + name: forgejo-runner-token + key: token + - name: FORGEJO_INSTANCE_URL + value: https://${SECRET_NEW_DOMAIN} + + volumeMounts: + - name: runner-data + mountPath: /data + + containers: + - name: runner + image: code.forgejo.org/forgejo/runner:3.3.0 + command: + - sh + - -c + - while ! nc -z localhost 2376