chore: Use bitnami instead of stock postgresql container (#960)

* chore: Setup all apps to use bitnami instead of stock postgresql container

* Actually don't bump major as there is no breaking change (as people using it will default to the migration initscript)
This commit is contained in:
Kjeld Schouten-Lebbing
2021-09-11 20:58:37 +02:00
committed by GitHub
parent 9e02fb55a6
commit 238e2bc0c6
14 changed files with 279 additions and 43 deletions
+22 -13
View File
@@ -9,24 +9,33 @@ image:
tag: v5.2.0@sha256:8fc7bb87b77d76d929bcd36403d4f27878fa3e99f5448fb05ed64829078665a4
postgresqlImage:
repository: postgres
repository: bitnami/postgresql
pullPolicy: IfNotPresent
tag: 13.4-alpine@sha256:a70babcd0e8f86272c35d6efcf8070c597c1f31b3d19727eece213a09929dd55
tag: 13.4.0@sha256:7fff0f7e827cd8e1daa3adbf0ca3f19e21006023c0f6d1c2d835718961516a87
initContainers:
- name: init-postgresdb
image: "{{ .Values.postgresqlImage.repository}}:{{ .Values.postgresqlImage.tag }}"
migrate-db:
image: "{{ .Values.alpineImage.repository}}:{{ .Values.alpineImage.tag }}"
securityContext:
runAsUser: 0
privileged: true
allowPrivilegeEscalation: true
runAsNonRoot: false
command:
- "sh"
- "-c"
- "until pg_isready -U sogo -h ${pghost} ; do sleep 2 ; done"
- /bin/sh
- -cx
- |
echo 'trying to migrate old db to new location...'
mkdir -p /bitnami/postgresql/data
mv -f /bitnami/postgresql/old/* /bitnami/postgresql/data/ || true
chown -R {{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }} /bitnami/postgresql/data
chmod 775 /bitnami/postgresql/data
imagePullPolicy: IfNotPresent
env:
- name: pghost
valueFrom:
secretKeyRef:
name: dbcreds
key: plainhost
volumeMounts:
- name: db
mountPath: /bitnami/postgresql/old
- name: data
mountPath: /bitnami/postgresql
# Enabled postgres