Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 551: allow helm imagePullSecrets on post-install hook #554

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/zookeeper/templates/post-install-upgrade-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 4 additions & 2 deletions charts/zookeeper/templates/zookeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Comment on lines -110 to +112
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would constitute a breaking change. Do we have grounds for it?
The schema for .Values.pod.imagePullSecrets seems to require an array of key-value pairs, while proposed schema for .Values.global.imagePullSecrets seems to an array of strings.

{{- end }}
{{- if .Values.clientService }}
clientService:
Expand Down
10 changes: 10 additions & 0 deletions charts/zookeeper/values.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,6 +15,11 @@ triggerRollingRestart: false

domainName:
labels: {}

Copy link
Contributor

@anishakj anishakj Jan 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below code block is not required looks like, service account is mentioned at line no:56

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referring zookeeper/values.yaml not the zookeeper-operator

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 56 here has pod.imagePullSecrets (used on ZookeeperCluster resource).
The proposed addition would specify serviceAccount.imagePullSecrets (to be used on the hooks).
@TomBillietKlarrio Why don't we move this to hooks.serviceAccount.imagePullSecrets to make it clear that the particular set of pull secrets would be pertinent to the hook image docker registry?

serviceAccount: {}
## Optionally specify an array of imagePullSecrets. Will override the global parameter if set
# imagePullSecrets:

ports: []
# - containerPort: 2181
# name: client
Expand Down
Loading