mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 00:27:30 +00:00
fix: mongodb connection
This commit is contained in:
@@ -112,3 +112,27 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the mongodb connection string.
|
||||||
|
*/}}
|
||||||
|
{{- define "infisical.mongodb.connectionString" -}}
|
||||||
|
{{- $host := include "infisical.mongodb.fullname" . -}}
|
||||||
|
{{- $port := 27017 -}}
|
||||||
|
{{- $user := "root" -}}
|
||||||
|
{{- $pass := "root" -}}
|
||||||
|
{{- if .Values.mongodbConnection -}}
|
||||||
|
{{- if .Values.mongodbConnection.host -}}
|
||||||
|
{{- $host = .Values.mongodbConnection.host -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .Values.mongodbConnection.port -}}
|
||||||
|
{{- $port = .Values.mongodbConnection.port -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .Values.mongodbConnection.username -}}
|
||||||
|
{{- $user = .Values.mongodbConnection.username -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- if .Values.mongodbConnection.password -}}
|
||||||
|
{{- $pass = .Values.mongodbConnection.password -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- printf "mongodb://%s:%s@%s:%d/" $user $pass $host $port -}}
|
||||||
|
{{- end -}}
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ spec:
|
|||||||
name: {{ .Values.backend.kubeSecretRef }}
|
name: {{ .Values.backend.kubeSecretRef }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
env:
|
||||||
|
- name: MONGO_URL
|
||||||
|
value: {{ include "infisical.mongodb.connectionString" . | quote }}
|
||||||
{{- range $key, $value := .Values.backendEnvironmentVariables }}
|
{{- range $key, $value := .Values.backendEnvironmentVariables }}
|
||||||
{{- if $value | quote | eq "MUST_REPLACE" }}
|
{{- if $value | quote | eq "MUST_REPLACE" }}
|
||||||
{{ fail "Environment variables are not set. Please set all environment variables to continue." }}
|
{{ fail "Environment variables are not set. Please set all environment variables to continue." }}
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ mongodb:
|
|||||||
service:
|
service:
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
|
||||||
|
# Recommended to replace with Mongo Cloud URI as the DB instance in the cluster does not have persistence yet
|
||||||
|
mongodbConnection: {}
|
||||||
|
# host: mymongodb.com # defaults to the internal mongo service
|
||||||
|
# port: 27017
|
||||||
|
# username: root
|
||||||
|
# password: root
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
enabled: true
|
enabled: true
|
||||||
annotations:
|
annotations:
|
||||||
@@ -56,6 +64,7 @@ ingress:
|
|||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
tls: []
|
tls: []
|
||||||
|
|
||||||
|
|
||||||
## Complete Ingress example
|
## Complete Ingress example
|
||||||
# ingress:
|
# ingress:
|
||||||
# enabled: true
|
# enabled: true
|
||||||
@@ -94,8 +103,4 @@ backendEnvironmentVariables:
|
|||||||
SMTP_USERNAME: MUST_REPLACE
|
SMTP_USERNAME: MUST_REPLACE
|
||||||
SMTP_PASSWORD: MUST_REPLACE
|
SMTP_PASSWORD: MUST_REPLACE
|
||||||
|
|
||||||
# Recommended to replace with Mongo Cloud URI as the DB instance in the cluster does not have persistence yet
|
|
||||||
MONGO_URL: mongodb://root:root@mongodb-service:27017/
|
|
||||||
|
|
||||||
# frontendEnvironmentVariables:
|
# frontendEnvironmentVariables:
|
||||||
|
|
||||||
Reference in New Issue
Block a user