Properly document options
Move runner config to its own top-level value element.
This commit is contained in:
parent
9202d5ef4d
commit
a83c2ac3b0
6 changed files with 92 additions and 84 deletions
74
README.md
74
README.md
|
@ -47,11 +47,10 @@
|
|||
- [Signing](#signing)
|
||||
- [Gitea](#gitea)
|
||||
- [`app.ini` overrides](#appini-overrides)
|
||||
- [Actions Runner](#actions-runner)
|
||||
- [Registration Secret](#registration-secret)
|
||||
- [LivenessProbe](#livenessprobe)
|
||||
- [ReadinessProbe](#readinessprobe)
|
||||
- [StartupProbe](#startupprobe)
|
||||
- [Forgejo Runner](#forgejo-runner)
|
||||
- [redis-cluster](#redis-cluster)
|
||||
- [redis](#redis)
|
||||
- [PostgreSQL HA](#postgresql-ha)
|
||||
|
@ -1016,6 +1015,7 @@ To comply with the Forgejo helm chart definition of the digest parameter, a "cus
|
|||
| `gitea.admin.passwordMode` | Mode for how to set/update the admin user password. Options are: initialOnlyNoReset, initialOnlyRequireReset, and keepUpdated | `keepUpdated` |
|
||||
| `gitea.metrics.enabled` | Enable Forgejo metrics | `false` |
|
||||
| `gitea.metrics.serviceMonitor.enabled` | Enable Forgejo metrics service monitor | `false` |
|
||||
| `gitea.actions.enabled` | enable actions and runners | `true` |
|
||||
| `gitea.ldap` | LDAP configuration | `[]` |
|
||||
| `gitea.oauth` | OAuth configuration | `[]` |
|
||||
| `gitea.additionalConfigSources` | Additional configuration from secret or configmap | `[]` |
|
||||
|
@ -1079,47 +1079,6 @@ blocks, while the keys themselves remain in all caps.
|
|||
| `gitea.config.actions` | Configuration for [Forgejo Actions](https://forgejo.org/docs/latest/user/actions/) | `{}` |
|
||||
| `gitea.config.other` | Uncategorized configuration options | `{}` |
|
||||
|
||||
### Actions Runner
|
||||
|
||||
The chart can deploy an [Actions Runner](https://forgejo.org/docs/latest/admin/actions/#forgejo-runner).
|
||||
|
||||
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` |
|
||||
| `gitea.actions.runner.image.repository` | Image to start for this pod | `forgejo/runner` |
|
||||
| `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 |
|
||||
|
||||
#### Registration Secret
|
||||
|
||||
The Runner needs to register itself with Forgejo. The chart will use the
|
||||
secret named by `gitea.actions.runner.registrationSecretName`, key
|
||||
`runner-registration-secret` to both add a runner with that secret to
|
||||
Forgejo at the application level, as well as register the runner when it
|
||||
starts up. If `registrationSecretName` is not set, the chart will create
|
||||
a secret for you. An existing secret will be reused.
|
||||
|
||||
### LivenessProbe
|
||||
|
||||
| Name | Description | Value |
|
||||
|
@ -1156,6 +1115,35 @@ a secret for you. An existing secret will be reused.
|
|||
| `gitea.startupProbe.successThreshold` | Success threshold for startup probe | `1` |
|
||||
| `gitea.startupProbe.failureThreshold` | Failure threshold for startup probe | `10` |
|
||||
|
||||
### Forgejo Runner
|
||||
|
||||
The chart can deploy an [Actions Runner](https://forgejo.org/docs/latest/admin/actions/#forgejo-runner).
|
||||
|
||||
The **Runner Configuration** `forgejo_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
|
||||
forgejo_runner:
|
||||
__config:
|
||||
____runner:
|
||||
______labels:
|
||||
________- docker:docker://node:16-bullseye
|
||||
```
|
||||
|
||||
| Name | Description | Value |
|
||||
| --------------------------------------- | ------------------------------------------------------------------------------------------ | ------------------ |
|
||||
| `forgejo_runner.config` | contents of runner's config.yaml | `{}` |
|
||||
| `forgejo_runner.enabled` | Enable automatic deployment of a runner | `false` |
|
||||
| `forgejo_runner.image.registry` | Image registry, e.g. gcr.io,docker.io | `code.forgejo.org` |
|
||||
| `forgejo_runner.image.repository` | Image to start for this pod | `forgejo/runner` |
|
||||
| `forgejo_runner.image.tag` | Visit: [Image tag](https://code.forgejo.org/forgejo/-/packages/container/runner/versions). | `3.5.1` |
|
||||
| `forgejo_runner.image.pullPolicy` | Overrides the pull policy set globally for actions runners | `IfNotPresent` |
|
||||
| `forgejo_runner.registrationSecretName` | Name of secret containing the registration secret. If unset, the chart will create one | `nil` |
|
||||
| `forgejo_runner.replicas` | Number of replicas to automatically deploy | `1` |
|
||||
|
||||
### Redis® Cluster
|
||||
|
||||
Redis® Cluster is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster) if enabled in the values.
|
||||
|
|
|
@ -67,9 +67,9 @@ Create image name and tag used by the deployment.
|
|||
Create image name and tag used by the actions runner.
|
||||
*/}}
|
||||
{{- define "gitea.actions-image" -}}
|
||||
{{- $registry := .Values.gitea.actions.runner.image.registry | default (.Values.global.imageRegistry | default .Values.image.registry) -}}
|
||||
{{- $name := .Values.gitea.actions.runner.image.repository -}}
|
||||
{{- $tag := .Values.gitea.actions.runner.image.tag -}}
|
||||
{{- $registry := .Values.forgejo_runner.image.registry | default (.Values.global.imageRegistry | default .Values.image.registry) -}}
|
||||
{{- $name := .Values.forgejo_runner.image.repository -}}
|
||||
{{- $tag := .Values.forgejo_runner.image.tag -}}
|
||||
{{- if $registry -}}
|
||||
{{- printf "%s/%s:%s" $registry $name $tag -}}
|
||||
{{- else -}}
|
||||
|
@ -125,19 +125,19 @@ app.kubernetes.io/instance: {{ .Release.Name }}
|
|||
{{/*
|
||||
Actions runner labels
|
||||
*/}}
|
||||
{{- define "gitea.actions.runner.labels" -}}
|
||||
{{- define "forgejo_runner.labels" -}}
|
||||
helm.sh/chart: {{ include "gitea.chart" . }}
|
||||
app: actions-runner
|
||||
{{ include "gitea.actions.runner.selectorLabels" . }}
|
||||
app.kubernetes.io/version: {{ .Values.gitea.actions.runner.image.tag | quote }}
|
||||
version: {{ .Values.gitea.actions.runner.image.tag | quote }}
|
||||
{{ include "forgejo_runner.selectorLabels" . }}
|
||||
app.kubernetes.io/version: {{ .Values.forgejo_runner.image.tag | quote }}
|
||||
version: {{ .Values.forgejo_runner.image.tag | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Actions runner selector labels
|
||||
*/}}
|
||||
{{- define "gitea.actions.runner.selectorLabels" -}}
|
||||
{{- define "forgejo_runner.selectorLabels" -}}
|
||||
app.kubernetes.io/name: actions-runner
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
{{- if .Values.gitea.actions.runner.enabled -}}
|
||||
{{- if .Values.forgejo_runner.enabled -}}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "gitea.fullname" . }}-runner
|
||||
data:
|
||||
config.yaml: |
|
||||
{{ toYaml .Values.gitea.actions.runner.config | indent 4 }}
|
||||
{{ toYaml .Values.forgejo_runner.config | indent 4 }}
|
||||
{{- end }}
|
|
@ -9,7 +9,7 @@ while the rest is the actual secret. It is possible to update the
|
|||
secret of an existing runner by running the command again on the
|
||||
Forgejo machine, with the last 24 characters updated.
|
||||
*/}}
|
||||
{{- if and (.Values.gitea.actions.runner.enabled) (not .Values.gitea.actions.runner.registrationSecretName) -}}
|
||||
{{- if and (.Values.forgejo_runner.enabled) (not .Values.forgejo_runner.registrationSecretName) -}}
|
||||
{{- $secretName := printf "%s-%s" (include "gitea.fullname" .) "runner-registration" -}}
|
||||
{{- $secret := lookup "v1" "Secret" .Release.Namespace $secretName -}}
|
||||
{{- if not $secret }}
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
{{- if .Values.gitea.actions.runner.enabled -}}
|
||||
{{- if .Values.forgejo_runner.enabled -}}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "gitea.fullname" . }}-runner
|
||||
labels:
|
||||
{{- include "gitea.actions.runner.labels" . | nindent 4 }}
|
||||
{{- include "forgejo_runner.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.gitea.actions.runner.replicas }}
|
||||
replicas: {{ .Values.forgejo_runner.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "gitea.actions.runner.selectorLabels" . | nindent 6 }}
|
||||
{{- include "forgejo_runner.selectorLabels" . | nindent 6 }}
|
||||
serviceName: {{ include "gitea.fullname" . }}-runner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "gitea.actions.runner.labels" . | nindent 8 }}
|
||||
{{- include "forgejo_runner.labels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: "{{ .Values.schedulerName }}"
|
||||
|
@ -28,7 +28,7 @@ spec:
|
|||
initContainers:
|
||||
- name: configure-runner
|
||||
image: "{{ include "gitea.actions-image" . }}"
|
||||
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.gitea.actions.runner.image.pullPolicy }}
|
||||
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.forgejo_runner.image.pullPolicy }}
|
||||
command: [ "forgejo-runner" ]
|
||||
args:
|
||||
- "create-runner-file"
|
||||
|
@ -45,7 +45,7 @@ spec:
|
|||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ include "gitea.actions-image" . }}"
|
||||
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.gitea.actions.runner.image.pullPolicy }}
|
||||
imagePullPolicy: {{ default .Values.image.pullPolicy .Values.forgejo_runner.image.pullPolicy }}
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://localhost:2376
|
||||
|
|
66
values.yaml
66
values.yaml
|
@ -355,29 +355,6 @@ gitea:
|
|||
email: 'gitea@local.domain'
|
||||
passwordMode: keepUpdated
|
||||
|
||||
## @param gitea.actions.runner.enabled Enable automatic deployment of a runner. You also need to set gitea.config.actions.enabled
|
||||
## @param gitea.actions.runner.image.registry Image registry, e.g. gcr.io,docker.io
|
||||
## @param gitea.actions.runner.image.repository Image to start for this pod
|
||||
## @param gitea.actions.runner.image.tag Visit: [Image tag](https://code.forgejo.org/forgejo/-/packages/container/runner/versions).
|
||||
## @param gitea.actions.runner.image.pullPolicy Overrides the pull policy set globally for actions runners
|
||||
## @param gitea.actions.runner.registrationSecretName Name of secret containing the registration secret. If unset, the chart will create one
|
||||
## @param gitea.actions.runner.replicas Number of replicas to automatically deploy
|
||||
## @param gitea.actions.runner.runnerLabels Forgejo Runner labels to assign to the runner
|
||||
actions:
|
||||
runner:
|
||||
enabled: false
|
||||
config:
|
||||
runner:
|
||||
labels:
|
||||
- docker:docker://node:16-bullseye
|
||||
image:
|
||||
registry: code.forgejo.org
|
||||
repository: forgejo/runner
|
||||
tag: 3.5.1
|
||||
pullPolicy: IfNotPresent
|
||||
registrationSecretName: ~
|
||||
replicas: 1
|
||||
|
||||
## @param gitea.metrics.enabled Enable Forgejo metrics
|
||||
## @param gitea.metrics.serviceMonitor.enabled Enable Forgejo metrics service monitor
|
||||
metrics:
|
||||
|
@ -387,6 +364,10 @@ gitea:
|
|||
# additionalLabels:
|
||||
# prometheus-release: prom1
|
||||
|
||||
## @param gitea.actions.enabled enable actions and runners
|
||||
actions:
|
||||
enabled: true
|
||||
|
||||
## @param gitea.ldap LDAP configuration
|
||||
ldap:
|
||||
[]
|
||||
|
@ -651,6 +632,45 @@ gitea:
|
|||
successThreshold: 1
|
||||
failureThreshold: 10
|
||||
|
||||
## @section Forgejo Runner
|
||||
## @descriptionStart The chart can deploy an [Actions Runner](https://forgejo.org/docs/latest/admin/actions/#forgejo-runner).
|
||||
##
|
||||
## The **Runner Configuration** `forgejo_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
|
||||
## forgejo_runner:
|
||||
## __config:
|
||||
## ____runner:
|
||||
## ______labels:
|
||||
## ________- docker:docker://node:16-bullseye
|
||||
## ```
|
||||
## @descriptionEnd
|
||||
## @param forgejo_runner.config [object] contents of runner's config.yaml
|
||||
## @param forgejo_runner.enabled Enable automatic deployment of a runner
|
||||
## @param forgejo_runner.image.registry Image registry, e.g. gcr.io,docker.io
|
||||
## @param forgejo_runner.image.repository Image to start for this pod
|
||||
## @param forgejo_runner.image.tag Visit: [Image tag](https://code.forgejo.org/forgejo/-/packages/container/runner/versions).
|
||||
## @param forgejo_runner.image.pullPolicy Overrides the pull policy set globally for actions runners
|
||||
## @param forgejo_runner.registrationSecretName Name of secret containing the registration secret. If unset, the chart will create one
|
||||
## @param forgejo_runner.replicas Number of replicas to automatically deploy
|
||||
forgejo_runner:
|
||||
enabled: false
|
||||
config:
|
||||
runner:
|
||||
labels:
|
||||
- docker:docker://node:16-bullseye
|
||||
image:
|
||||
registry: code.forgejo.org
|
||||
repository: forgejo/runner
|
||||
tag: 3.5.1
|
||||
pullPolicy: IfNotPresent
|
||||
registrationSecretName: ~
|
||||
replicas: 1
|
||||
|
||||
## @section Redis® Cluster
|
||||
## @descriptionStart
|
||||
## Redis® Cluster is loaded as a dependency from [Bitnami](https://github.com/bitnami/charts/tree/master/bitnami/redis-cluster) if enabled in the values.
|
||||
|
|
Loading…
Reference in a new issue