diff --git a/apps/base/forgejo/kustomization.yaml b/apps/base/forgejo/kustomization.yaml index 5f575b3..f46508d 100644 --- a/apps/base/forgejo/kustomization.yaml +++ b/apps/base/forgejo/kustomization.yaml @@ -7,3 +7,5 @@ resources: - cluster.yaml - deployment.yaml - service.yaml + - runner-configmap.yaml + - runner-deployment.yaml diff --git a/apps/base/forgejo/runner-configmap.yaml b/apps/base/forgejo/runner-configmap.yaml new file mode 100644 index 0000000..e442487 --- /dev/null +++ b/apps/base/forgejo/runner-configmap.yaml @@ -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: + - "**" diff --git a/apps/base/forgejo/runner-deployment.yaml b/apps/base/forgejo/runner-deployment.yaml new file mode 100644 index 0000000..1514f0c --- /dev/null +++ b/apps/base/forgejo/runner-deployment.yaml @@ -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