diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 8b9dce5..dcf6bb5 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -43,6 +43,9 @@ spec: priorityClassName: {{ .Values.deployment.priorityClassName }} restartPolicy: "Always" serviceAccountName: {{ template "dockermailserver.serviceAccountName" . }} + {{- with .Values.image.pullSecrets }} + imagePullSecrets: {{- toYaml . | nindent 8 }} + {{- end }} securityContext: {{ toYaml (coalesce .Values.deployment.securityContext .Values.securityContext) | indent 8 }} {{- if .Values.deployment.tolerations }} diff --git a/charts/docker-mailserver/tests/deployment_test.yaml b/charts/docker-mailserver/tests/deployment_test.yaml index 44195da..ee3fabd 100644 --- a/charts/docker-mailserver/tests/deployment_test.yaml +++ b/charts/docker-mailserver/tests/deployment_test.yaml @@ -33,4 +33,18 @@ tests: - it: manifest should match snapshot asserts: - - matchSnapshot: { } \ No newline at end of file + - matchSnapshot: { } + - it: renders no imagePullSecrets by default + asserts: + - notExists: + path: spec.template.spec.imagePullSecrets + + - it: passes image.pullSecrets to the pod + set: + image.pullSecrets: + - name: registry-credentials + asserts: + - equal: + path: spec.template.spec.imagePullSecrets + value: + - name: registry-credentials diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index fe80f32..a0bf553 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -8,6 +8,11 @@ image: ## If image.tag is not defined it will default to `.Chart.appVersion` # tag: "latest" pullPolicy: "IfNotPresent" + ## image.pullSecrets lists Secrets of type kubernetes.io/dockerconfigjson for pulling from a private registry. + ## They apply to every container of the pod, including the metrics exporter. + # pullSecrets: + # - name: registry-credentials + pullSecrets: [] # Specify whether to create a serviceAccount for the pod. The name is generated from the # dockermailserver.serviceAccountName template