(feat) move postgresql init and password-generator to common (#1113)

* Move Postgresql initcontainer to common

* bump common

* Handle postgres password generation in common and inject into values.yaml for use in Apps

* (refactor) adapt apps using postgresql to common init and password generator

* no message
This commit is contained in:
Kjeld Schouten-Lebbing
2021-10-09 19:24:45 +02:00
committed by GitHub
parent ce48246b9b
commit 2679fc1108
21 changed files with 93 additions and 305 deletions
@@ -8,11 +8,6 @@ image:
pullPolicy: IfNotPresent
tag: v5.2.0@sha256:8fc7bb87b77d76d929bcd36403d4f27878fa3e99f5448fb05ed64829078665a4
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
initContainers:
migrate-db:
image: "{{ .Values.alpineImage.repository}}:{{ .Values.alpineImage.tag }}"
@@ -43,7 +38,6 @@ postgresql:
enabled: true
postgresqlUsername: sogo
postgresqlDatabase: sogo
existingSecret: dbcreds
# -- memcached dependency settings
memcached:
+3 -27
View File
@@ -1,29 +1,5 @@
{{/* Define the configmap */}}
{{- define "sogo.config" -}}
---
apiVersion: v1
kind: Secret
metadata:
labels:
{{- include "common.labels" . | nindent 4 }}
name: dbcreds
{{- $dbprevious := lookup "v1" "Secret" .Release.Namespace "dbcreds" }}
{{- $dbPass := "" }}
data:
{{- if $dbprevious }}
{{- $dbPass = ( index $dbprevious.data "postgresql-password" ) | b64dec }}
postgresql-password: {{ ( index $dbprevious.data "postgresql-password" ) }}
postgresql-postgres-password: {{ ( index $dbprevious.data "postgresql-postgres-password" ) }}
{{- else }}
{{- $dbPass = randAlphaNum 50 }}
postgresql-password: {{ $dbPass | b64enc | quote }}
postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }}
{{- end }}
{{- $url := printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase }}
url: {{ $url | b64enc | quote }}
plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
type: Opaque
---
@@ -51,9 +27,9 @@ data:
* **************************************************************************/
/* Database configuration (mysql:// or postgresql://) */
SOGoProfileURL = "{{ $url }}/sogo_user_profile";
OCSFolderInfoURL = "{{ $url }}/sogo_folder_info";
OCSSessionsFolderURL = "{{ $url }}/sogo_sessions_folder";
SOGoProfileURL = "{{ .Values.postgresql.url.complete }}/sogo_user_profile";
OCSFolderInfoURL = "{{ .Values.postgresql.url.complete }}/sogo_folder_info";
OCSSessionsFolderURL = "{{ .Values.postgresql.url.complete }}/sogo_sessions_folder";
/* Mail */
SOGoDraftsFolderName = {{ .Values.sogo.mail.SOGoDraftsFolderName | default "Drafts" }};
-23
View File
@@ -12,11 +12,6 @@ podSecurityContext:
runAsUser: 0
runAsGroup: 0
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
# -- services
service:
main:
@@ -24,23 +19,6 @@ service:
main:
port: 80
# -- initcontainers
initContainers:
# -- wait for database before starting sogo
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository }}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U sogo -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
# -- persistence settings
persistence:
data:
@@ -66,7 +44,6 @@ postgresql:
enabled: true
postgresqlUsername: sogo
postgresqlDatabase: sogo
existingSecret: dbcreds
# -- memcached dependency settings
memcached:
+1 -1
View File
@@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 8.2.2
version: 8.3.0
+3
View File
@@ -28,6 +28,9 @@ Main entrypoint for the common library chart. It will render all underlying temp
{{- /* Build the templates */ -}}
{{- include "common.pvc" . }}
{{- /* Autogenerate postgresql passwords if needed */ -}}
{{- include "common.dependencies.postgresql.injector" . }}
{{- if .Values.serviceAccount.create -}}
{{- include "common.serviceAccount" . }}
{{- end -}}
@@ -51,6 +51,7 @@ terminationGracePeriodSeconds: {{ . }}
{{- end }}
initContainers:
{{- include "common.controller.autopermissions" . | nindent 2 }}
{{- include "common.dependencies.postgresql.init" . | nindent 2 }}
{{- if .Values.initContainers }}
{{- $initContainers := list }}
{{- range $index, $key := (keys .Values.initContainers | uniq | sortAlpha) }}
@@ -0,0 +1,15 @@
{{/*
This template ensures pods with postgresql dependency have a delayed start
*/}}
{{- define "common.dependencies.postgresql.init" -}}
{{- $pghost := printf "%v-%v" .Release.Name "postgresql" }}
{{- if .Values.postgresql.enabled }}
- name: postgresql-init
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U {{ .Values.postgresql.postgresqlUsername }} -h {{ $pghost }}; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
{{- end }}
{{- end -}}
@@ -0,0 +1,34 @@
{{/*
This template generates a random password and ensures it persists across updates/edits to the chart
*/}}
{{- define "common.dependencies.postgresql.injector" -}}
{{- $pghost := printf "%v-%v" .Release.Name "postgresql" }}
{{- if .Values.postgresql.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
labels:
{{- include "common.labels" . | nindent 4 }}
name: dbcreds
{{- $dbprevious := lookup "v1" "Secret" .Release.Namespace "dbcreds" }}
{{- $dbPass := "" }}
data:
{{- if $dbprevious }}
{{- $dbPass = ( index $dbprevious.data "postgresql-password" ) | b64dec }}
postgresql-password: {{ ( index $dbprevious.data "postgresql-password" ) }}
postgresql-postgres-password: {{ ( index $dbprevious.data "postgresql-postgres-password" ) }}
{{- else }}
{{- $dbPass = randAlphaNum 50 }}
postgresql-password: {{ $dbPass | b64enc | quote }}
postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }}
{{- end }}
url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }}
plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
type: Opaque
{{- $_ := set .Values.postgresql "postgresqlPassword" ( $dbPass | quote ) }}
{{- $_ := set .Values.postgresql.url "plain" ( ( printf "%v-%v" .Release.Name "postgresql" ) | quote ) }}
{{- $_ := set .Values.postgresql.url "complete" ( ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | quote ) }}
{{- end }}
{{- end -}}
+33 -3
View File
@@ -18,6 +18,8 @@ wireguardImage:
# -- Specify the WireGuard image pull policy
pullPolicy: IfNotPresent
# -- promtail specific configuration
# @default -- See below
promtailImage:
# -- Specify the promtail image
repository: ghcr.io/truecharts/promtail
@@ -26,6 +28,8 @@ promtailImage:
# -- Specify the promtail image pull policy
pullPolicy: IfNotPresent
# -- netshoot specific configuration
# @default -- See below
netshootImage:
# -- Specify the netshoot image
repository: nicolaka/netshoot
@@ -34,6 +38,8 @@ netshootImage:
# -- Specify the netshoot image pull policy
pullPolicy: Always
# -- codeserver specific configuration
# @default -- See below
codeserverImage:
# -- Specify the code-server image
repository: ghcr.io/truecharts/code-server
@@ -42,14 +48,27 @@ codeserverImage:
# -- Specify the code-server image pull policy
pullPolicy: IfNotPresent
# -- alpine specific configuration
# @default -- See below
alpineImage:
# -- Specify the code-server image
# -- Specify the Alpine image
repository: ghcr.io/truecharts/alpine
# -- Specify the code-server image tag
# -- Specify the Alpine image tag
tag: v3.14.2@sha256:cfc1d8be3d2d397ec18af71caab3e96581fc4d43417400ef744d87201642ddad
# -- Specify the code-server image pull policy
# -- Specify the Alpine image pull policy
pullPolicy: IfNotPresent
# -- postgresql specific configuration
# @default -- See below
postgresqlImage:
# -- Specify the postgresql image
repository: bitnami/postgresql
# -- Specify the postgresql image tag
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
# -- Specify the postgresql image pull policy
pullPolicy: IfNotPresent
global:
# -- Set an override for the prefix of the fullname
nameOverride:
@@ -874,3 +893,14 @@ addons:
envList: []
#- name: someenv
# value: somevalue
##
# This section contains some-preconfig for frequently used dependencies
##
# -- Postgresql dependency configuration
# @default -- See below
postgresql:
enabled: false
# -- can be used to make an easy accessable note which URLS to use to access the DB.
url: {}
@@ -9,11 +9,6 @@ image:
pullPolicy: IfNotPresent
tag: 4.31.0@sha256:6036f2b1fa3214fdcf189a8f28f40a856372413984b08f15ba4fb5891d77bc0a
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
enableServiceLinks: false
@@ -41,7 +36,6 @@ postgresql:
enabled: true
postgresqlUsername: authelia
postgresqlDatabase: authelia
existingSecret: dbcreds
persistence:
db:
storageClass: "SCALE-ZFS"
+1 -30
View File
@@ -2,31 +2,6 @@
{{- define "authelia.secrets" -}}
---
apiVersion: v1
kind: Secret
metadata:
labels:
{{- include "common.labels" . | nindent 4 }}
name: dbcreds
{{- $dbprevious := lookup "v1" "Secret" .Release.Namespace "dbcreds" }}
{{- $dbPass := "" }}
data:
{{- if $dbprevious }}
{{- $dbPass = ( index $dbprevious.data "postgresql-password" ) | b64dec }}
postgresql-password: {{ ( index $dbprevious.data "postgresql-password" ) }}
postgresql-postgres-password: {{ ( index $dbprevious.data "postgresql-postgres-password" ) }}
{{- else }}
{{- $dbPass = randAlphaNum 50 }}
postgresql-password: {{ $dbPass | b64enc | quote }}
postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }}
{{- end }}
url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }}
plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
type: Opaque
---
apiVersion: v1
kind: Secret
metadata:
@@ -88,11 +63,7 @@ data:
DUO_API_KEY: {{ .Values.duo_api.plain_api_key | b64enc }}
{{- end }}
{{- if $dbprevious }}
STORAGE_PASSWORD: {{ ( index $dbprevious.data "postgresql-password" ) }}
{{- else }}
STORAGE_PASSWORD: {{ $dbPass | b64enc | quote }}
{{- end }}
STORAGE_PASSWORD: {{ .Values.postgresql.postgresqlPassword }}
{{- if $redisprevious }}
REDIS_PASSWORD: {{ ( index $redisprevious.data "redis-password" ) }}
-21
View File
@@ -5,11 +5,6 @@ image:
pullPolicy: IfNotPresent
tag: 4.31.0@sha256:6036f2b1fa3214fdcf189a8f28f40a856372413984b08f15ba4fb5891d77bc0a
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
command: ["authelia"]
args: ["--config=/configuration.yaml"]
@@ -21,21 +16,6 @@ service:
main:
port: 9091
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U authelia -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
persistence:
config:
enabled: true
@@ -56,7 +36,6 @@ postgresql:
enabled: true
postgresqlUsername: authelia
postgresqlDatabase: authelia
existingSecret: dbcreds
# Enabled redis
# ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/redis
+1 -23
View File
@@ -9,27 +9,6 @@ image:
pullPolicy: IfNotPresent
tag: version-5.5.12@sha256:9a1f87a8ad38694675390756be9686fe9d8ba941fe1f145641626135c7eb5e4b
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U authelia -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
probes:
liveness:
path: "/login"
@@ -50,7 +29,7 @@ envValueFrom:
DB_HOST:
secretKeyRef:
name: dbcreds
key: postgresql_host
key: plainhost
DB_PASSWORD:
secretKeyRef:
name: dbcreds
@@ -61,7 +40,6 @@ postgresql:
enabled: true
postgresqlUsername: fireflyiii
postgresqlDatabase: fireflyiii
existingSecret: dbcreds
persistence:
db:
storageClass: "SCALE-ZFS"
@@ -1,20 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: dbcreds
{{- $previous := lookup "v1" "Secret" .Release.Namespace "dbcreds" }}
{{- $dbPass := "" }}
data:
{{- if $previous }}
{{- $dbPass = ( index $previous.data "postgresql-password" ) | b64dec }}
postgresql-password: {{ ( index $previous.data "postgresql-password" ) }}
postgresql-postgres-password: {{ ( index $previous.data "postgresql-postgres-password" ) }}
{{- else }}
{{- $dbPass = randAlphaNum 50 }}
postgresql-password: {{ $dbPass | b64enc | quote }}
postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }}
{{- end }}
url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }}
postgresql_host: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
type: Opaque
+1 -22
View File
@@ -8,32 +8,12 @@ image:
securityContext:
readOnlyRootFilesystem: false
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
service:
main:
ports:
main:
port: 8080
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U firefly -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
probes:
liveness:
path: "/login"
@@ -55,7 +35,7 @@ envValueFrom:
DB_HOST:
secretKeyRef:
name: dbcreds
key: postgresql_host
key: plainhost
DB_PASSWORD:
secretKeyRef:
name: dbcreds
@@ -74,4 +54,3 @@ postgresql:
enabled: true
postgresqlUsername: firefly
postgresqlDatabase: firefly
existingSecret: dbcreds
@@ -46,21 +46,6 @@ envValueFrom:
name: rediscreds
key: redis-password
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U nextcloud -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
# -- Probe configuration
# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
# @default -- See below
@@ -136,7 +121,6 @@ postgresql:
enabled: true
postgresqlUsername: nextcloud
postgresqlDatabase: nextcloud
existingSecret: dbcreds
persistence:
db:
storageClass: "SCALE-ZFS"
@@ -3,31 +3,6 @@
---
apiVersion: v1
kind: Secret
metadata:
labels:
{{- include "common.labels" . | nindent 4 }}
name: dbcreds
{{- $previous := lookup "v1" "Secret" .Release.Namespace "dbcreds" }}
{{- $dbPass := "" }}
data:
{{- if $previous }}
{{- $dbPass = ( index $previous.data "postgresql-password" ) | b64dec }}
postgresql-password: {{ ( index $previous.data "postgresql-password" ) }}
postgresql-postgres-password: {{ ( index $previous.data "postgresql-postgres-password" ) }}
{{- else }}
{{- $dbPass = randAlphaNum 50 }}
postgresql-password: {{ $dbPass | b64enc | quote }}
postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }}
{{- end }}
url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }}
host: {{ ( printf "%v-%v:5432" .Release.Name "postgresql" ) | b64enc | quote }}
plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
type: Opaque
---
apiVersion: v1
kind: Secret
metadata:
-16
View File
@@ -77,21 +77,6 @@ persistence:
accessMode: ReadWriteOnce
size: "100Gi"
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U nextcloud -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
# -- Probe configuration
# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
# @default -- See below
@@ -167,7 +152,6 @@ postgresql:
enabled: true
postgresqlUsername: nextcloud
postgresqlDatabase: nextcloud
existingSecret: dbcreds
# Enabled redis
# ... for more options see https://github.com/bitnami/charts/tree/master/bitnami/redis
@@ -9,11 +9,6 @@ image:
pullPolicy: IfNotPresent
tag: v1.22.2@sha256:8693c057298731f507128a395395172d60093be9b299f6bf9e5c35512a74d457
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
envTpl:
DOMAIN: "https://{{ if .Values.ingress }}{{ if .Values.ingress.main.enabled }}{{ ( index .Values.ingress.main.hosts 0 ).host }}{{ else }}placeholder.com{{ end }}{{ else }}placeholder.com{{ end }}"
@@ -24,21 +19,6 @@ envFrom:
- secretRef:
name: vaultwardensecret
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository }}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U authelia -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
envValueFrom:
DATABASE_URL:
@@ -63,7 +43,6 @@ postgresql:
enabled: true
postgresqlUsername: vaultwarden
postgresqlDatabase: vaultwarden
existingSecret: dbcreds
persistence:
db:
storageClass: "SCALE-ZFS"
@@ -33,28 +33,4 @@ data:
YUBICO_CLIENT_ID: {{ $yubicoClientId }}
YUBICO_SECRET_KEY: {{ required "Yubico Secret Key required" .Values.vaultwarden.yubico.secretKey | b64enc | quote }}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
labels:
{{- include "common.labels" . | nindent 4 }}
name: dbcreds
{{- $previous := lookup "v1" "Secret" .Release.Namespace "dbcreds" }}
{{- $dbPass := "" }}
data:
{{- if $previous }}
{{- $dbPass = ( index $previous.data "postgresql-password" ) | b64dec }}
postgresql-password: {{ ( index $previous.data "postgresql-password" ) }}
postgresql-postgres-password: {{ ( index $previous.data "postgresql-postgres-password" ) }}
{{- else }}
{{- $dbPass = randAlphaNum 50 }}
postgresql-password: {{ $dbPass | b64enc | quote }}
postgresql-postgres-password: {{ randAlphaNum 50 | b64enc | quote }}
{{- end }}
url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }}
plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }}
type: Opaque
{{- end -}}
-21
View File
@@ -5,11 +5,6 @@ image:
pullPolicy: IfNotPresent
tag: v1.22.2@sha256:8693c057298731f507128a395395172d60093be9b299f6bf9e5c35512a74d457
postgresqlImage:
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a
service:
main:
ports:
@@ -91,21 +86,6 @@ ingress:
# hosts:
# - chart-example.local
initContainers:
init-postgresdb:
image: "{{ .Values.postgresqlImage.repository }}:{{ .Values.postgresqlImage.tag }}"
command:
- "sh"
- "-c"
- "until pg_isready -U authelia -h ${pghost} ; do sleep 2 ; done"
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
envTpl:
DOMAIN: "https://{{ if .Values.ingress }}{{ if .Values.ingress.main.enabled }}{{ ( index .Values.ingress.main.hosts 0 ).host }}{{ else }}placeholder.com{{ end }}{{ else }}placeholder.com{{ end }}"
@@ -243,4 +223,3 @@ postgresql:
enabled: true
postgresqlUsername: vaultwarden
postgresqlDatabase: vaultwarden
existingSecret: dbcreds