mirror of
https://github.com/TeamPiped/Piped-Kubernetes.git
synced 2024-08-14 23:57:15 +00:00
chore(backend): Fix the configmap generation for databases. (#39)
It shouldn't require dialect and driver_class and instead default to using them but allow customization.
This commit is contained in:
parent
6355d40bbd
commit
42e5d8f110
10 changed files with 23 additions and 21 deletions
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
|
|
@ -53,13 +52,19 @@ data:
|
|||
{{ end }}
|
||||
COMPROMISED_PASSWORD_CHECK: {{ .Values.backend.config.COMPROMISED_PASSWORD_CHECK | default true }}
|
||||
DISABLE_REGISTRATION: {{ .Values.backend.config.DISABLE_REGISTRATION | default false }}
|
||||
FEED_RETENTION: {{ .Values.backend.config.DISABLE_REGISTRATION | int | default 30 }}
|
||||
FEED_RETENTION: {{ .Values.backend.config.FEED_RETENTION | default 30 | int }}
|
||||
{{- if and (.Values.backend.config.database) (not .Values.postgresql.enabled) }}
|
||||
hibernate.connection.url: {{.Values.backend.config.database.connection_url }}
|
||||
{{- if and (not .Values.backend.config.database.driver_class) (not .Values.backend.config.database.dialect) }}
|
||||
hibernate.connection.driver_class: org.postgresql.Driver
|
||||
hibernate.dialect: org.hibernate.dialect.PostgreSQLDialect
|
||||
{{ end }}
|
||||
{{- if and (.Values.backend.config.database) (.Values.backend.config.database.driver_class) (.Values.backend.config.database.dialect) (not .Values.postgresql.enabled)}}
|
||||
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 }}
|
||||
{{ end }}
|
||||
{{- 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") -}}
|
||||
|
|
@ -73,4 +78,8 @@ data:
|
|||
{{- else }}
|
||||
{{- fail "Unable to figure out database configuration for backend configmap."}}
|
||||
{{- end }}
|
||||
{{- if .Values.backend.config.SENTRY_DNS }}
|
||||
SENTRY_DSN: {{.Values.backend.SENTRY_DNS }}
|
||||
{{- else }}
|
||||
SENTRY_DSN:
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- if .Values.backend.enabled -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- if .Values.ingress.backend.enabled }}
|
||||
{{- $fullName := include "common.names.fullname" . -}}
|
||||
{{- $ingressName := $fullName -}}
|
||||
|
|
@ -17,7 +16,6 @@
|
|||
{{- $primaryService := .Values.backend.service.main -}}
|
||||
{{- $defaultServiceName := "piped-backend" -}}
|
||||
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- include "bjw-s.common.values.init" . }}
|
||||
|
||||
{{- define "common.getValueFromSecret" }}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- if .Values.frontend.enabled -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- if .Values.ingress.main.enabled }}
|
||||
{{- $fullName := include "common.names.fullname" . -}}
|
||||
{{- $ingressName := $fullName -}}
|
||||
|
|
@ -17,7 +16,6 @@
|
|||
{{- $primaryService := .Values.frontend.service.main -}}
|
||||
{{- $defaultServiceName := "piped-frontend" -}}
|
||||
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- if .Values.ytproxy.enabled -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
---
|
||||
{{- if .Values.ingress.ytproxy.enabled }}
|
||||
{{- $fullName := include "common.names.fullname" . -}}
|
||||
{{- $ingressName := $fullName -}}
|
||||
|
|
@ -17,7 +16,6 @@
|
|||
{{- $primaryService := .Values.ytproxy.service.main -}}
|
||||
{{- $defaultServiceName := "piped-ytproxy" -}}
|
||||
{{- $defaultServicePort := get $primaryService.ports (include "bjw-s.common.lib.service.primaryPort" (dict "values" $primaryService)) -}}
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue