From 01aeb5989a99005e85d252aa8eb1a804247ef020 Mon Sep 17 00:00:00 2001 From: ISNing Date: Thu, 2 May 2024 23:44:18 +0800 Subject: [PATCH] fix(logto): Refactor PostgreSQL configuration to configmap and secret templates --- charts/logto/Chart.yaml | 2 +- charts/logto/templates/configmap.yaml | 6 ------ charts/logto/templates/secret.yaml | 8 ++++++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/charts/logto/Chart.yaml b/charts/logto/Chart.yaml index aea27d8..b78ccc0 100644 --- a/charts/logto/Chart.yaml +++ b/charts/logto/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.9 +version: 0.1.10 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/logto/templates/configmap.yaml b/charts/logto/templates/configmap.yaml index 946ca89..16f1106 100644 --- a/charts/logto/templates/configmap.yaml +++ b/charts/logto/templates/configmap.yaml @@ -10,10 +10,4 @@ data: {{- if .Values.emmbedded_tls.enabled }} HTTPS_CERT_PATH: "/etc/logto/tls/{{ .Values.tls.certName }}" HTTPS_KEY_PATH: "/etc/logto/tls/{{ .Values.tls.keyName }}" - {{- end }} - {{- if .Values.postgresql.enabled }} - DB_URL: "postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DATABASE)" - POSTGRES_HOST: {{- printf "%s.%s.svc.cluster.local" (include "postgresql.v1.primary.fullname" .Subcharts.postgresql) .Release.Namespace }} - POSTGRES_PORT: {{ include "postgresql.v1.service.port" .Subcharts.postgresql }} - POSTGRES_USERNAME: {{ include "postgresql.v1.username" .Subcharts.postgresql }} {{- end }} \ No newline at end of file diff --git a/charts/logto/templates/secret.yaml b/charts/logto/templates/secret.yaml index 0215e1b..361c2cd 100644 --- a/charts/logto/templates/secret.yaml +++ b/charts/logto/templates/secret.yaml @@ -8,8 +8,12 @@ type: Opaque data: TRUST_PROXY_HEADER: {{ .Values.trustProxyHeader | b64enc | quote }} {{- if .Values.postgresql.enabled }} - - name: POSTGRES_PASSWORD - valueFrom: + DB_URL: "postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DATABASE)" + POSTGRES_HOST: {{ printf "%s.%s.svc.cluster.local" (include "postgresql.v1.primary.fullname" .Subcharts.postgresql) .Release.Namespace | quote }} + POSTGRES_PORT: {{ include "postgresql.v1.service.port" .Subcharts.postgresql }} + POSTGRES_USERNAME: {{ include "postgresql.v1.username" .Subcharts.postgresql }} + POSTGRES_PASSWORD: + valueFrom: secretKeyRef: name: {{ include "postgresql.v1.secretName" .Subcharts.postgresql }} key: password