From a414544c2b6e966887f8cd30216de87f9aa2d6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattis=20H=C3=A5d=C3=A9n?= Date: Mon, 4 Mar 2024 10:41:12 +0100 Subject: [PATCH] Add ability to connect to PostgreSQL in Flowise using SSL --- charts/flowise/README.md | 1 + charts/flowise/templates/deployment.yaml | 6 +++++- charts/flowise/values.yaml | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/flowise/README.md b/charts/flowise/README.md index 7a0298fb..441df2b2 100644 --- a/charts/flowise/README.md +++ b/charts/flowise/README.md @@ -202,6 +202,7 @@ The command deletes the release named `my-release` and frees all the kubernetes | `externalPostgresql.existingSecret` | Name of existing Secret to use | `""` | | `externalPostgresql.existingSecretKeyPassword` | Key in existing Secret that contains PostgreSQL password | `password` | | `externalPostgresql.database` | External PostgreSQL database | `flowise` | +| `externalPostgresql.ssl` | Whether to connect using SSL | `false` | ### Wait parameters diff --git a/charts/flowise/templates/deployment.yaml b/charts/flowise/templates/deployment.yaml index db79d4ff..14a22462 100644 --- a/charts/flowise/templates/deployment.yaml +++ b/charts/flowise/templates/deployment.yaml @@ -86,7 +86,7 @@ spec: - /bin/sh - -ec - | - wait4x postgresql "postgres://${POSTGRESQL_USERNAME}:${POSTGRESQL_PASSWORD}@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DATABASE}?sslmode=disable" --timeout 0 + wait4x postgresql "postgres://${POSTGRESQL_USERNAME}:${POSTGRESQL_PASSWORD}@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DATABASE}?sslmode=${POSTGRESQL_SSL}" --timeout 0 env: - name: POSTGRESQL_HOST value: {{ include "flowise.postgresql.host" . | quote }} @@ -101,6 +101,8 @@ spec: key: {{ include "flowise.postgresql.secretKeyPassword" . }} - name: POSTGRESQL_DATABASE value: {{ include "flowise.postgresql.database" . | quote }} + - name: POSTGRESQL_SSL + value: {{ include "flowise.postgresql.ssl" . | lower }} resources: {{- toYaml .Values.wait.resources | nindent 12 }} {{- end }} @@ -177,6 +179,8 @@ spec: key: {{ include "flowise.postgresql.secretKeyPassword" . }} - name: DATABASE_NAME value: {{ include "flowise.postgresql.database" . | quote }} + - name: POSTGRESQL_SSL + value: {{ include "flowise.postgresql.ssl" . | lower }} {{- end }} {{- if .Values.extraEnvVars }} {{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }} diff --git a/charts/flowise/values.yaml b/charts/flowise/values.yaml index 7380ca2e..734b2a08 100644 --- a/charts/flowise/values.yaml +++ b/charts/flowise/values.yaml @@ -401,6 +401,9 @@ externalPostgresql: ## @param externalPostgresql.database External PostgreSQL database database: flowise + ## @param externalPostgresql.ssl Whether to connect using SSL + ssl: false + ## @section Wait parameters wait: