From 01aefb54fb8d287862a044541eed4b38db2c3c64 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Thu, 12 Mar 2026 20:33:43 +0000 Subject: [PATCH] runners added --- README.md | 3 - mist_infra/arc/forgejo/deploy.sh | 31 +++++++ mist_infra/arc/forgejo/deployment.yaml | 87 +++++++++++++++++++ mist_infra/arc/forgejo/values.yaml | 34 ++++++++ .../arc/{ => github}/controller-values.yaml | 0 mist_infra/arc/{ => github}/update_arc.sh | 0 mist_infra/arc/{ => github}/values.yaml | 2 +- 7 files changed, 153 insertions(+), 4 deletions(-) create mode 100755 mist_infra/arc/forgejo/deploy.sh create mode 100644 mist_infra/arc/forgejo/deployment.yaml create mode 100644 mist_infra/arc/forgejo/values.yaml rename mist_infra/arc/{ => github}/controller-values.yaml (100%) rename mist_infra/arc/{ => github}/update_arc.sh (100%) rename mist_infra/arc/{ => github}/values.yaml (82%) diff --git a/README.md b/README.md index 7a3c330..926665a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -## Move hyperland set up to my own git - - ## Set up runners ## set up docker image registry diff --git a/mist_infra/arc/forgejo/deploy.sh b/mist_infra/arc/forgejo/deploy.sh new file mode 100755 index 0000000..a0ee926 --- /dev/null +++ b/mist_infra/arc/forgejo/deploy.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +# ========================================================== +# Deploy Forgejo act_runner to Kubernetes +# ========================================================== + +NAMESPACE="forgejo-runners" +SCRIPT_DIR="$(dirname "$0")" + +echo "=== Deploying Forgejo Runner ===" + +# Prompt for token if not set in deployment.yaml +TOKEN="RPAjk4Jdc42By5vSxnULPPPrjU0goPLQIiKgwOIo" +echo + +kubectl create namespace "$NAMESPACE" --dry-run=client -o yaml | kubectl apply -f - + +kubectl create secret generic forgejo-runner-secret \ + --namespace "$NAMESPACE" \ + --from-literal=token="$TOKEN" \ + --dry-run=client -o yaml | kubectl apply -f - + +kubectl apply -f "$SCRIPT_DIR/deployment.yaml" + +echo +echo "✅ Forgejo runner deployed" +echo +echo "Next steps:" +echo "- kubectl get pods -n $NAMESPACE" +echo "- Check runner appears at: https://git.juntekim.com/-/admin/runners" diff --git a/mist_infra/arc/forgejo/deployment.yaml b/mist_infra/arc/forgejo/deployment.yaml new file mode 100644 index 0000000..6e3a80e --- /dev/null +++ b/mist_infra/arc/forgejo/deployment.yaml @@ -0,0 +1,87 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: forgejo-runners +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: forgejo-runner-data + namespace: forgejo-runners +spec: + accessModes: + - ReadWriteOnce + storageClassName: rook-ceph-block + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: Secret +metadata: + name: forgejo-runner-secret + namespace: forgejo-runners +type: Opaque +stringData: + token: "RPAjk4Jdc42By5vSxnULPPPrjU0goPLQIiKgwOIo" +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: forgejo-runner + namespace: forgejo-runners +spec: + replicas: 1 + selector: + matchLabels: + app: forgejo-runner + template: + metadata: + labels: + app: forgejo-runner + spec: + initContainers: + - name: register + image: gitea/act_runner:latest + command: + - sh + - -c + - | + if [ ! -f /data/.runner ]; then + act_runner register --no-interactive \ + --instance https://git.juntekim.com \ + --token "RPAjk4Jdc42By5vSxnULPPPrjU0goPLQIiKgwOIo" \ + --name mist-runner \ + --labels "self-hosted,linux,x64" + else + echo "Runner already registered, skipping." + fi + workingDir: /data + volumeMounts: + - name: runner-data + mountPath: /data + containers: + - name: runner + image: gitea/act_runner:latest + command: ["act_runner", "daemon"] + workingDir: /data + env: + - name: DOCKER_HOST + value: tcp://localhost:2375 + volumeMounts: + - name: runner-data + mountPath: /data + - name: dind + image: docker:dind + securityContext: + privileged: true + env: + - name: DOCKER_TLS_CERTDIR + value: "" + volumeMounts: + - name: runner-data + mountPath: /data + volumes: + - name: runner-data + persistentVolumeClaim: + claimName: forgejo-runner-data diff --git a/mist_infra/arc/forgejo/values.yaml b/mist_infra/arc/forgejo/values.yaml new file mode 100644 index 0000000..9f1bbf2 --- /dev/null +++ b/mist_infra/arc/forgejo/values.yaml @@ -0,0 +1,34 @@ +instanceURL: https://git.juntekim.com + +# Registration token from Forgejo: +# Site Admin → Actions → Runners → Create new runner +# Store as a k8s secret and reference here, or set directly for bootstrapping +registrationToken: "RPAjk4Jdc42By5vSxnULPPPrjU0goPLQIiKgwOIo" # TODO: fill in or use existingSecret + +# Uncomment to use an existing k8s secret instead: +# existingSecret: forgejo-runner-secret +# existingSecretKey: token + +runnerName: mist-runner + +runnerLabels: + - self-hosted + - linux + - x64 + +replicaCount: 1 + +# Enable DinD if you need to build Docker images in CI +dind: + enabled: true + privileged: true + +resources: + requests: + cpu: 100m + memory: 256Mi + limits: + cpu: 1000m + memory: 1Gi + +namespace: forgejo-runners \ No newline at end of file diff --git a/mist_infra/arc/controller-values.yaml b/mist_infra/arc/github/controller-values.yaml similarity index 100% rename from mist_infra/arc/controller-values.yaml rename to mist_infra/arc/github/controller-values.yaml diff --git a/mist_infra/arc/update_arc.sh b/mist_infra/arc/github/update_arc.sh similarity index 100% rename from mist_infra/arc/update_arc.sh rename to mist_infra/arc/github/update_arc.sh diff --git a/mist_infra/arc/values.yaml b/mist_infra/arc/github/values.yaml similarity index 82% rename from mist_infra/arc/values.yaml rename to mist_infra/arc/github/values.yaml index bd4b331..1539177 100644 --- a/mist_infra/arc/values.yaml +++ b/mist_infra/arc/github/values.yaml @@ -1,7 +1,7 @@ githubConfigUrl: https://github.com/MealCraft githubConfigSecret: - github_token: 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 + github_token: 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 # mealcraft-github-runner-token runnerScaleSetName: mealcraft-runners