Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐘 Add support for non-default Postgresql's postgres database and non-default port for self-hosted deployments #393

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,13 @@ Add environment variables to configure database values
{{- ternary "postgres" .Values.externalPostgresql.adminUser .Values.internalPostgresql.enabled | quote -}}
{{- end -}}

{{/*
Add environment variables to configure database values
*/}}
{{- define "carto.postgresql.adminDatabase" -}}
{{- ternary "postgres" .Values.externalPostgresql.adminDatabase .Values.internalPostgresql.enabled | quote -}}
{{- end -}}

{{/*
Add environment variables to configure database values
*/}}
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/workspace-api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ spec:
secretKeyRef:
name: {{ include "carto.postgresql.secretName" . }}
key: {{ include "carto.postgresql.secret.adminKey" . }}
- name: POSTGRES_ADMIN_DB
value: {{ include "carto.postgresql.adminDatabase" . }}
- name: WORKSPACE_POSTGRES_INTERNAL_USER
value: {{ include "carto.postgresql.internalUser" . }}
- name: WORKSPACE_POSTGRES_PASSWORD
Expand Down
2 changes: 2 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4448,6 +4448,7 @@ internalPostgresql:
## @param externalPostgresql.adminUser Database admin user (seen from outside the database)
## @param externalPostgresql.internalAdminUser Database admin user (seen from inside the database). If this value is not defined, `externalPostgresql.adminUser` is used.
## @param externalPostgresql.adminPassword Database admin password
## @param externalPostgresql.adminDatabase Admin database to connect to create the CARTO database (usually postgres)
## @param externalPostgresql.existingSecret Name of an existing secret resource containing the DB password
## @param externalPostgresql.existingSecretPasswordKey Name of the key inside the secret containing the DB password
## @param externalPostgresql.existingSecretAdminPasswordKey Name of the key inside the secret containing the DB admin password
Expand All @@ -4464,6 +4465,7 @@ externalPostgresql:
adminUser: postgres
internalAdminUser: ""
adminPassword: ""
adminDatabase: "postgres"
existingSecret: ""
existingSecretPasswordKey: ""
existingSecretAdminPasswordKey: ""
Expand Down
6 changes: 5 additions & 1 deletion customizations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ from the configuration, or let the chart to create the [secrets automatically](#
--from-literal=admin-password=<password>
```

> Note: `externalPostgresql.user` and `externalPostgresql.database` inside the Postgres instance are going to be created automatically during the installation process. Do not create then manually.
> **Note**
> The `externalPostgresql.user` and `externalPostgresql.database` inside the Postgres instance are going to be created automatically during the installation process. Do not create then manually.

> **Note**
> By default, CARTO will try to connect to the `postgres` database with the `postgres` user. If you want to use a different user, you can configure it via the `externalPostgresql.adminUser`, and `externalPostgresql.adminDatabase` parameters.

2. Configure the package:
Add the following lines to your `customizations.yaml` to connect to the external Postgres:
Expand Down
1 change: 1 addition & 0 deletions customizations/external_postgresql/customizations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ externalPostgresql:
password: ""
adminUser: "postgres"
adminPassword: ""
adminDatabase: "postgres"
database: "workspace"
port: "5432"
sslEnabled: true
Expand Down
Loading