From 0db2d16d3f91c18e286dc19808aaaa6aefa3d84f Mon Sep 17 00:00:00 2001 From: bitnami-bot Date: Tue, 12 Feb 2019 18:36:30 +0000 Subject: [PATCH] Synchronize upstreamed folder to 725524490 --- upstreamed/postgresql/Chart.yaml | 2 +- upstreamed/postgresql/README.md | 3 ++- upstreamed/postgresql/templates/_helpers.tpl | 7 +++++++ upstreamed/postgresql/templates/statefulset.yaml | 11 ++++++++++- upstreamed/postgresql/values-production.yaml | 4 ++++ upstreamed/postgresql/values.yaml | 4 ++++ 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/upstreamed/postgresql/Chart.yaml b/upstreamed/postgresql/Chart.yaml index 7675f70b3..520261aef 100644 --- a/upstreamed/postgresql/Chart.yaml +++ b/upstreamed/postgresql/Chart.yaml @@ -1,5 +1,5 @@ name: postgresql -version: 3.10.2 +version: 3.11.0 appVersion: 10.6.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/upstreamed/postgresql/README.md b/upstreamed/postgresql/README.md index 3dd1ed021..e3a18cb03 100644 --- a/upstreamed/postgresql/README.md +++ b/upstreamed/postgresql/README.md @@ -81,6 +81,7 @@ The following tables lists the configurable parameters of the PostgreSQL chart a | `extendedConfConfigMap` | ConfigMap with the extended PostgreSQL configuration files | `nil` | | `initdbScripts` | List of initdb scripts | `nil` | | `initdbScriptsConfigMap` | ConfigMap with the initdb scripts (Note: Overrides `initdbScripts`) | `nil` | +| `initdbScriptsSecret` | Secret with initdb scripts that contain sensitive information (Note: can be used with `initdbScriptsConfigMap` or `initdbScripts`) | `nil` | | `service.type` | Kubernetes Service type | `ClusterIP` | | `service.port` | PostgreSQL port | `5432` | | `service.nodePort` | Kubernetes Service nodePort | `nil` | @@ -172,7 +173,7 @@ The [Bitnami PostgreSQL](https://github.com/bitnami/bitnami-docker-postgresql) i Alternatively, you can specify custom scripts using the `initdbScripts` parameter as dict. -In addition to these options, you can also set an external ConfigMap with all the initialization scripts. This is done by setting the `initdbScriptsConfigMap` parameter. Note that this will override the two previous options. +In addition to these options, you can also set an external ConfigMap with all the initialization scripts. This is done by setting the `initdbScriptsConfigMap` parameter. Note that this will override the two previous options. If your initialization scripts contain sensitive information such as credentials or passwords, you can use the `initdbScriptsSecret` parameter. The allowed extensions are `.sh`, `.sql` and `.sql.gz`. diff --git a/upstreamed/postgresql/templates/_helpers.tpl b/upstreamed/postgresql/templates/_helpers.tpl index d17977960..96fd32ccf 100644 --- a/upstreamed/postgresql/templates/_helpers.tpl +++ b/upstreamed/postgresql/templates/_helpers.tpl @@ -150,3 +150,10 @@ Get the initialization scripts ConfigMap name. {{- printf "%s-init-scripts" (include "postgresql.fullname" .) -}} {{- end -}} {{- end -}} + +{{/* +Get the initialization scripts Secret name. +*/}} +{{- define "postgresql.initdbScriptsSecret" -}} +{{- printf "%s" .Values.initdbScriptsSecret -}} +{{- end -}} diff --git a/upstreamed/postgresql/templates/statefulset.yaml b/upstreamed/postgresql/templates/statefulset.yaml index 1bd7d1e85..7309d1a21 100644 --- a/upstreamed/postgresql/templates/statefulset.yaml +++ b/upstreamed/postgresql/templates/statefulset.yaml @@ -185,7 +185,11 @@ spec: volumeMounts: {{- if or (.Files.Glob "files/docker-entrypoint-initdb.d/*.{sh,sql,sql.gz}") .Values.initdbScriptsConfigMap .Values.initdbScripts }} - name: custom-init-scripts - mountPath: /docker-entrypoint-initdb.d + mountPath: /docker-entrypoint-initdb.d/configmap + {{- end }} + {{- if .Values.initdbScriptsSecret }} + - name: custom-init-scripts-secret + mountPath: /docker-entrypoint-initdb.d/secret {{- end }} {{- if or (.Files.Glob "files/conf.d/*.conf") .Values.postgresqlExtendedConf .Values.extendedConfConfigMap }} - name: postgresql-extended-config @@ -277,6 +281,11 @@ spec: configMap: name: {{ template "postgresql.initdbScriptsCM" . }} {{- end }} + {{- if .Values.initdbScriptsSecret }} + - name: custom-init-scripts-secret + secret: + secretName: {{ template "postgresql.initdbScriptsSecret" . }} + {{- end }} {{- if and .Values.persistence.enabled .Values.persistence.existingClaim }} - name: data persistentVolumeClaim: diff --git a/upstreamed/postgresql/values-production.yaml b/upstreamed/postgresql/values-production.yaml index a05866060..6ae61617c 100644 --- a/upstreamed/postgresql/values-production.yaml +++ b/upstreamed/postgresql/values-production.yaml @@ -149,6 +149,10 @@ postgresqlDataDir: /bitnami/postgresql ## NOTE: This will override initdbScripts # initdbScriptsConfigMap: +## Secret with scripts to be run at first boot (in case it contains sensitive information) +## NOTE: This can work along initdbScripts or initdbScriptsConfigMap +# initdbScriptsSecret: + ## PostgreSQL service configuration service: ## PosgresSQL service type diff --git a/upstreamed/postgresql/values.yaml b/upstreamed/postgresql/values.yaml index d886a1fb3..cfe2714a1 100644 --- a/upstreamed/postgresql/values.yaml +++ b/upstreamed/postgresql/values.yaml @@ -150,6 +150,10 @@ postgresqlDataDir: /bitnami/postgresql ## NOTE: This will override initdbScripts # initdbScriptsConfigMap: +## Secret with scripts to be run at first boot (in case it contains sensitive information) +## NOTE: This can work along initdbScripts or initdbScriptsConfigMap +# initdbScriptsSecret: + ## Optional duration in seconds the pod needs to terminate gracefully. ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods ##