cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

deploy.yaml (3310B)


      1 apiVersion: apps/v1
      2 kind: Deployment
      3 metadata:
      4   labels:
      5     app: forgejo-runner
      6   name: forgejo-runner
      7   namespace: codeberg
      8 spec:
      9   replicas: 1
     10   selector:
     11     matchLabels:
     12       app: forgejo-runner
     13   strategy: {}
     14   template:
     15     metadata:
     16       labels:
     17         app: forgejo-runner
     18     spec:
     19       securityContext:
     20         fsGroup: 1000
     21       restartPolicy: Always
     22       initContainers:
     23         - name: init
     24           image: code.forgejo.org/forgejo/runner:9
     25           command: ["sh", "-c", "if ! [ -f /data/.runner ]; then forgejo-runner register --no-interactive --token ${RUNNER_REGISTRATION_TOKEN} --labels ${LABELS} --name ${RUNNER_NAME} --instance ${INSTANCE_URL};
     26               fi"]
     27           env:
     28             - name: INSTANCE_URL
     29               value: https://codeberg.org
     30             - name: RUNNER_NAME
     31               value: forgejo-runner
     32             - name: LABELS
     33               value: ubuntu-latest,ubuntu-22.04,docker
     34             - name: RUNNER_REGISTRATION_TOKEN
     35               valueFrom:
     36                 secretKeyRef:
     37                   name: codeberg-runner
     38                   key: forgejoInstanceToken
     39           volumeMounts:
     40             - name: docker-certs
     41               mountPath: /certs
     42             - name: runner-data
     43               mountPath: /data
     44             - name: runner-config
     45               mountPath: /config
     46           resources:
     47             limits:
     48               cpu: "1"
     49               memory: "1024Mi"
     50             requests:
     51               cpu: "50m"
     52               memory: "32Mi"
     53       containers:
     54         - name: runner
     55           image: code.forgejo.org/forgejo/runner:9
     56           command: ["sh", "-c", "while ! [ -f /certs/client/ca.pem ]; do echo 'waiting for docker certs...'; sleep 2; done; forgejo-runner daemon --config /config/config.yaml"]
     57           env:
     58             - name: DOCKER_HOST
     59               value: tcp://localhost:2376
     60             - name: DOCKER_CERT_PATH
     61               value: /certs/client
     62             - name: DOCKER_TLS_VERIFY
     63               value: "1"
     64           volumeMounts:
     65             - name: docker-certs
     66               mountPath: /certs
     67             - name: runner-data
     68               mountPath: /data
     69             - name: runner-config
     70               mountPath: /config
     71           resources:
     72             limits:
     73               cpu: "1"
     74               memory: "1024Mi"
     75             requests:
     76               cpu: "50m"
     77               memory: "32Mi"
     78         - name: daemon
     79           image: docker:27.5.1-dind
     80           env:
     81             - name: DOCKER_TLS_CERTDIR
     82               value: /certs
     83           securityContext:
     84             privileged: true
     85           volumeMounts:
     86             - name: docker-certs
     87               mountPath: /certs
     88             - name: docker-data
     89               mountPath: /var/lib/docker
     90           resources:
     91             limits:
     92               cpu: "2"
     93               memory: "4096Mi"
     94             requests:
     95               cpu: "50m"
     96               memory: "32Mi"
     97       volumes:
     98         - name: docker-certs
     99           emptyDir: {}
    100         - name: runner-data
    101           persistentVolumeClaim:
    102             claimName: forgejo-runner-vol
    103         - name: docker-data
    104           emptyDir: {}
    105         - name: runner-config
    106           configMap:
    107             name: runner-config
    108             items:
    109               - key: config.yaml
    110                 path: config.yaml