Use a config map to configure the runner
This commit is contained in:
parent
c5075858c7
commit
137d0242e4
4 changed files with 37 additions and 4 deletions
17
README.md
17
README.md
|
@ -1090,8 +1090,24 @@ The chart can deploy an [Actions Runner](https://forgejo.org/docs/latest/admin/a
|
|||
|
||||
The available runner tags are listed here: <https://code.forgejo.org/forgejo/-/packages/container/runner/versions>
|
||||
|
||||
The **Runner Configuration** `gitea.actions.runner.config` is simply the contents of the
|
||||
[runner config file](https://forgejo.codeberg.page/docs/v1.20/admin/actions/#configuration).
|
||||
Make sure to specify at least one label so that workflows can find the runner.
|
||||
|
||||
Default runner config:
|
||||
|
||||
```yaml
|
||||
gitea:
|
||||
actions:
|
||||
config:
|
||||
runner:
|
||||
labels:
|
||||
- docker:docker://node:16-bullseye
|
||||
```
|
||||
|
||||
| Name | Description | Value |
|
||||
|-----------------------------------------------|------------------------------------------------------------|--------------------|
|
||||
| `gitea.actions.runner.config` | Runner configuration map. | |
|
||||
| `gitea.actions.runner.enabled` | Enable automatic deployment of a runner. | `false` |
|
||||
| `gitea.actions.runner.image.pullPolicy` | Overrides the pull policy set globally for actions runners | |
|
||||
| `gitea.actions.runner.image.registry` | Image registry, e.g. gcr.io,docker.io | `code.forgejo.org` |
|
||||
|
@ -1099,7 +1115,6 @@ The available runner tags are listed here: <https://code.forgejo.org/forgejo/-/p
|
|||
| `gitea.actions.runner.image.tag` | Tag to deploy | |
|
||||
| `gitea.actions.runner.registrationSecretName` | Name of secret containing the registration secret | ~ |
|
||||
| `gitea.actions.runner.replicas` | Number of replicas to automatically deploy | 1 |
|
||||
| `gitea.actions.runner.runnerLabels` | Forgejo Runner labels to assign to the runner | `["docker"]` |
|
||||
|
||||
#### Registration Secret
|
||||
|
||||
|
|
9
templates/gitea/runner-config.yaml
Normal file
9
templates/gitea/runner-config.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{- if .Values.gitea.actions.runner.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "gitea.fullname" . }}-runner
|
||||
data:
|
||||
config.yaml: |
|
||||
{{ toYaml .Values.gitea.actions.runner.config | indent 4 }}
|
||||
{{- end }}
|
|
@ -37,8 +37,6 @@ spec:
|
|||
- "/runner-secret/runner-registration-secret"
|
||||
- "--instance"
|
||||
- "http://{{ .Release.Name }}-http:{{ .Values.service.http.port }}"
|
||||
- "--labels"
|
||||
- "{{ join "," .Values.gitea.actions.runner.runnerLabels }}"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
|
@ -60,9 +58,14 @@ spec:
|
|||
command: [ "forgejo-runner" ]
|
||||
args:
|
||||
- daemon
|
||||
- "--config"
|
||||
- /config.yaml
|
||||
volumeMounts:
|
||||
- name: certs
|
||||
mountPath: /certs
|
||||
- name: config
|
||||
mountPath: /config.yaml
|
||||
subPath: config.yaml
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: temp
|
||||
|
@ -82,6 +85,9 @@ spec:
|
|||
volumes:
|
||||
- name: certs
|
||||
emptyDir: {}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "gitea.fullname" . }}-runner
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
- name: temp
|
||||
|
|
|
@ -366,6 +366,10 @@ gitea:
|
|||
actions:
|
||||
runner:
|
||||
enabled: false
|
||||
config:
|
||||
runner:
|
||||
labels:
|
||||
- docker:docker://node:16-bullseye
|
||||
image:
|
||||
registry: "code.forgejo.org"
|
||||
repository: forgejo/runner
|
||||
|
@ -373,7 +377,6 @@ gitea:
|
|||
pullPolicy: IfNotPresent
|
||||
registrationSecretName: ~
|
||||
replicas: 1
|
||||
runnerLabels: ["docker"]
|
||||
|
||||
## @param gitea.metrics.enabled Enable Forgejo metrics
|
||||
## @param gitea.metrics.serviceMonitor.enabled Enable Forgejo metrics service monitor
|
||||
|
|
Loading…
Reference in a new issue