2024-06-14 01:46:08 +00:00
|
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.29.4/statefulset.json
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: StatefulSet
|
|
|
|
metadata:
|
|
|
|
name: forgejo-runner
|
|
|
|
namespace: dev
|
|
|
|
spec:
|
|
|
|
serviceName: forgejo-runner
|
|
|
|
replicas: 5
|
|
|
|
revisionHistoryLimit: 0
|
|
|
|
|
|
|
|
volumeClaimTemplates:
|
|
|
|
- metadata:
|
|
|
|
name: runner-work
|
|
|
|
spec:
|
|
|
|
storageClassName: openebs-hostpath
|
|
|
|
accessModes:
|
|
|
|
- ReadWriteOnce
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
storage: 5Gi
|
|
|
|
|
|
|
|
persistentVolumeClaimRetentionPolicy:
|
|
|
|
whenScaled: Delete
|
|
|
|
whenDeleted: Delete
|
|
|
|
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: forgejo-runner
|
|
|
|
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: forgejo-runner
|
|
|
|
|
|
|
|
spec:
|
|
|
|
serviceAccountName: forgejo-runner
|
|
|
|
|
|
|
|
containers:
|
|
|
|
- name: runner
|
|
|
|
image: ghcr.io/christopherhx/gitea-actions-runner:v0.0.12
|
|
|
|
imagePullPolicy: Always
|
|
|
|
|
|
|
|
env:
|
|
|
|
- name: ACTIONS_RUNNER_POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: ACTIONS_RUNNER_CLAIM_NAME
|
|
|
|
value: runner-work-$(ACTIONS_RUNNER_POD_NAME)
|
|
|
|
- name: ACTIONS_RUNNER_REQUIRE_JOB_CONTAINER
|
|
|
|
value: "true"
|
|
|
|
- name: ACTIONS_RUNNER_CONTAINER_HOOKS
|
|
|
|
value: /home/runner/k8s/index.js
|
|
|
|
- name: GITEA_INSTANCE_URL
|
2024-06-15 19:33:26 +00:00
|
|
|
value: https://git.${SECRET_NEW_DOMAIN}
|
2024-06-14 01:46:08 +00:00
|
|
|
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
name: forgejo-runner-token
|
|
|
|
key: token
|
|
|
|
- name: GITEA_RUNNER_LABELS
|
2024-06-15 19:39:19 +00:00
|
|
|
value: docker,cluster
|
2024-06-14 01:46:08 +00:00
|
|
|
- name: GITEA_RUNNER_NAME
|
2024-06-15 19:39:19 +00:00
|
|
|
value: cluster-$(ACTIONS_RUNNER_POD_NAME)
|
2024-06-14 01:46:08 +00:00
|
|
|
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /home/runner/_work
|
|
|
|
name: runner-work
|
|
|
|
|
|
|
|
resources:
|
|
|
|
requests:
|
|
|
|
cpu: "10m"
|
|
|
|
memory: "500Mi"
|
|
|
|
limits:
|
|
|
|
cpu: "1"
|
|
|
|
memory: "1Gi"
|