fix mongo namespace
This commit is contained in:
1 parent
c0e33eb4fa
commit
8f657dcd36
1 file changed
+12
@@ -4,6 +4,14 @@
|
|||||||
{{- fail "secrets.JWT_SECRET must be overridden and cannot be 'change_me'" }}
|
{{- fail "secrets.JWT_SECRET must be overridden and cannot be 'change_me'" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
{{- /*
|
||||||
|
The bundled Mongo service ("checkmate-mongodb") lives in .Release.Namespace. App pods reach it
|
||||||
|
by bare name, but the KEDA operator runs in its own namespace and a bare name is NXDOMAIN there,
|
||||||
|
so worker autoscaling fails to query the backlog. Qualify the in-cluster host to its FQDN here so
|
||||||
|
the one connection string resolves from every namespace. External/already-qualified hosts are not
|
||||||
|
matched (the char after the host name is "." for an FQDN, which the pattern excludes).
|
||||||
|
*/}}
|
||||||
|
{{- $mongoFqdn := printf "checkmate-mongodb.%s.svc.cluster.local" .Release.Namespace }}
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -11,5 +19,9 @@ metadata:
|
|||||||
type: Opaque
|
type: Opaque
|
||||||
stringData:
|
stringData:
|
||||||
{{- range $key, $value := $secrets }}
|
{{- range $key, $value := $secrets }}
|
||||||
|
{{- if eq $key "DB_CONNECTION_STRING" }}
|
||||||
|
{{ $key }}: {{ regexReplaceAll "(//|@)checkmate-mongodb([:/,]|$)" $value (printf "${1}%s${2}" $mongoFqdn) | quote }}
|
||||||
|
{{- else }}
|
||||||
{{ $key }}: {{ $value | quote }}
|
{{ $key }}: {{ $value | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
Reference in new issue
Block a user