From 1931630189a5b57e5114e407d5b5be4354c27af0 Mon Sep 17 00:00:00 2001 From: Quentin Bisson Date: Sat, 18 Nov 2023 20:15:26 +0100 Subject: [PATCH] Allow image registry override for all keda components (#557) --- keda/README.md | 4 ++++ keda/templates/manager/deployment.yaml | 5 +++++ keda/templates/metrics-server/deployment.yaml | 5 +++++ keda/templates/webhooks/deployment.yaml | 5 +++++ keda/values.yaml | 11 +++++++++++ 5 files changed, 30 insertions(+) diff --git a/keda/README.md b/keda/README.md index 2137d65c..82a4c8be 100644 --- a/keda/README.md +++ b/keda/README.md @@ -73,6 +73,7 @@ their default values. | `crds.install` | bool | `true` | Defines whether the KEDA CRDs have to be installed or not. | | `env` | list | `[]` | Additional environment variables that will be passed onto all KEDA components | | `extraObjects` | list | `[]` | Array of extra K8s manifests to deploy | +| `global.image.registry` | string | `nil` | Global image registry of KEDA components | | `grpcTLSCertsSecret` | string | `""` | Set this if you are using an external scaler and want to communicate over TLS (recommended). This variable holds the name of the secret that will be mounted to the /grpccerts path on the Pod | | `hashiCorpVaultTLS` | string | `""` | Set this if you are using HashiCorp Vault and want to communicate over TLS (recommended). This variable holds the name of the secret that will be mounted to the /vault path on the Pod | | `http.keepAlive.enabled` | bool | `true` | Enable HTTP connection keep alive | @@ -110,6 +111,7 @@ their default values. | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `extraArgs.keda` | object | `{}` | Additional KEDA Operator container arguments | +| `image.keda.registry` | string | `nil` | Image registry of KEDA operator | | `image.keda.repository` | string | `"ghcr.io/kedacore/keda"` | Image name of KEDA operator | | `image.keda.tag` | string | `""` | Image tag of KEDA operator. Optional, given app version of Helm chart is used by default | | `logging.operator.format` | string | `"console"` | Logging format for KEDA Operator. allowed values: `json` or `console` | @@ -138,6 +140,7 @@ their default values. | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | `extraArgs.metricsAdapter` | object | `{}` | Additional Metrics Adapter container arguments | +| `image.metricsApiServer.registry` | string | `nil` | Image registry of KEDA Metrics API Server | | `image.metricsApiServer.repository` | string | `"ghcr.io/kedacore/keda-metrics-apiserver"` | Image name of KEDA Metrics API Server | | `image.metricsApiServer.tag` | string | `""` | Image tag of KEDA Metrics API Server. Optional, given app version of Helm chart is used by default | | `logging.metricServer.level` | int | `0` | Logging level for Metrics Server. allowed values: `0` for info, `4` for debug, or an integer value greater than 0, specified as string | @@ -247,6 +250,7 @@ their default values. | Parameter | Type | Default | Description | |-----------|------|---------|-------------| +| `image.webhooks.registry` | string | `nil` | Image registry of KEDA admission-webhooks | | `image.webhooks.repository` | string | `"ghcr.io/kedacore/keda-admission-webhooks"` | Image name of KEDA admission-webhooks | | `image.webhooks.tag` | string | `""` | Image tag of KEDA admission-webhooks . Optional, given app version of Helm chart is used by default | | `logging.webhooks.format` | string | `"console"` | Logging format for KEDA Admission webhooks. allowed values: `json` or `console` | diff --git a/keda/templates/manager/deployment.yaml b/keda/templates/manager/deployment.yaml index 16207714..fbfd3040 100644 --- a/keda/templates/manager/deployment.yaml +++ b/keda/templates/manager/deployment.yaml @@ -71,7 +71,12 @@ spec: {{- else }} {{- toYaml .Values.securityContext | nindent 12 }} {{- end }} + {{- $registry := .Values.global.image.registry | default .Values.image.keda.registry | default "" }} + {{- if $registry }} + image: "{{ $registry }}/{{ .Values.image.keda.repository }}:{{ .Values.image.keda.tag | default .Chart.AppVersion }}" + {{- else }} image: "{{ .Values.image.keda.repository }}:{{ .Values.image.keda.tag | default .Chart.AppVersion }}" + {{- end }} command: - "/keda" args: diff --git a/keda/templates/metrics-server/deployment.yaml b/keda/templates/metrics-server/deployment.yaml index a3f7a425..d621e0b8 100644 --- a/keda/templates/metrics-server/deployment.yaml +++ b/keda/templates/metrics-server/deployment.yaml @@ -73,7 +73,12 @@ spec: {{- else }} {{- toYaml .Values.securityContext | nindent 12 }} {{- end }} + {{- $registry := .Values.global.image.registry | default .Values.image.metricsApiServer.registry | default "" }} + {{- if $registry }} + image: "{{ $registry }}/{{ .Values.image.metricsApiServer.repository }}:{{ .Values.image.metricsApiServer.tag | default .Chart.AppVersion }}" + {{- else }} image: "{{ .Values.image.metricsApiServer.repository }}:{{ .Values.image.metricsApiServer.tag | default .Chart.AppVersion }}" + {{- end }} imagePullPolicy: {{ .Values.image.pullPolicy }} livenessProbe: httpGet: diff --git a/keda/templates/webhooks/deployment.yaml b/keda/templates/webhooks/deployment.yaml index 856eb00d..314598bd 100644 --- a/keda/templates/webhooks/deployment.yaml +++ b/keda/templates/webhooks/deployment.yaml @@ -66,7 +66,12 @@ spec: {{- else }} {{- toYaml .Values.securityContext | nindent 12 }} {{- end }} + {{- $registry := .Values.global.image.registry | default .Values.image.webhooks.registry | default "" }} + {{- if $registry }} + image: "{{ $registry }}/{{ .Values.image.webhooks.repository }}:{{ .Values.image.webhooks.tag | default .Chart.AppVersion }}" + {{- else }} image: "{{ .Values.image.webhooks.repository }}:{{ .Values.image.webhooks.tag | default .Chart.AppVersion }}" + {{- end }} command: - /keda-admission-webhooks args: diff --git a/keda/values.yaml b/keda/values.yaml index e6441150..ea8486ef 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -2,18 +2,29 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +global: + image: + # -- Global image registry of KEDA components + registry: null + image: keda: + # -- Image registry of KEDA operator + registry: null # -- Image name of KEDA operator repository: ghcr.io/kedacore/keda # -- Image tag of KEDA operator. Optional, given app version of Helm chart is used by default tag: "" metricsApiServer: + # -- Image registry of KEDA Metrics API Server + registry: null # -- Image name of KEDA Metrics API Server repository: ghcr.io/kedacore/keda-metrics-apiserver # -- Image tag of KEDA Metrics API Server. Optional, given app version of Helm chart is used by default tag: "" webhooks: + # -- Image registry of KEDA admission-webhooks + registry: null # -- Image name of KEDA admission-webhooks repository: ghcr.io/kedacore/keda-admission-webhooks # -- Image tag of KEDA admission-webhooks . Optional, given app version of Helm chart is used by default