From c0abc5e152a096838043a77ff155b0c655124231 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Tue, 16 Jun 2026 00:47:04 +0530 Subject: [PATCH] feat(ci): add github self-hosted runners --- .../base/kustomization.yaml | 6 + .../base/namespace.yaml | 4 + apps/github-actions-runners/base/runners.yaml | 371 ++++++++++++++++++ clusters/production/kustomization.yaml | 1 + 4 files changed, 382 insertions(+) create mode 100644 apps/github-actions-runners/base/kustomization.yaml create mode 100644 apps/github-actions-runners/base/namespace.yaml create mode 100644 apps/github-actions-runners/base/runners.yaml diff --git a/apps/github-actions-runners/base/kustomization.yaml b/apps/github-actions-runners/base/kustomization.yaml new file mode 100644 index 0000000..3b6f311 --- /dev/null +++ b/apps/github-actions-runners/base/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: github-actions +resources: + - namespace.yaml + - runners.yaml diff --git a/apps/github-actions-runners/base/namespace.yaml b/apps/github-actions-runners/base/namespace.yaml new file mode 100644 index 0000000..e15f81e --- /dev/null +++ b/apps/github-actions-runners/base/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: github-actions diff --git a/apps/github-actions-runners/base/runners.yaml b/apps/github-actions-runners/base/runners.yaml new file mode 100644 index 0000000..847f529 --- /dev/null +++ b/apps/github-actions-runners/base/runners.yaml @@ -0,0 +1,371 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: github-runner-frontend + namespace: github-actions + labels: + app: github-runner-frontend +spec: + replicas: 1 + selector: + matchLabels: + app: github-runner-frontend + template: + metadata: + labels: + app: github-runner-frontend + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: DoesNotExist + - key: node-role.kubernetes.io/master + operator: DoesNotExist + containers: + - name: dind + image: docker:27-dind + args: + - --host=tcp://0.0.0.0:2375 + - --tls=false + securityContext: + privileged: true + env: + - name: DOCKER_TLS_CERTDIR + value: "" + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: dind-storage + mountPath: /var/lib/docker + - name: runner + image: docker.io/myoung34/github-runner:ubuntu-noble + env: + - name: ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: github-runner-secrets + key: ACCESS_TOKEN + - name: RUNNER_SCOPE + value: repo + - name: REPO_URL + value: https://github.com/Traceworks2023/nxtgauge-frontend-solid + - name: RUNNER_NAME_PREFIX + value: frontend + - name: RANDOM_RUNNER_SUFFIX + value: "true" + - name: LABELS + value: ubuntu-latest,docker-ready + - name: RUNNER_WORKDIR + value: /tmp/runner/_work + - name: RUN_AS_ROOT + value: "true" + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + - name: DISABLE_AUTO_UPDATE + value: "true" + - name: UNSET_CONFIG_VARS + value: "true" + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: runner-work + mountPath: /tmp/runner + volumes: + - name: dind-storage + emptyDir: {} + - name: runner-work + emptyDir: {} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: github-runner-admin + namespace: github-actions + labels: + app: github-runner-admin +spec: + replicas: 1 + selector: + matchLabels: + app: github-runner-admin + template: + metadata: + labels: + app: github-runner-admin + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: DoesNotExist + - key: node-role.kubernetes.io/master + operator: DoesNotExist + containers: + - name: dind + image: docker:27-dind + args: + - --host=tcp://0.0.0.0:2375 + - --tls=false + securityContext: + privileged: true + env: + - name: DOCKER_TLS_CERTDIR + value: "" + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: dind-storage + mountPath: /var/lib/docker + - name: runner + image: docker.io/myoung34/github-runner:ubuntu-noble + env: + - name: ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: github-runner-secrets + key: ACCESS_TOKEN + - name: RUNNER_SCOPE + value: repo + - name: REPO_URL + value: https://github.com/Traceworks2023/nxtgauge-admin-solid + - name: RUNNER_NAME_PREFIX + value: admin + - name: RANDOM_RUNNER_SUFFIX + value: "true" + - name: LABELS + value: ubuntu-latest,docker-ready + - name: RUNNER_WORKDIR + value: /tmp/runner/_work + - name: RUN_AS_ROOT + value: "true" + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + - name: DISABLE_AUTO_UPDATE + value: "true" + - name: UNSET_CONFIG_VARS + value: "true" + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: runner-work + mountPath: /tmp/runner + volumes: + - name: dind-storage + emptyDir: {} + - name: runner-work + emptyDir: {} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: github-runner-ai-assistant + namespace: github-actions + labels: + app: github-runner-ai-assistant +spec: + replicas: 1 + selector: + matchLabels: + app: github-runner-ai-assistant + template: + metadata: + labels: + app: github-runner-ai-assistant + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: DoesNotExist + - key: node-role.kubernetes.io/master + operator: DoesNotExist + containers: + - name: dind + image: docker:27-dind + args: + - --host=tcp://0.0.0.0:2375 + - --tls=false + securityContext: + privileged: true + env: + - name: DOCKER_TLS_CERTDIR + value: "" + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: dind-storage + mountPath: /var/lib/docker + - name: runner + image: docker.io/myoung34/github-runner:ubuntu-noble + env: + - name: ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: github-runner-secrets + key: ACCESS_TOKEN + - name: RUNNER_SCOPE + value: repo + - name: REPO_URL + value: https://github.com/Traceworks2023/nxtgauge-ai-assistant + - name: RUNNER_NAME_PREFIX + value: ai-assistant + - name: RANDOM_RUNNER_SUFFIX + value: "true" + - name: LABELS + value: ubuntu-latest,docker-ready + - name: RUNNER_WORKDIR + value: /tmp/runner/_work + - name: RUN_AS_ROOT + value: "true" + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + - name: DISABLE_AUTO_UPDATE + value: "true" + - name: UNSET_CONFIG_VARS + value: "true" + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: runner-work + mountPath: /tmp/runner + volumes: + - name: dind-storage + emptyDir: {} + - name: runner-work + emptyDir: {} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: github-runner-backend + namespace: github-actions + labels: + app: github-runner-backend +spec: + replicas: 3 + selector: + matchLabels: + app: github-runner-backend + template: + metadata: + labels: + app: github-runner-backend + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: DoesNotExist + - key: node-role.kubernetes.io/master + operator: DoesNotExist + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + app: github-runner-backend + topologyKey: kubernetes.io/hostname + containers: + - name: dind + image: docker:27-dind + args: + - --host=tcp://0.0.0.0:2375 + - --tls=false + securityContext: + privileged: true + env: + - name: DOCKER_TLS_CERTDIR + value: "" + resources: + requests: + cpu: 500m + memory: 1Gi + limits: + cpu: 2 + memory: 4Gi + volumeMounts: + - name: dind-storage + mountPath: /var/lib/docker + - name: runner + image: docker.io/myoung34/github-runner:ubuntu-noble + env: + - name: ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: github-runner-secrets + key: ACCESS_TOKEN + - name: RUNNER_SCOPE + value: repo + - name: REPO_URL + value: https://github.com/Traceworks2023/nxtgauge-backend-rust + - name: RUNNER_NAME_PREFIX + value: backend + - name: RANDOM_RUNNER_SUFFIX + value: "true" + - name: LABELS + value: ubuntu-latest,docker-ready + - name: RUNNER_WORKDIR + value: /tmp/runner/_work + - name: RUN_AS_ROOT + value: "true" + - name: DOCKER_HOST + value: tcp://127.0.0.1:2375 + - name: DISABLE_AUTO_UPDATE + value: "true" + - name: UNSET_CONFIG_VARS + value: "true" + resources: + requests: + cpu: 500m + memory: 1Gi + limits: + cpu: 4 + memory: 8Gi + volumeMounts: + - name: runner-work + mountPath: /tmp/runner + volumes: + - name: dind-storage + emptyDir: {} + - name: runner-work + emptyDir: {} diff --git a/clusters/production/kustomization.yaml b/clusters/production/kustomization.yaml index 44f8c02..abbdbfb 100644 --- a/clusters/production/kustomization.yaml +++ b/clusters/production/kustomization.yaml @@ -5,5 +5,6 @@ resources: - ../../apps/nxtgauge-frontend-solid/overlays/prod - ../../apps/nxtgauge-admin-solid/overlays/prod - ../../apps/nxtgauge-ai-assistant/overlays/prod + - ../../apps/github-actions-runners/base - ../../apps/ollama/base - ../../ops/openobserve-alerts