From 6445458cd1591c9204eb7c50edb5e2858d516ebe Mon Sep 17 00:00:00 2001 From: WrenIX Date: Thu, 27 Feb 2025 10:54:34 +0100 Subject: [PATCH] fix(forgejo-runner): add global (and improve docs) --- forgejo-runner/Chart.yaml | 2 +- forgejo-runner/README.md | 14 ++++++++------ forgejo-runner/templates/deployment.yaml | 18 ++++++++++++------ forgejo-runner/values.yaml | 19 ++++++++++++------- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/forgejo-runner/Chart.yaml b/forgejo-runner/Chart.yaml index 98804c8..a9ef0b5 100644 --- a/forgejo-runner/Chart.yaml +++ b/forgejo-runner/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: forgejo-runner description: Deploy runner for an forgejo instance (default codeberg.org) type: application -version: "0.4.16" +version: "0.4.17" # renovate: image=code.forgejo.org/forgejo/runner appVersion: "6.2.2" maintainers: diff --git a/forgejo-runner/README.md b/forgejo-runner/README.md index 617c7b3..814fc8e 100644 --- a/forgejo-runner/README.md +++ b/forgejo-runner/README.md @@ -7,7 +7,7 @@ description: "Deploy runner for an forgejo instance (default codeberg.org)" # forgejo-runner -![Version: 0.4.16](https://img.shields.io/badge/Version-0.4.16-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.2.2](https://img.shields.io/badge/AppVersion-6.2.2-informational?style=flat-square) +![Version: 0.4.17](https://img.shields.io/badge/Version-0.4.17-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.2.2](https://img.shields.io/badge/AppVersion-6.2.2-informational?style=flat-square) Deploy runner for an forgejo instance (default codeberg.org) @@ -80,8 +80,8 @@ helm uninstall forgejo-runner-release | Key | Type | Default | Description | |-----|------|---------|-------------| -| dind.image.pullPolicy | string | `"IfNotPresent"` | pull policy | -| dind.image.registry | string | `"docker.io"` | image registry | +| dind.image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) | +| dind.image.registry | string | `"docker.io"` | image registry (could be overwritten by global.image.registry) | | dind.image.repository | string | `"library/docker"` | image repository | | dind.image.tag | string | `"28.0.0-dind"` | image tag | | dind.resources | object | `{}` | We usually recommend not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, uncomment the following lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi | @@ -128,8 +128,10 @@ helm uninstall forgejo-runner-release | autoscaling.targetCPUUtilizationPercentage | int | `80` | | | extraEnvVars | list | `[]` | Additional environment variables to be set on runner container Example: extraEnvVars: - name: FOO value: "bar" | | fullnameOverride | string | `""` | | -| image.pullPolicy | string | `"IfNotPresent"` | pull policy | -| image.registry | string | `"code.forgejo.org"` | image registry | +| global.image.pullPolicy | string | `nil` | if set it will overwrite all pullPolicy | +| global.image.registry | string | `nil` | if set it will overwrite all registry entries | +| image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) | +| image.registry | string | `"code.forgejo.org"` | image registry (could be overwritten by global.image.registry) | | image.repository | string | `"forgejo/runner"` | image repository | | image.tag | string | `""` | image tag - Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | | @@ -142,7 +144,7 @@ helm uninstall forgejo-runner-release | podAnnotations | object | `{}` | | | podLabels | object | `{}` | | | podSecurityContext | object | `{}` | | -| replicaCount | int | `1` | | +| replicaCount | int | `1` | replicas | | resources | object | `{}` | We usually recommend not to specify default resources and to leave this as a conscious choice for the user. This also increases chances charts run on environments with little resources, such as Minikube. If you do want to specify resources, uncomment the following lines, adjust them as necessary, and remove the curly braces after 'resources:'. limits: cpu: 100m memory: 128Mi requests: cpu: 100m memory: 128Mi | | runner.config.create | bool | `true` | | | runner.config.existingSecret | string | `""` | use existingSecret instatt | diff --git a/forgejo-runner/templates/deployment.yaml b/forgejo-runner/templates/deployment.yaml index ae9b659..d3ce28d 100644 --- a/forgejo-runner/templates/deployment.yaml +++ b/forgejo-runner/templates/deployment.yaml @@ -32,8 +32,10 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} initContainers: - name: make-config-writeable - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.image }} + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} + {{- end }} command: [ "/bin/cp", "/etc/runner/.runner", "/data/.runner" ] resources: {{- toYaml .Values.resources | nindent 12 }} @@ -46,8 +48,10 @@ spec: - name: runner securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.image }} + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} + {{- end }} command: - "sh" - "-c" @@ -79,8 +83,10 @@ spec: - name: dind securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.dind.image.registry }}/{{ .Values.dind.image.repository }}:{{ .Values.dind.image.tag }}" - imagePullPolicy: {{ .Values.dind.image.pullPolicy }} + {{- with .Values.dind.image }} + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} + {{- end }} resources: {{- with .Values.dind.resources }} {{- toYaml . | nindent 12 }} diff --git a/forgejo-runner/values.yaml b/forgejo-runner/values.yaml index ef4a8ba..85c3365 100644 --- a/forgejo-runner/values.yaml +++ b/forgejo-runner/values.yaml @@ -1,15 +1,20 @@ -# Default values for forgejo-runner. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +global: + image: + # -- if set it will overwrite all registry entries + registry: + # -- if set it will overwrite all pullPolicy + pullPolicy: + +# -- replicas replicaCount: 1 image: - # -- image registry + # -- image registry (could be overwritten by global.image.registry) registry: code.forgejo.org # -- image repository repository: forgejo/runner - # -- pull policy + # -- This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) pullPolicy: IfNotPresent # -- image tag - Overrides the image tag whose default is the chart appVersion. tag: "" @@ -144,13 +149,13 @@ runner: workdir_parent: dind: image: - # -- image registry + # -- image registry (could be overwritten by global.image.registry) # @section -- Docker in Docker registry: docker.io # -- image repository # @section -- Docker in Docker repository: library/docker - # -- pull policy + # -- This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) # @section -- Docker in Docker pullPolicy: IfNotPresent # -- image tag