Skip to content

Commit

Permalink
When using external DB, allow to configure ssl mode (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGacon authored Mar 13, 2024
1 parent 468fb42 commit 31039fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions charts/geonode/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
{{- end -}}
{{- end -}}

{{- define "database_ssl" -}}
{{- if (eq .Values.postgres.type "operator") -}}
require
{{- else if (eq .Values.postgres.type "external") -}}
{{ .Values.postgres.external.ssl }}
{{- end -}}
{{- end -}}

# secret key reference for the password of user: .Values.postgres.username
{{- define "database_postgres_password_secret_key_ref" -}}
{{- if (eq .Values.postgres.type "operator") -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/geonode/templates/geonode/geonode-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ data:
DATABASE_PORT: {{ include "database_port" . | quote }}

# enables ssl encrypted psql connection (required by postgres-operator databases)
PGSSLMODE: "require"
PGSSLMODE: {{ include "database_ssl" . | quote }}
POSTGRES_USER: {{ .Values.postgres.username | quote }}
GEONODE_DATABASE: {{ .Values.postgres.geonode_databasename_and_username | quote }}
GEONODE_GEODATABASE: {{ .Values.postgres.geodata_databasename_and_username | quote }}
Expand Down
1 change: 1 addition & 0 deletions charts/geonode/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ postgres:
external:
hostname: my-external-postgres.com
port: 5432
ssl: prefer
secret:
# -- name of an existing Secret to use. Set, if you want to separately maintain the Secret.
existingSecretName: ""
Expand Down

0 comments on commit 31039fc

Please sign in to comment.