From 3cd8efc2b675181e031d773358e03d9f9d95ed26 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sun, 10 Oct 2021 01:20:01 +0200 Subject: [PATCH] (feat) Update Apps to use common-postgresql hooks (#1114) * (feat) bump common to use new common postgresql-hooks * bump postgresql as well * bump yet again * also process gitea * sogo * also add adaptations to gitea * bump postgresql * bump postgresql yet again * revert central defined existing secret * bump common... again * bumps * fix vaultwarden * encode authelia dbpassword secret correctly * remove useless container from nextcloud config * some cleanup * use lookup to grab the secret for authelia * try getting authelia to work * Fix quoting issues for autheliadb --- charts/incubator/sogo/Chart.yaml | 6 ++--- charts/incubator/sogo/SCALE/ix_values.yaml | 1 + charts/incubator/sogo/values.yaml | 1 + charts/stable/authelia/Chart.yaml | 6 ++--- charts/stable/authelia/SCALE/ix_values.yaml | 1 + charts/stable/authelia/templates/_secrets.tpl | 2 +- charts/stable/authelia/values.yaml | 1 + charts/stable/fireflyiii/Chart.yaml | 6 ++--- charts/stable/fireflyiii/SCALE/ix_values.yaml | 1 + charts/stable/fireflyiii/values.yaml | 1 + charts/stable/gitea/Chart.yaml | 6 ++--- charts/stable/gitea/SCALE/ix_values.yaml | 18 ------------- charts/stable/gitea/templates/_secrets.tpl | 26 +------------------ charts/stable/gitea/values.yaml | 20 +------------- charts/stable/nextcloud/Chart.yaml | 6 ++--- charts/stable/nextcloud/SCALE/ix_values.yaml | 9 ++----- charts/stable/nextcloud/values.yaml | 7 ++--- charts/stable/postgresql/Chart.yaml | 4 +-- charts/stable/postgresql/values.yaml | 2 +- charts/stable/vaultwarden/Chart.yaml | 9 +++---- .../stable/vaultwarden/SCALE/ix_values.yaml | 1 + .../stable/vaultwarden/templates/common.yaml | 2 +- charts/stable/vaultwarden/values.yaml | 1 + 23 files changed, 37 insertions(+), 100 deletions(-) diff --git a/charts/incubator/sogo/Chart.yaml b/charts/incubator/sogo/Chart.yaml index 97af58a3791..bf4175de7ad 100644 --- a/charts/incubator/sogo/Chart.yaml +++ b/charts/incubator/sogo/Chart.yaml @@ -3,11 +3,11 @@ appVersion: "5.2.0" dependencies: - name: common repository: https://truecharts.org - version: 8.2.2 + version: 8.3.4 - condition: postgresql.enabled name: postgresql repository: https://truecharts.org/ - version: 3.0.8 + version: 3.0.12 - condition: memcached.enabled name: memcached repository: https://charts.bitnami.com/bitnami @@ -27,4 +27,4 @@ name: sogo sources: - https://www.sogo.nu/ type: application -version: 4.0.12 +version: 4.0.13 diff --git a/charts/incubator/sogo/SCALE/ix_values.yaml b/charts/incubator/sogo/SCALE/ix_values.yaml index f53ac9a2ffe..8b036ee4301 100644 --- a/charts/incubator/sogo/SCALE/ix_values.yaml +++ b/charts/incubator/sogo/SCALE/ix_values.yaml @@ -36,6 +36,7 @@ initContainers: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: sogo postgresqlDatabase: sogo diff --git a/charts/incubator/sogo/values.yaml b/charts/incubator/sogo/values.yaml index 2c90bbfe423..0cf00b78a9b 100644 --- a/charts/incubator/sogo/values.yaml +++ b/charts/incubator/sogo/values.yaml @@ -42,6 +42,7 @@ persistence: # -- postgres dependency settings postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: sogo postgresqlDatabase: sogo diff --git a/charts/stable/authelia/Chart.yaml b/charts/stable/authelia/Chart.yaml index 74ba5895cae..62fb68b5edd 100644 --- a/charts/stable/authelia/Chart.yaml +++ b/charts/stable/authelia/Chart.yaml @@ -3,11 +3,11 @@ appVersion: "4.31.0" dependencies: - name: common repository: https://truecharts.org - version: 8.2.2 + version: 8.3.4 - condition: postgresql.enabled name: postgresql repository: https://truecharts.org/ - version: 3.0.8 + version: 3.0.12 - condition: redis.enabled name: redis repository: https://charts.bitnami.com/bitnami @@ -38,4 +38,4 @@ sources: - https://github.com/authelia/chartrepo - https://github.com/authelia/authelia type: application -version: 4.0.12 +version: 4.0.13 diff --git a/charts/stable/authelia/SCALE/ix_values.yaml b/charts/stable/authelia/SCALE/ix_values.yaml index 8c2b1023445..1a07671a0e7 100644 --- a/charts/stable/authelia/SCALE/ix_values.yaml +++ b/charts/stable/authelia/SCALE/ix_values.yaml @@ -34,6 +34,7 @@ initContainers: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: authelia postgresqlDatabase: authelia persistence: diff --git a/charts/stable/authelia/templates/_secrets.tpl b/charts/stable/authelia/templates/_secrets.tpl index 91648ae3b4d..0bbf81ef8e8 100644 --- a/charts/stable/authelia/templates/_secrets.tpl +++ b/charts/stable/authelia/templates/_secrets.tpl @@ -63,7 +63,7 @@ data: DUO_API_KEY: {{ .Values.duo_api.plain_api_key | b64enc }} {{- end }} - STORAGE_PASSWORD: {{ .Values.postgresql.postgresqlPassword }} + STORAGE_PASSWORD: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" | b64enc }} {{- if $redisprevious }} REDIS_PASSWORD: {{ ( index $redisprevious.data "redis-password" ) }} diff --git a/charts/stable/authelia/values.yaml b/charts/stable/authelia/values.yaml index 51227eca452..ad07070b795 100644 --- a/charts/stable/authelia/values.yaml +++ b/charts/stable/authelia/values.yaml @@ -34,6 +34,7 @@ persistence: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: authelia postgresqlDatabase: authelia diff --git a/charts/stable/fireflyiii/Chart.yaml b/charts/stable/fireflyiii/Chart.yaml index 9d96f7a78a8..9d199799f19 100644 --- a/charts/stable/fireflyiii/Chart.yaml +++ b/charts/stable/fireflyiii/Chart.yaml @@ -3,11 +3,11 @@ appVersion: "5.5.12" dependencies: - name: common repository: https://truecharts.org - version: 8.2.2 + version: 8.3.4 - condition: postgresql.enabled name: postgresql repository: https://truecharts.org/ - version: 3.0.8 + version: 3.0.12 deprecated: false description: A free and open source personal finance manager home: https://github.com/firefly-iii/firefly-iii/ @@ -27,4 +27,4 @@ name: fireflyiii sources: - https://github.com/firefly-iii/firefly-iii/ type: application -version: 9.0.11 +version: 9.0.12 diff --git a/charts/stable/fireflyiii/SCALE/ix_values.yaml b/charts/stable/fireflyiii/SCALE/ix_values.yaml index b24586b7955..83a0a486e17 100644 --- a/charts/stable/fireflyiii/SCALE/ix_values.yaml +++ b/charts/stable/fireflyiii/SCALE/ix_values.yaml @@ -38,6 +38,7 @@ envValueFrom: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: fireflyiii postgresqlDatabase: fireflyiii persistence: diff --git a/charts/stable/fireflyiii/values.yaml b/charts/stable/fireflyiii/values.yaml index 7974d9cf62d..fe12d8a9a6a 100644 --- a/charts/stable/fireflyiii/values.yaml +++ b/charts/stable/fireflyiii/values.yaml @@ -52,5 +52,6 @@ persistence: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: firefly postgresqlDatabase: firefly diff --git a/charts/stable/gitea/Chart.yaml b/charts/stable/gitea/Chart.yaml index d443b68e97b..e6dc6eb2b29 100644 --- a/charts/stable/gitea/Chart.yaml +++ b/charts/stable/gitea/Chart.yaml @@ -3,11 +3,11 @@ appVersion: "1.15.3" dependencies: - name: common repository: https://truecharts.org - version: 8.2.2 + version: 8.3.4 - condition: postgresql.enabled name: postgresql repository: https://truecharts.org/ - version: 3.0.8 + version: 3.0.12 - condition: memcached.enabled name: memcached repository: https://charts.bitnami.com/bitnami @@ -34,4 +34,4 @@ sources: - https://github.com/go-gitea/gitea - https://hub.docker.com/r/gitea/gitea/ type: application -version: 1.0.3 +version: 1.0.4 diff --git a/charts/stable/gitea/SCALE/ix_values.yaml b/charts/stable/gitea/SCALE/ix_values.yaml index 9451acc4793..f16bd2bbde5 100644 --- a/charts/stable/gitea/SCALE/ix_values.yaml +++ b/charts/stable/gitea/SCALE/ix_values.yaml @@ -9,29 +9,11 @@ image: tag: 1.15.3-rootless pullPolicy: IfNotPresent -postgresqlImage: - repository: bitnami/postgresql - pullPolicy: IfNotPresent - tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a - envFrom: - configMapRef: name: gitea-env initContainers: - 0-init-postgresdb: - image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}" - command: - - "sh" - - "-c" - - "until pg_isready -U gitea -h ${pghost} ; do sleep 2 ; done" - imagePullPolicy: IfNotPresent - env: - - name: pghost - valueFrom: - secretKeyRef: - name: dbcreds - key: plainhost 1-init-directories: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" command: ["/usr/sbin/init_directory_structure.sh"] diff --git a/charts/stable/gitea/templates/_secrets.tpl b/charts/stable/gitea/templates/_secrets.tpl index 4dda8d1fe26..19e21be7b87 100644 --- a/charts/stable/gitea/templates/_secrets.tpl +++ b/charts/stable/gitea/templates/_secrets.tpl @@ -1,29 +1,5 @@ {{/* Define the secrets */}} {{- define "gitea.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 - --- @@ -60,7 +36,7 @@ stringData: DB_TYPE = postgres HOST = {{ printf "%v-%v:%v" .Release.Name "postgresql" "5432" }} NAME = {{ .Values.postgresql.postgresqlDatabase }} - PASSWD = {{ $dbPass }} + PASSWD = {{ .Values.postgresql.postgresqlPassword }} USER = {{ .Values.postgresql.postgresqlUsername }} {{- range $catindex, $catvalue := .Values.customConfig }} {{- if eq $catvalue.name "database" }} diff --git a/charts/stable/gitea/values.yaml b/charts/stable/gitea/values.yaml index 186cc34443c..7190ac75237 100644 --- a/charts/stable/gitea/values.yaml +++ b/charts/stable/gitea/values.yaml @@ -3,11 +3,6 @@ image: tag: 1.15.3-rootless pullPolicy: IfNotPresent -postgresqlImage: - repository: bitnami/postgresql - pullPolicy: IfNotPresent - tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a - service: main: ports: @@ -24,19 +19,6 @@ envFrom: name: gitea-env initContainers: - 0-init-postgresdb: - image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}" - command: - - "sh" - - "-c" - - "until pg_isready -U gitea -h ${pghost} ; do sleep 2 ; done" - imagePullPolicy: IfNotPresent - env: - - name: pghost - valueFrom: - secretKeyRef: - name: dbcreds - key: plainhost 1-init-directories: image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" command: ["/usr/sbin/init_directory_structure.sh"] @@ -143,9 +125,9 @@ customConfig: [] # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: gitea postgresqlDatabase: gitea - existingSecret: dbcreds # -- memcached dependency settings memcached: diff --git a/charts/stable/nextcloud/Chart.yaml b/charts/stable/nextcloud/Chart.yaml index ba5a345c38d..f53dbbfc3a6 100644 --- a/charts/stable/nextcloud/Chart.yaml +++ b/charts/stable/nextcloud/Chart.yaml @@ -3,11 +3,11 @@ appVersion: "22.2.0" dependencies: - name: common repository: https://truecharts.org - version: 8.2.2 + version: 8.3.4 - condition: postgresql.enabled name: postgresql repository: https://truecharts.org/ - version: 3.0.8 + version: 3.0.12 - condition: redis.enabled name: redis repository: https://charts.bitnami.com/bitnami @@ -33,4 +33,4 @@ sources: - https://github.com/nextcloud/docker - https://github.com/nextcloud/helm type: application -version: 6.0.13 +version: 6.0.14 diff --git a/charts/stable/nextcloud/SCALE/ix_values.yaml b/charts/stable/nextcloud/SCALE/ix_values.yaml index cc0b978609b..ae88fdb7d18 100644 --- a/charts/stable/nextcloud/SCALE/ix_values.yaml +++ b/charts/stable/nextcloud/SCALE/ix_values.yaml @@ -9,17 +9,11 @@ image: pullPolicy: IfNotPresent tag: 22.2.0@sha256:50d4d103bf6a229ec0d589785e057ecdaa8cb718f197056739fa14f483e0071b -postgresqlImage: - repository: bitnami/postgresql - pullPolicy: IfNotPresent - tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a - strategy: type: Recreate env: {} - envTpl: POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}" POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}" @@ -36,7 +30,7 @@ envValueFrom: POSTGRES_HOST: secretKeyRef: name: dbcreds - key: host + key: plainporthost REDIS_HOST: secretKeyRef: name: rediscreds @@ -119,6 +113,7 @@ cronjob: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: nextcloud postgresqlDatabase: nextcloud persistence: diff --git a/charts/stable/nextcloud/values.yaml b/charts/stable/nextcloud/values.yaml index e13f9898187..c3ca9833757 100644 --- a/charts/stable/nextcloud/values.yaml +++ b/charts/stable/nextcloud/values.yaml @@ -14,10 +14,6 @@ podSecurityContext: runAsGroup: 0 fsGroup: 33 -postgresqlImage: - repository: bitnami/postgresql - pullPolicy: IfNotPresent - tag: 13.4.0@sha256:e7526fc32deec708740784d907bcea2ef6c78bc5ab5265026eff96e70082a54a service: main: ports: @@ -51,7 +47,7 @@ envValueFrom: POSTGRES_HOST: secretKeyRef: name: dbcreds - key: host + key: plainporthost REDIS_HOST: secretKeyRef: name: rediscreds @@ -150,6 +146,7 @@ cronjob: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: nextcloud postgresqlDatabase: nextcloud diff --git a/charts/stable/postgresql/Chart.yaml b/charts/stable/postgresql/Chart.yaml index e7bf7b71ff3..5176d9bf7e8 100644 --- a/charts/stable/postgresql/Chart.yaml +++ b/charts/stable/postgresql/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "13.4.0" dependencies: - name: common repository: https://truecharts.org - version: 8.3.3 + version: 8.3.4 deprecated: false description: PostgresSQL home: https://github.com/truecharts/apps/tree/master/stable/postgres @@ -25,4 +25,4 @@ name: postgresql sources: - https://www.postgresql.org/ type: application -version: 3.0.12 +version: 3.0.13 diff --git a/charts/stable/postgresql/values.yaml b/charts/stable/postgresql/values.yaml index 5eaa03170ba..f2a64083790 100644 --- a/charts/stable/postgresql/values.yaml +++ b/charts/stable/postgresql/values.yaml @@ -66,7 +66,7 @@ persistence: postgresqlPassword: "testpass" postgresqlUsername: "test" postgresqlDatabase: "test" -# existingSecret: "" +existingSecret: "" envValueFrom: POSTGRES_PASSWORD: diff --git a/charts/stable/vaultwarden/Chart.yaml b/charts/stable/vaultwarden/Chart.yaml index 261e022e478..107d5e01807 100644 --- a/charts/stable/vaultwarden/Chart.yaml +++ b/charts/stable/vaultwarden/Chart.yaml @@ -3,11 +3,11 @@ appVersion: "1.22.2" dependencies: - name: common repository: https://truecharts.org - version: 8.2.2 + version: 8.3.4 - condition: postgresql.enabled name: postgresql repository: https://truecharts.org/ - version: 3.0.8 + version: 3.0.12 deprecated: false description: Unofficial Bitwarden compatible server written in Rust home: https://github.com/truecharts/apps/tree/master/charts/stable/vaultwarden @@ -24,11 +24,8 @@ maintainers: - email: info@truecharts.org name: TrueCharts url: truecharts.org -- email: kjeld@schouten-lebbing.nl - name: Ornias1993 - url: truecharts.org name: vaultwarden sources: - https://github.com/dani-garcia/vaultwarden type: application -version: 9.0.11 +version: 9.0.12 diff --git a/charts/stable/vaultwarden/SCALE/ix_values.yaml b/charts/stable/vaultwarden/SCALE/ix_values.yaml index fe8e5789bdb..72e0ea5c9f1 100644 --- a/charts/stable/vaultwarden/SCALE/ix_values.yaml +++ b/charts/stable/vaultwarden/SCALE/ix_values.yaml @@ -41,6 +41,7 @@ database: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: vaultwarden postgresqlDatabase: vaultwarden persistence: diff --git a/charts/stable/vaultwarden/templates/common.yaml b/charts/stable/vaultwarden/templates/common.yaml index 30c51a2e0bf..23381ff8a0c 100644 --- a/charts/stable/vaultwarden/templates/common.yaml +++ b/charts/stable/vaultwarden/templates/common.yaml @@ -35,4 +35,4 @@ service: {{- include "vaultwarden.websocketinjector" . }} {{/* Render the templates */}} -{{ include "common.all" . }} +{{ include "common.postSetup" . }} diff --git a/charts/stable/vaultwarden/values.yaml b/charts/stable/vaultwarden/values.yaml index 7e5ebb6ba47..d54ee9102ef 100644 --- a/charts/stable/vaultwarden/values.yaml +++ b/charts/stable/vaultwarden/values.yaml @@ -221,5 +221,6 @@ persistence: # Enabled postgres postgresql: enabled: true + existingSecret: "dbcreds" postgresqlUsername: vaultwarden postgresqlDatabase: vaultwarden