# Secret data. # Alternatively, create this with # kubectl create secret generic runner-secret --from-literal=token=your_offline_token_here apiVersion: v1 stringData: token: your_offline_secret_here kind: Secret metadata: name: runner-secret --- apiVersion: apps/v1 kind: Deployment metadata: labels: app: forgejo-runner name: forgejo-runner spec: # Two replicas means that if one is busy, the other can pick up jobs. replicas: 2 selector: matchLabels: app: forgejo-runner strategy: {} template: metadata: creationTimestamp: null labels: app: forgejo-runner spec: restartPolicy: Always volumes: - name: docker-certs emptyDir: {} - name: runner-data emptyDir: {} # Initialise our configuration file using offline registration # https://forgejo.org/docs/v1.21/admin/actions/#offline-registration initContainers: - name: runner-config-generation image: code.forgejo.org/forgejo/runner:3.0.0 command: [ "forgejo-runner create-runner-file --instance $FORGEJO_INSTANCE_URL --secret $RUNNER_SECRET --connect" ] env: - name: RUNNER_SECRET valueFrom: secretKeyRef: name: runner-secret key: token - name: FORGEJO_INSTANCE_URL value: http://gitea-http.gitea.svc.cluster.local:3000 volumeMounts: - name: runner-data mountPath: /data containers: - name: runner image: code.forgejo.org/forgejo/runner:3.0.0 command: ["sh", "-c", "while ! nc -z localhost 2376