diff --git a/charts/incubator/sogo/SCALE/ix_values.yaml b/charts/incubator/sogo/SCALE/ix_values.yaml index 5253ea61aa7..f53ac9a2ffe 100644 --- a/charts/incubator/sogo/SCALE/ix_values.yaml +++ b/charts/incubator/sogo/SCALE/ix_values.yaml @@ -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: diff --git a/charts/incubator/sogo/templates/_config.tpl b/charts/incubator/sogo/templates/_config.tpl index 8119d7de08f..5688f1d3cd1 100644 --- a/charts/incubator/sogo/templates/_config.tpl +++ b/charts/incubator/sogo/templates/_config.tpl @@ -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" }}; diff --git a/charts/incubator/sogo/values.yaml b/charts/incubator/sogo/values.yaml index 7ae154d171f..2c90bbfe423 100644 --- a/charts/incubator/sogo/values.yaml +++ b/charts/incubator/sogo/values.yaml @@ -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: diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index 4c1237932bc..1a48636bc88 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 8.2.2 +version: 8.3.0 diff --git a/charts/library/common/templates/_all.tpl b/charts/library/common/templates/_all.tpl index 8a7f56a7a8b..43b1917bbd3 100644 --- a/charts/library/common/templates/_all.tpl +++ b/charts/library/common/templates/_all.tpl @@ -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 -}} diff --git a/charts/library/common/templates/lib/controller/_pod.tpl b/charts/library/common/templates/lib/controller/_pod.tpl index a81e4c8f6ec..27807239bd8 100644 --- a/charts/library/common/templates/lib/controller/_pod.tpl +++ b/charts/library/common/templates/lib/controller/_pod.tpl @@ -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) }} diff --git a/charts/library/common/templates/lib/dependencies/_postgresInit.tpl b/charts/library/common/templates/lib/dependencies/_postgresInit.tpl new file mode 100644 index 00000000000..2c0d519d546 --- /dev/null +++ b/charts/library/common/templates/lib/dependencies/_postgresInit.tpl @@ -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 -}} diff --git a/charts/library/common/templates/lib/dependencies/_postgresInjector.tpl b/charts/library/common/templates/lib/dependencies/_postgresInjector.tpl new file mode 100644 index 00000000000..a8e7eb53f1c --- /dev/null +++ b/charts/library/common/templates/lib/dependencies/_postgresInjector.tpl @@ -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 -}} diff --git a/charts/library/common/values.yaml b/charts/library/common/values.yaml index cef2872fb6a..c41388a89d8 100644 --- a/charts/library/common/values.yaml +++ b/charts/library/common/values.yaml @@ -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: {} diff --git a/charts/stable/authelia/SCALE/ix_values.yaml b/charts/stable/authelia/SCALE/ix_values.yaml index 6b520484a2b..8c2b1023445 100644 --- a/charts/stable/authelia/SCALE/ix_values.yaml +++ b/charts/stable/authelia/SCALE/ix_values.yaml @@ -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" diff --git a/charts/stable/authelia/templates/_secrets.tpl b/charts/stable/authelia/templates/_secrets.tpl index c2d10e01fa8..91648ae3b4d 100644 --- a/charts/stable/authelia/templates/_secrets.tpl +++ b/charts/stable/authelia/templates/_secrets.tpl @@ -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" ) }} diff --git a/charts/stable/authelia/values.yaml b/charts/stable/authelia/values.yaml index 32aaf90f778..51227eca452 100644 --- a/charts/stable/authelia/values.yaml +++ b/charts/stable/authelia/values.yaml @@ -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 diff --git a/charts/stable/fireflyiii/SCALE/ix_values.yaml b/charts/stable/fireflyiii/SCALE/ix_values.yaml index 957453b5ca6..b24586b7955 100644 --- a/charts/stable/fireflyiii/SCALE/ix_values.yaml +++ b/charts/stable/fireflyiii/SCALE/ix_values.yaml @@ -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" diff --git a/charts/stable/fireflyiii/templates/secrets.yaml b/charts/stable/fireflyiii/templates/secrets.yaml deleted file mode 100644 index 711b9e06d8e..00000000000 --- a/charts/stable/fireflyiii/templates/secrets.yaml +++ /dev/null @@ -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 diff --git a/charts/stable/fireflyiii/values.yaml b/charts/stable/fireflyiii/values.yaml index a0462dbfff3..7974d9cf62d 100644 --- a/charts/stable/fireflyiii/values.yaml +++ b/charts/stable/fireflyiii/values.yaml @@ -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 diff --git a/charts/stable/nextcloud/SCALE/ix_values.yaml b/charts/stable/nextcloud/SCALE/ix_values.yaml index 387cac6f527..cc0b978609b 100644 --- a/charts/stable/nextcloud/SCALE/ix_values.yaml +++ b/charts/stable/nextcloud/SCALE/ix_values.yaml @@ -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" diff --git a/charts/stable/nextcloud/templates/_secrets.tpl b/charts/stable/nextcloud/templates/_secrets.tpl index d9ae0df858c..56744138861 100644 --- a/charts/stable/nextcloud/templates/_secrets.tpl +++ b/charts/stable/nextcloud/templates/_secrets.tpl @@ -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: diff --git a/charts/stable/nextcloud/values.yaml b/charts/stable/nextcloud/values.yaml index d30df4b8ac5..e13f9898187 100644 --- a/charts/stable/nextcloud/values.yaml +++ b/charts/stable/nextcloud/values.yaml @@ -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 diff --git a/charts/stable/vaultwarden/SCALE/ix_values.yaml b/charts/stable/vaultwarden/SCALE/ix_values.yaml index 3f6daddae76..fe8e5789bdb 100644 --- a/charts/stable/vaultwarden/SCALE/ix_values.yaml +++ b/charts/stable/vaultwarden/SCALE/ix_values.yaml @@ -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" diff --git a/charts/stable/vaultwarden/templates/_secrets.tpl b/charts/stable/vaultwarden/templates/_secrets.tpl index 7218b7c5cd4..ca5ec74b0af 100644 --- a/charts/stable/vaultwarden/templates/_secrets.tpl +++ b/charts/stable/vaultwarden/templates/_secrets.tpl @@ -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 -}} diff --git a/charts/stable/vaultwarden/values.yaml b/charts/stable/vaultwarden/values.yaml index 4ba28e4c3df..7e5ebb6ba47 100644 --- a/charts/stable/vaultwarden/values.yaml +++ b/charts/stable/vaultwarden/values.yaml @@ -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