From 936b9b5231556c85a6f2a964943afb6ac6c5fba1 Mon Sep 17 00:00:00 2001 From: Jeroen Nijssen <24685173+jeroen-nijssen@users.noreply.github.com> Date: Thu, 18 Jul 2024 13:12:00 +0200 Subject: [PATCH 1/2] Adding Image Pull Secrets For images stored within a private registry, often the a secret (way of authentication) is needed. to supply this authentication way the `imagepullsecret` has been added. --- deploy/k8s/chart/templates/deployment.yaml | 6 ++++++ deploy/k8s/chart/values.yaml | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/deploy/k8s/chart/templates/deployment.yaml b/deploy/k8s/chart/templates/deployment.yaml index 9dd390c..a05db37 100644 --- a/deploy/k8s/chart/templates/deployment.yaml +++ b/deploy/k8s/chart/templates/deployment.yaml @@ -24,6 +24,12 @@ spec: {{- end }} labels: {{- include "cortex-tenant.selectorLabels" . | nindent 8 }} + {{- if .Values.image.pullSecrets }} + imagePullSecrets: + {{- range .Values.image.pullSecrets }} + - name: {{ . }} + {{- end }} + {{- end }} spec: containers: - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/deploy/k8s/chart/values.yaml b/deploy/k8s/chart/values.yaml index b06e2ba..3341f00 100644 --- a/deploy/k8s/chart/values.yaml +++ b/deploy/k8s/chart/values.yaml @@ -10,6 +10,11 @@ image: pullPolicy: IfNotPresent # -- Overrides the image tag (default is `.Chart.appVersion`) tag: "" + # -- Optionally specify an array of imagePullSecrets + # Secrets must be manually created in the namespace. + # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + # pullSecrets: + # - myRegistryKeySecretName service: # -- The type of service From 5a25d48031161efda077a4867c7ec5c1a42bce4d Mon Sep 17 00:00:00 2001 From: Jeroen Nijssen <24685173+jeroen-nijssen@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:24:00 +0200 Subject: [PATCH 2/2] [Corrected] indentation/location image pull secrets --- deploy/k8s/chart/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/k8s/chart/templates/deployment.yaml b/deploy/k8s/chart/templates/deployment.yaml index a05db37..a5a34c3 100644 --- a/deploy/k8s/chart/templates/deployment.yaml +++ b/deploy/k8s/chart/templates/deployment.yaml @@ -24,13 +24,13 @@ spec: {{- end }} labels: {{- include "cortex-tenant.selectorLabels" . | nindent 8 }} + spec: {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }} - name: {{ . }} {{- end }} {{- end }} - spec: containers: - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }}