mirror of
https://github.com/rtomik/helm-charts.git
synced 2026-07-16 16:25:16 +00:00
fixed bug with external postgresql v 1.0.4
This commit is contained in:
@ -22,19 +22,18 @@ data:
|
||||
{{- if .Values.config.database.migration_retry }}
|
||||
migration_retry: {{ .Values.config.database.migration_retry }}
|
||||
{{- end }}
|
||||
migration_timeout: {{ .Values.config.database.migration_timeout | default "300s" | quote }}
|
||||
{{- if eq .Values.config.database.type "postgres" }}
|
||||
{{- if not .Values.config.database.secrets.existingSecret }}
|
||||
host: {{ .Values.config.database.host | quote }}
|
||||
port: {{ .Values.config.database.port }}
|
||||
name: {{ .Values.config.database.name | quote }}
|
||||
{{- if not .Values.config.database.secrets.existingSecret }}
|
||||
user: {{ .Values.config.database.user | quote }}
|
||||
password: {{ .Values.config.database.password | quote }}
|
||||
name: {{ .Values.config.database.name | quote }}
|
||||
{{- else }}
|
||||
# Database host, port, and name from values, credentials from Secret
|
||||
host: {{ .Values.config.database.host | quote }}
|
||||
port: {{ .Values.config.database.port }}
|
||||
name: {{ .Values.config.database.name | quote }}
|
||||
# Username and password will be injected via environment variables from Secret
|
||||
# Reference environment variables for database credentials
|
||||
user: "$DT_DATABASE_USER"
|
||||
password: "$DT_DATABASE_PASSWORD"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
jwt:
|
||||
|
||||
@ -88,15 +88,44 @@ spec:
|
||||
- name: {{ .name }}
|
||||
value: {{ .value | quote }}
|
||||
{{- end }}
|
||||
{{- if or .Values.config.jwt.existingSecret .Values.config.oauth2.existingSecret .Values.config.database.secrets.existingSecret }}
|
||||
# Secret-based environment variables
|
||||
# Database configuration environment variables
|
||||
{{- if eq .Values.config.database.type "postgres" }}
|
||||
- name: DT_DATABASE_TYPE
|
||||
value: "postgres"
|
||||
- name: DT_DATABASE_HOST
|
||||
value: {{ .Values.config.database.host | quote }}
|
||||
- name: DT_DATABASE_PORT
|
||||
value: {{ .Values.config.database.port | quote }}
|
||||
- name: DT_DATABASE_NAME
|
||||
value: {{ .Values.config.database.name | quote }}
|
||||
{{- if .Values.config.database.secrets.existingSecret }}
|
||||
- name: DT_DATABASE_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.secrets.existingSecret }}
|
||||
key: {{ .Values.config.database.secrets.userKey }}
|
||||
- name: DT_DATABASE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.secrets.existingSecret }}
|
||||
key: {{ .Values.config.database.secrets.passwordKey }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: DT_DATABASE_TYPE
|
||||
value: {{ .Values.config.database.type | quote }}
|
||||
{{- end }}
|
||||
# JWT configuration
|
||||
{{- if .Values.config.jwt.existingSecret }}
|
||||
- name: DT_JWT_SECRET
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.jwt.existingSecret }}
|
||||
key: {{ .Values.config.jwt.secretKey }}
|
||||
{{- else }}
|
||||
- name: DT_JWT_SECRET
|
||||
value: {{ .Values.config.jwt.secret | quote }}
|
||||
{{- end }}
|
||||
# OAuth2 configuration
|
||||
{{- if .Values.config.oauth2.existingSecret }}
|
||||
- name: DT_OAUTH2_CLIENT_ID
|
||||
valueFrom:
|
||||
@ -109,19 +138,6 @@ spec:
|
||||
name: {{ .Values.config.oauth2.existingSecret }}
|
||||
key: {{ .Values.config.oauth2.clientSecretKey }}
|
||||
{{- end }}
|
||||
{{- if and .Values.config.database.secrets.existingSecret (eq .Values.config.database.type "postgres") }}
|
||||
- name: DT_DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.secrets.existingSecret }}
|
||||
key: {{ .Values.config.database.secrets.userKey }}
|
||||
- name: DT_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.secrets.existingSecret }}
|
||||
key: {{ .Values.config.database.secrets.passwordKey }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user