diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index 0705ed0a72..d60f2e0f5a 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: postgresql -version: 3.11.7 +version: 3.12.0 appVersion: 10.7.0 description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. keywords: diff --git a/stable/postgresql/README.md b/stable/postgresql/README.md index 2c70c44e3c..041440b13b 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -48,6 +48,7 @@ The following tables lists the configurable parameters of the PostgreSQL chart a | Parameter | Description | Default | | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | | `global.imageRegistry` | Global Docker Image registry | `nil` | +| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `image.registry` | PostgreSQL Image registry | `docker.io` | | `image.repository` | PostgreSQL Image name | `bitnami/postgresql` | | `image.tag` | PostgreSQL Image tag | `{VERSION}` | diff --git a/stable/postgresql/templates/_helpers.tpl b/stable/postgresql/templates/_helpers.tpl index 96fd32ccfe..7de7dffa46 100644 --- a/stable/postgresql/templates/_helpers.tpl +++ b/stable/postgresql/templates/_helpers.tpl @@ -157,3 +157,38 @@ Get the initialization scripts Secret name. {{- define "postgresql.initdbScriptsSecret" -}} {{- printf "%s" .Values.initdbScriptsSecret -}} {{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "postgresql.imagePullSecrets" -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. +Also, we can not use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} +{{- if .Values.global.imagePullSecrets }} +imagePullSecrets: +{{- range .Values.global.imagePullSecrets }} + - name: {{ . }} +{{- end }} +{{- else if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- range .Values.metrics.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- else if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- range .Values.metrics.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- end -}} diff --git a/stable/postgresql/templates/statefulset-slaves.yaml b/stable/postgresql/templates/statefulset-slaves.yaml index 3b36486653..dd3331f54f 100644 --- a/stable/postgresql/templates/statefulset-slaves.yaml +++ b/stable/postgresql/templates/statefulset-slaves.yaml @@ -33,12 +33,7 @@ spec: {{ toYaml . | indent 8 }} {{- end }} spec: - {{- if .Values.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.image.pullSecrets }} - - name: {{ . }} - {{- end}} - {{- end }} +{{- include "postgresql.imagePullSecrets" . | indent 6 }} {{- if .Values.slave.nodeSelector }} nodeSelector: {{ toYaml .Values.slave.nodeSelector | indent 8 }} diff --git a/stable/postgresql/templates/statefulset.yaml b/stable/postgresql/templates/statefulset.yaml index 2adc1f0844..f9040ec1de 100644 --- a/stable/postgresql/templates/statefulset.yaml +++ b/stable/postgresql/templates/statefulset.yaml @@ -34,15 +34,7 @@ spec: {{ toYaml . | indent 8 }} {{- end }} spec: - {{- if or .Values.image.pullSecrets .Values.metrics.image.pullSecrets }} - imagePullSecrets: - {{- range .Values.image.pullSecrets }} - - name: {{ . }} - {{- end}} - {{- range .Values.metrics.image.pullSecrets }} - - name: {{ . }} - {{- end}} - {{- end }} +{{- include "postgresql.imagePullSecrets" . | indent 6 }} {{- if .Values.master.nodeSelector }} nodeSelector: {{ toYaml .Values.master.nodeSelector | indent 8 }} diff --git a/stable/postgresql/values.yaml b/stable/postgresql/values.yaml index 352c906406..cb3fb5c04b 100644 --- a/stable/postgresql/values.yaml +++ b/stable/postgresql/values.yaml @@ -1,8 +1,11 @@ -## Global Docker image registry -### Please, note that this will override the image registry for all the images, including dependencies, configured to use the global value +## Global Docker image parameters +### Please, note that this will override the image parameters, including dependencies, configured to use the global value +## Current available global Docker image parameters: imageRegistry and imagePullSecrets ### ## global: -## imageRegistry: +## imageRegistry: myRegistryName +# imagePullSecrets: +# - myRegistryKeySecretName ## Bitnami PostgreSQL image version ## ref: https://hub.docker.com/r/bitnami/postgresql/tags/ @@ -22,7 +25,7 @@ image: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistryKeySecretName ## Set to true if you would like to see extra information on logs ## It turns BASH and NAMI debugging in minideb @@ -289,7 +292,7 @@ metrics: ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ## # pullSecrets: - # - myRegistrKeySecretName + # - myRegistryKeySecretName ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) ## Configure extra options for liveness and readiness probes