Add Support for imagePullSecrets (#140)

Fixes #125

### Motivation

The default images in the values.yaml are in docker hub. This PR allows us to provide image pull secrets for the containers which will allow us to get around Docker Hub's rate limiting if the nodes are not logged into Docker Hub.

### Modifications

Added a new template to generate `imagePullSecrets`, and included them in the deployments and statefulsets. This will only add them if they are specified under `images.imagePullSecrets`

### Verifying this change

- [] Make sure that the change passes the CI checks.
This commit is contained in:
Thomas O'Neill 2021-08-20 20:22:50 -04:00 committed by GitHub
parent c3e4ea272b
commit 19d6ce6488
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 0 deletions

View File

@ -84,3 +84,15 @@ Create the match labels.
app: {{ template "pulsar.name" . }}
release: {{ .Release.Name }}
{{- end }}
{{/*
Create ImagePullSecrets
*/}}
{{- define "pulsar.imagePullSecrets" -}}
{{- if .Values.images.imagePullSecrets -}}
imagePullSecrets:
{{- range .Values.images.imagePullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end }}

View File

@ -150,5 +150,6 @@ spec:
{{- include "pulsar.autorecovery.certs.volumeMounts" . | nindent 8 }}
volumes:
{{- include "pulsar.autorecovery.certs.volumes" . | nindent 6 }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}

View File

@ -196,6 +196,7 @@ spec:
emptyDir: {}
{{- end }}
{{- include "pulsar.bookkeeper.certs.volumes" . | nindent 6 }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- if and (and .Values.persistence .Values.volumes.persistence) .Values.bookkeeper.volumes.persistence}}
volumeClaimTemplates:
{{- if .Values.bookkeeper.volumes.useSingleCommonVolume }}

View File

@ -268,4 +268,5 @@ spec:
{{- end}}
{{- end}}
{{- include "pulsar.broker.certs.volumes" . | nindent 6 }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}

View File

@ -87,4 +87,5 @@ spec:
secretKeyRef:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}-secret"
key: GRAFANA_ADMIN_PASSWORD
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}

View File

@ -93,4 +93,5 @@ spec:
persistentVolumeClaim:
claimName: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
{{- end }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}

View File

@ -222,6 +222,7 @@ spec:
readOnly: true
{{- end}}
{{- end}}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- if or .Values.auth.authentication.enabled (and .Values.tls.enabled .Values.tls.proxy.enabled) }}
volumes:
{{- if .Values.auth.authentication.enabled }}

View File

@ -89,6 +89,7 @@ spec:
{{- else }}
name: "{{ template "pulsar.fullname" . }}-{{ .Values.pulsar_manager.component }}-secret"
{{- end }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
volumes:
- name: pulsar-manager-data
emptyDir: {}

View File

@ -115,4 +115,5 @@ spec:
path: ca.crt
{{- end}}
{{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}