[bitnami/discourse] Make POSTGRESQL_CLIENT_* env vars optional for externalDatabase (#6650)

* Make POSTGRESQL_CLIENT_ env vars optional

* kxesd-discourse-optional-pg-client-values

- Update README.md
- Add default value for externalDatabase.create to values.yaml
- Update logic in deployment.yaml & configmaps.yaml templates
- Bump chart version in Chart.yaml
This commit is contained in:
Elliot Dobson
2021-06-14 21:34:50 +12:00
committed by GitHub
parent 2354722a88
commit 770989beaf
5 changed files with 14 additions and 5 deletions

View File

@@ -35,4 +35,4 @@ sources:
- https://github.com/bitnami/bitnami-docker-discourse
- https://github.com/spinnaker
- https://www.discourse.org/
version: 4.1.1
version: 4.1.2

View File

@@ -219,6 +219,7 @@ The following table lists the configurable parameters of the Discourse chart and
| `externalDatabase.port` | Database port number (when using an external db) | `5432` |
| `externalDatabase.user` | PostgreSQL username (when using an external db) | `bn_discourse` |
| `externalDatabase.password` | Password for the above username (when using an external db) | `""` |
| `externalDatabase.create` | Enable PostgreSQL user & database creation (when using an external db) | `true` |
| `externalDatabase.postgresqlPostgresUser` | PostgreSQL admin user, used during the installation stage (when using an external db) | `""` |
| `externalDatabase.postgresqlPostgresPassword` | Password for PostgreSQL admin user (when using an external db) | `""` |
| `externalDatabase.existingSecret` | Name of an existing Kubernetes secret. The secret must have the following keys configured: `postgresql-postgres-password`, `postgresql-password` | `nil` |

View File

@@ -22,6 +22,7 @@ data:
DISCOURSE_DATABASE_PORT_NUMBER: {{ template "discourse.databasePort" . }}
DISCOURSE_DATABASE_NAME: {{ template "discourse.databaseName" . }}
DISCOURSE_DATABASE_USER: {{ template "discourse.databaseUser" . }}
{{- if or .Values.postgresql.enabled .Values.externalDatabase.create }}
POSTGRESQL_CLIENT_DATABASE_HOST: {{ template "discourse.databaseHost" . }}
POSTGRESQL_CLIENT_DATABASE_PORT_NUMBER: {{ template "discourse.databasePort" . }}
{{- if or .Values.postgresql.enabled (not .Values.externalDatabase.postgresqlPostgresUser) }}
@@ -33,3 +34,4 @@ data:
{{- end }}
POSTGRESQL_CLIENT_CREATE_DATABASE_NAME: {{ template "discourse.databaseName" . }}
POSTGRESQL_CLIENT_CREATE_DATABASE_EXTENSIONS: "hstore,pg_trgm"
{{- end }}

View File

@@ -102,11 +102,13 @@ spec:
secretKeyRef:
name: {{ include "discourse.postgresql.secretName" . }}
key: postgresql-password
{{- if or .Values.postgresql.enabled .Values.externalDatabase.create }}
- name: POSTGRESQL_CLIENT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "discourse.postgresql.secretName" . }}
key: postgresql-postgres-password
{{- end }}
{{- if (include "discourse.redis.auth.enabled" .) }}
- name: DISCOURSE_REDIS_PASSWORD
valueFrom:

View File

@@ -554,8 +554,8 @@ postgresql:
postgresqlPostgresPassword: 'bitnami'
## Name of existing secret object
## The secret should contain the following keys:
## postgresql-postgres-password (for the unprivileged user)
## postgresql-password (for root user)
## postgresql-postgres-password (for root user)
## postgresql-password (for the unprivileged user)
##
# existingSecret: my-secret
## Create a database
@@ -583,6 +583,10 @@ externalDatabase:
## Database password
##
password: ''
## PostgreSQL create user/database
## If true it will add POSTGRESQL_CLIENT_* env vars to the deployment which will create the PostgreSQL user & database using the provided admin credentials
##
create: true
## PostgreSQL admin user (used in the installation stage)
##
postgresqlPostgresUser: ''
@@ -591,8 +595,8 @@ externalDatabase:
postgresqlPostgresPassword: ''
## Name of existing secret object
## The secret should contain the following keys:
## postgresql-postgres-password (for the unprivileged user)
## postgresql-password (for root user)
## postgresql-postgres-password (for root user)
## postgresql-password (for the unprivileged user)
##
# existingSecret: my-secret
## Database name