From 90b6eb209e932adf42ee038cfe42eb50dd7e2320 Mon Sep 17 00:00:00 2001 From: Tom Billiet Date: Fri, 5 May 2023 14:41:25 +0200 Subject: [PATCH 1/5] Issue 551 allow helm imagePullSecrets on post-install hook Signed-off-by: Tom Billiet --- .../templates/post-install-upgrade-hooks.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml b/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml index bbbe41b86..ac2188bff 100644 --- a/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml +++ b/charts/zookeeper-operator/templates/post-install-upgrade-hooks.yaml @@ -44,6 +44,12 @@ roleRef: apiVersion: v1 kind: ServiceAccount +{{- if or .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets }} +imagePullSecrets: +{{- range (default .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets) }} + - name: {{ . }} +{{- end }} +{{- end }} metadata: name: {{ template "zookeeper-operator.fullname" . }}-post-install-upgrade namespace: {{ .Release.Namespace }} From 8098328c761cb4c454ec69860257e66f206037ec Mon Sep 17 00:00:00 2001 From: Tom Billiet Date: Mon, 15 May 2023 15:37:18 +0200 Subject: [PATCH 2/5] Also support pull credentials for zookeeper post-install-upgrade-hook Signed-off-by: Tom Billiet --- charts/zookeeper/templates/post-install-upgrade-hooks.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/zookeeper/templates/post-install-upgrade-hooks.yaml b/charts/zookeeper/templates/post-install-upgrade-hooks.yaml index dfb5f1bb4..08cd01839 100644 --- a/charts/zookeeper/templates/post-install-upgrade-hooks.yaml +++ b/charts/zookeeper/templates/post-install-upgrade-hooks.yaml @@ -38,6 +38,12 @@ roleRef: apiVersion: v1 kind: ServiceAccount +{{- if or .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets }} +imagePullSecrets: +{{- range (default .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets) }} + - name: {{ . }} +{{- end }} +{{- end }} metadata: name: {{ template "zookeeper.fullname" . }}-post-install-upgrade namespace: {{ .Release.Namespace }} From ea48b8c3cef78323bc497d18c49abb9d1a424e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Salazar?= Date: Tue, 23 May 2023 11:10:52 +0200 Subject: [PATCH 3/5] fixed templating nil pointer error Signed-off-by: Tom Billiet --- charts/zookeeper/templates/post-install-upgrade-hooks.yaml | 4 ++-- charts/zookeeper/values.yaml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/charts/zookeeper/templates/post-install-upgrade-hooks.yaml b/charts/zookeeper/templates/post-install-upgrade-hooks.yaml index 08cd01839..d36a2ce4c 100644 --- a/charts/zookeeper/templates/post-install-upgrade-hooks.yaml +++ b/charts/zookeeper/templates/post-install-upgrade-hooks.yaml @@ -38,9 +38,9 @@ roleRef: apiVersion: v1 kind: ServiceAccount -{{- if or .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets }} +{{- if .Values.global.imagePullSecrets }} imagePullSecrets: -{{- range (default .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets) }} +{{- range .Values.global.imagePullSecrets }} - name: {{ . }} {{- end }} {{- end }} diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index 8a449f0b9..68ae476ad 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -8,6 +8,11 @@ image: triggerRollingRestart: false +global: + # Lists the secrets you need to use to pull zookeeper image from a private registry. + imagePullSecrets: [] + # - private-registry-key + domainName: labels: {} ports: [] From fbb7e87e3ec585a951b27efd5ab285cb4acab8d7 Mon Sep 17 00:00:00 2001 From: Tom Billiet Date: Thu, 14 Dec 2023 13:20:45 +0100 Subject: [PATCH 4/5] Cleanup Signed-off-by: Tom Billiet --- .../templates/post-install-upgrade-hooks.yaml | 4 ++-- charts/zookeeper/values.yaml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/zookeeper/templates/post-install-upgrade-hooks.yaml b/charts/zookeeper/templates/post-install-upgrade-hooks.yaml index d36a2ce4c..08cd01839 100644 --- a/charts/zookeeper/templates/post-install-upgrade-hooks.yaml +++ b/charts/zookeeper/templates/post-install-upgrade-hooks.yaml @@ -38,9 +38,9 @@ roleRef: apiVersion: v1 kind: ServiceAccount -{{- if .Values.global.imagePullSecrets }} +{{- if or .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets }} imagePullSecrets: -{{- range .Values.global.imagePullSecrets }} +{{- range (default .Values.global.imagePullSecrets .Values.serviceAccount.imagePullSecrets) }} - name: {{ . }} {{- end }} {{- end }} diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index 68ae476ad..cadcad77b 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -1,6 +1,11 @@ replicas: 3 maxUnavailableReplicas: +global: + # Lists the secrets you need to use to pull zookeeper image from a private registry. + imagePullSecrets: [] + # - private-registry-key + image: repository: pravega/zookeeper tag: 0.2.15 @@ -8,11 +13,6 @@ image: triggerRollingRestart: false -global: - # Lists the secrets you need to use to pull zookeeper image from a private registry. - imagePullSecrets: [] - # - private-registry-key - domainName: labels: {} ports: [] From de6d0035e9a875eb29df34d9ee259c0dd8591d82 Mon Sep 17 00:00:00 2001 From: Tom Billiet Date: Tue, 19 Dec 2023 16:25:18 +0100 Subject: [PATCH 5/5] Also use global pullsecrets in zookeeper object Signed-off-by: Tom Billiet --- charts/zookeeper/templates/zookeeper.yaml | 6 ++++-- charts/zookeeper/values.yaml | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/charts/zookeeper/templates/zookeeper.yaml b/charts/zookeeper/templates/zookeeper.yaml index 902440e61..5c378ce5e 100644 --- a/charts/zookeeper/templates/zookeeper.yaml +++ b/charts/zookeeper/templates/zookeeper.yaml @@ -105,9 +105,11 @@ spec: terminationGracePeriodSeconds: {{ .Values.pod.terminationGracePeriodSeconds }} {{- end }} serviceAccountName: {{ default "zookeeper" .Values.pod.serviceAccountName }} - {{- if .Values.pod.imagePullSecrets }} + {{- if or .Values.global.imagePullSecrets .Values.pod.imagePullSecrets }} imagePullSecrets: -{{ toYaml .Values.pod.imagePullSecrets | indent 6 }} + {{- range (default .Values.global.imagePullSecrets .Values.pod.imagePullSecrets) }} + - name: {{ . }} + {{- end }} {{- end }} {{- if .Values.clientService }} clientService: diff --git a/charts/zookeeper/values.yaml b/charts/zookeeper/values.yaml index cadcad77b..3487ecf4f 100644 --- a/charts/zookeeper/values.yaml +++ b/charts/zookeeper/values.yaml @@ -15,6 +15,11 @@ triggerRollingRestart: false domainName: labels: {} + +serviceAccount: {} + ## Optionally specify an array of imagePullSecrets. Will override the global parameter if set + # imagePullSecrets: + ports: [] # - containerPort: 2181 # name: client