k3s-cluster/cluster/apps/dev/forgejo-runner/runner.yaml

77 lines
No EOL
2.1 KiB
YAML

# 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: mainpool-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
value: https://git.${SECRET_NEW_DOMAIN}
- name: GITEA_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: forgejo-runner-token
key: token
- name: GITEA_RUNNER_LABELS
value: docker,cluster
- name: GITEA_RUNNER_NAME
value: cluster-$(ACTIONS_RUNNER_POD_NAME)
volumeMounts:
- mountPath: /home/runner/_work
name: runner-work
resources:
requests:
cpu: "10m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"