From 707787989e4a1f71741208099e469febcb60b8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= Date: Sat, 5 Oct 2024 06:24:19 -0700 Subject: [PATCH] Add registry secret authentication value to helm charts If the images are stored in a registry requiring authentication the pod needs to have imagePullSecrets defined. --- containers/proxy-helm/proxy-helm.changes.cbosdo.helm-fixes | 2 ++ containers/proxy-helm/templates/deployment.yaml | 4 ++++ containers/proxy-helm/values.yaml | 4 ++++ containers/server-helm/server-helm.changes.cbosdo.helm-fixes | 2 ++ containers/server-helm/templates/deployment.yaml | 4 ++++ containers/server-helm/values.yaml | 4 ++++ 6 files changed, 20 insertions(+) diff --git a/containers/proxy-helm/proxy-helm.changes.cbosdo.helm-fixes b/containers/proxy-helm/proxy-helm.changes.cbosdo.helm-fixes index 0c4f4ff26ba6..a8f88132d41d 100644 --- a/containers/proxy-helm/proxy-helm.changes.cbosdo.helm-fixes +++ b/containers/proxy-helm/proxy-helm.changes.cbosdo.helm-fixes @@ -1 +1,3 @@ +- Add registrySecret value to the helm chart for authentication + (bsc#1231157) - Fix labels indentation (bsc#1231150) diff --git a/containers/proxy-helm/templates/deployment.yaml b/containers/proxy-helm/templates/deployment.yaml index 70c89a233991..ab80ff2e587f 100644 --- a/containers/proxy-helm/templates/deployment.yaml +++ b/containers/proxy-helm/templates/deployment.yaml @@ -15,6 +15,10 @@ spec: labels: app: uyuni-proxy spec: +{{- if .Values.registrySecret }} + imagePullSecrets: + - name: {{ .Values.registrySecret }} +{{- end }} containers: - name: httpd image: {{- include "deployment.container.image" (dict "name" "proxy-httpd" "global" .) | indent 1}} diff --git a/containers/proxy-helm/values.yaml b/containers/proxy-helm/values.yaml index 0bb54e938205..58aff4faa958 100644 --- a/containers/proxy-helm/values.yaml +++ b/containers/proxy-helm/values.yaml @@ -17,6 +17,10 @@ images: ## pullPolicy: "Always" +## registrySecret defines the name of secret to use to pull the images from the +## registry with authentication. Leave empty for no authentication. +registrySecret: "" + ## ingress defines the ingress that is used in the cluster. ## It can be either "nginx", "traefik" or any other value. ingress: "traefik" diff --git a/containers/server-helm/server-helm.changes.cbosdo.helm-fixes b/containers/server-helm/server-helm.changes.cbosdo.helm-fixes index 0c4f4ff26ba6..a8f88132d41d 100644 --- a/containers/server-helm/server-helm.changes.cbosdo.helm-fixes +++ b/containers/server-helm/server-helm.changes.cbosdo.helm-fixes @@ -1 +1,3 @@ +- Add registrySecret value to the helm chart for authentication + (bsc#1231157) - Fix labels indentation (bsc#1231150) diff --git a/containers/server-helm/templates/deployment.yaml b/containers/server-helm/templates/deployment.yaml index 592ed499ef7c..d275083dfdf0 100644 --- a/containers/server-helm/templates/deployment.yaml +++ b/containers/server-helm/templates/deployment.yaml @@ -15,6 +15,10 @@ spec: labels: app: uyuni spec: +{{- if .Values.registrySecret }} + imagePullSecrets: + - name: {{ .Values.registrySecret }} +{{- end }} initContainers: {{- if not .Values.migration }} - name: init-etc-tls diff --git a/containers/server-helm/values.yaml b/containers/server-helm/values.yaml index f954b6ee9798..c55f6aab1455 100644 --- a/containers/server-helm/values.yaml +++ b/containers/server-helm/values.yaml @@ -13,6 +13,10 @@ images: ## pullPolicy: "IfNotPresent" +## registrySecret defines the name of secret to use to pull the images from the +## registry with authentication. Leave empty for no authentication. +registrySecret: "" + ## uyuni server overall Persistent Volume access modes ## Must match those of existing PV or dynamic provisioner ## Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/