mirror of
https://github.com/TeamPiped/Piped-Kubernetes.git
synced 2024-08-14 23:57:15 +00:00
Added ability to supply backend's database creds via secret.
This commit is contained in:
parent
3c9966560d
commit
b34176b7ec
4 changed files with 22 additions and 7 deletions
|
|
@ -58,13 +58,20 @@ data:
|
|||
hibernate.connection.url: {{.Values.backend.config.database.connection_url }}
|
||||
hibernate.connection.driver_class: {{.Values.backend.config.database.driver_class }}
|
||||
hibernate.dialect: {{.Values.backend.config.database.dialect }}
|
||||
hibernate.connection.username: {{.Values.backend.config.database.username }}
|
||||
hibernate.connection.password: {{.Values.backend.config.database.password }}
|
||||
{{- if .Values.backend.config.database.secret }}
|
||||
hibernate.connection.username: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "database.username" ) -}}
|
||||
hibernate.connection.password: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "database.password") -}}
|
||||
{{- end }}
|
||||
{{- else if .Values.postgresql.enabled }}
|
||||
hibernate.connection.url: jdbc:postgresql://piped-postgresql/{{ .Values.postgresql.auth.database}}
|
||||
hibernate.connection.driver_class: org.postgresql.Driver
|
||||
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate.connection.username: {{.Values.postgresql.auth.username }}
|
||||
hibernate.connection.password: {{.Values.postgresql.auth.password }}
|
||||
{{- else if not (.Values.postgresql.enabled .Values.backend.config.database.secret) }}
|
||||
hibernate.connection.username: {{.Values.backend.config.database.username }}
|
||||
hibernate.connection.password: {{.Values.backend.config.database.password }}
|
||||
{{- else }}
|
||||
{{- fail "Unable to figure out database configuration for backend configmap."}}
|
||||
{{- end }}
|
||||
SENTRY_DSN:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
---
|
||||
{{- include "bjw-s.common.values.init" . }}
|
||||
|
||||
{{- define "common.getValueFromSecret" }}
|
||||
{{- $obj := (lookup "v1" "Secret" .Namespace .Name).data -}}
|
||||
{{- if $obj }}
|
||||
{{- index $obj .Key | b64dec -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "app-template.hardcodedValues" -}}
|
||||
|
||||
# Set the nameOverride based on the release name if no override has been set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue