Skip to content

Commit

Permalink
fix(logto): Refactor PostgreSQL configuration to configmap and secret…
Browse files Browse the repository at this point in the history
… templates
  • Loading branch information
ISNing committed May 2, 2024
1 parent bc11f9b commit 01aeb59
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/logto/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions charts/logto/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
8 changes: 6 additions & 2 deletions charts/logto/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01aeb59

Please sign in to comment.