From 0a024e3942ab3fdb74a49b6472ea025fea3ad27b Mon Sep 17 00:00:00 2001 From: "petr.nepochatykh" Date: Thu, 14 Apr 2022 20:28:33 +0300 Subject: [PATCH] init new template for exists secrets --- charts/redisoperator/templates/deployment.yaml | 10 +++++++--- charts/redisoperator/templates/private-registry.yaml | 2 +- charts/redisoperator/values.yaml | 7 +++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/charts/redisoperator/templates/deployment.yaml b/charts/redisoperator/templates/deployment.yaml index dc0b1d8eb..927cc4556 100644 --- a/charts/redisoperator/templates/deployment.yaml +++ b/charts/redisoperator/templates/deployment.yaml @@ -28,9 +28,14 @@ spec: {{- include "chart.selectorLabels" $data | nindent 8 }} spec: serviceAccountName: {{ template "chart.serviceAccountName" . }} - {{- if .Values.imageCredentials.create }} - imagePullSecrets: + {{- if (and .Values.imageCredentials.create (not .Values.imageCredentials.existsSecrets)) }} + imagePullSecrets: - name: {{ $fullName }}-{{ $name }} + {{- else if (and .Values.imageCredentials.create .Values.imageCredentials.existsSecrets) }} + {{- range .Values.imageCredentials.existsSecrets }} + imagePullSecrets: + {{ printf "- name: %s" . }} + {{- end }} {{- end }} containers: - name: {{ .Chart.Name }} @@ -70,4 +75,3 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - diff --git a/charts/redisoperator/templates/private-registry.yaml b/charts/redisoperator/templates/private-registry.yaml index eb054de0a..e267c99eb 100644 --- a/charts/redisoperator/templates/private-registry.yaml +++ b/charts/redisoperator/templates/private-registry.yaml @@ -1,4 +1,4 @@ -{{- if .Values.imageCredentials.create -}} +{{- if (and .Values.imageCredentials.create (not .Values.imageCredentials.existsSecrets)) -}} {{- $fullName := include "chart.fullname" . -}} {{- $name := "registry" -}} {{- $data := dict "name" $name "Chart" .Chart "Release" .Release "Values" .Values -}} diff --git a/charts/redisoperator/values.yaml b/charts/redisoperator/values.yaml index 885513778..9d6d70459 100644 --- a/charts/redisoperator/values.yaml +++ b/charts/redisoperator/values.yaml @@ -14,10 +14,13 @@ imageCredentials: username: someone password: somepassword email: someone@example.com + # Use exists secrets in namespace + existsSecrets: + - registrysecret -updateStrategy: +updateStrategy: type: RollingUpdate - + # A name in place of the chart name for `app:` labels. nameOverride: ""