Run Forgejo Actions runner as a cluster Deployment on rpi.
Reuses the existing pi-runner registration and host Docker socket. Compose runner is stopped so it cannot double-poll.
This commit is contained in:
parent
20f967ffa3
commit
5e1a2b4f8d
3 changed files with 116 additions and 0 deletions
|
|
@ -7,3 +7,5 @@ resources:
|
|||
- cluster.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- runner-configmap.yaml
|
||||
- runner-deployment.yaml
|
||||
|
|
|
|||
22
apps/base/forgejo/runner-configmap.yaml
Normal file
22
apps/base/forgejo/runner-configmap.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: forgejo-runner-config
|
||||
namespace: forgejo
|
||||
data:
|
||||
config.toml: |
|
||||
log:
|
||||
level: info
|
||||
runner:
|
||||
file: /config/runner.ini
|
||||
capacity: 2
|
||||
timeout: 1h
|
||||
cache: /opt/siriusdevops/runner/cache
|
||||
cache:
|
||||
enabled: true
|
||||
dir: /opt/siriusdevops/runner/cache
|
||||
container:
|
||||
privileged: true
|
||||
options: -v /usr/local/bin/docker-static:/usr/bin/docker:ro -v /opt/siriusdevops/runner/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock
|
||||
valid_volumes:
|
||||
- "**"
|
||||
92
apps/base/forgejo/runner-deployment.yaml
Normal file
92
apps/base/forgejo/runner-deployment.yaml
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: forgejo-runner
|
||||
namespace: forgejo
|
||||
labels:
|
||||
app: forgejo-runner
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: forgejo-runner
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: forgejo-runner
|
||||
spec:
|
||||
nodeSelector:
|
||||
kubernetes.io/hostname: rpi
|
||||
tolerations:
|
||||
- key: dedicated
|
||||
operator: Equal
|
||||
value: network
|
||||
effect: PreferNoSchedule
|
||||
containers:
|
||||
- name: runner
|
||||
image: code.forgejo.org/forgejo/runner:5.0.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- forgejo-runner
|
||||
- --config
|
||||
- /config/config.toml
|
||||
- daemon
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: unix:///var/run/docker.sock
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: docker-sock
|
||||
mountPath: /var/run/docker.sock
|
||||
- name: docker-static
|
||||
mountPath: /usr/bin/docker
|
||||
readOnly: true
|
||||
- name: cli-plugins
|
||||
mountPath: /usr/local/lib/docker/cli-plugins
|
||||
readOnly: true
|
||||
- name: config-toml
|
||||
mountPath: /config/config.toml
|
||||
subPath: config.toml
|
||||
- name: runner-ini
|
||||
mountPath: /config/runner.ini
|
||||
- name: cache
|
||||
mountPath: /opt/siriusdevops/runner/cache
|
||||
- name: siriusdevops
|
||||
mountPath: /opt/siriusdevops
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
memory: 512Mi
|
||||
volumes:
|
||||
- name: docker-sock
|
||||
hostPath:
|
||||
path: /var/run/docker.sock
|
||||
type: Socket
|
||||
- name: docker-static
|
||||
hostPath:
|
||||
path: /usr/local/bin/docker-static
|
||||
type: File
|
||||
- name: cli-plugins
|
||||
hostPath:
|
||||
path: /opt/siriusdevops/runner/cli-plugins
|
||||
type: DirectoryOrCreate
|
||||
- name: config-toml
|
||||
configMap:
|
||||
name: forgejo-runner-config
|
||||
- name: runner-ini
|
||||
hostPath:
|
||||
path: /opt/siriusdevops/runner/config/runner.ini
|
||||
type: File
|
||||
- name: cache
|
||||
hostPath:
|
||||
path: /opt/siriusdevops/runner/cache
|
||||
type: DirectoryOrCreate
|
||||
- name: siriusdevops
|
||||
hostPath:
|
||||
path: /opt/siriusdevops
|
||||
type: Directory
|
||||
Loading…
Reference in a new issue