File tree 1 file changed +8
-4
lines changed
deploy/helm/templates/api-service
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
{{- $nameSpace := include "lowcoder.namespace" . -}}
2
- {{- $mongoUser := first .Values.mongodb.auth.usernames -}}
3
- {{- $mongoPassword := first .Values.mongodb.auth.passwords -}}
4
- {{- $mongoServicename := .Values.mongodb.service.nameOverride -}}
2
+ {{- $mongoUser := (and .Values.mongodb.auth.usernames (first .Values.mongodb.auth.usernames)) | default "" -}}
3
+ {{- $mongoPassword := (and .Values.mongodb.auth.passwords (first .Values.mongodb.auth.passwords)) | default "" -}}
5
4
{{- $lowcoderDatabase := first .Values.mongodb.auth.databases -}}
5
+ {{- $mongoSecret := lookup "v1" "Secret" $nameSpace .Values.mongodb.auth.existingSecret | default dict -}}
6
+ {{- $mongoSecretPassword := (index $mongoSecret.data "password" | default "" | b64dec) -}}
7
+ {{- $mongoServicename := .Values.mongodb.service.nameOverride | default "" -}}
8
+ {{- $externalUrl := .Values.mongodb.service.externalUrl -}}
9
+
6
10
apiVersion : v1
7
11
kind : Secret
8
12
type : Opaque
@@ -18,7 +22,7 @@ stringData:
18
22
{{- if .Values.mongodb.enabled }}
19
23
LOWCODER_MONGODB_URL : " mongodb://{{ $mongoUser }}:{{ $mongoPassword }}@{{ $mongoServicename }}.{{ $nameSpace }}.svc.cluster.local/{{ $lowcoderDatabase }}?retryWrites=true&ssl=false"
20
24
{{- else }}
21
- LOWCODER_MONGODB_URL : {{ .Values.mongodb. externalUrl | quote }}
25
+ LOWCODER_MONGODB_URL : " mongodb:// {{ $mongoUser }}:{{ $mongoSecretPassword }}@{{ $ externalUrl }}/{{ $lowcoderDatabase }}?retryWrites=true&ssl=false "
22
26
{{- end }}
23
27
LOWCODER_DB_ENCRYPTION_PASSWORD : {{ .Values.global.config.encryption.password | default "lowcoder.org" | quote }}
24
28
LOWCODER_DB_ENCRYPTION_SALT : {{ .Values.global.config.encryption.salt | default "lowcoder.org" | quote }}
You can’t perform that action at this time.
0 commit comments