diff --git a/charts/shared-secrets/templates/_generate_secrets.sh b/charts/shared-secrets/templates/_generate_secrets.sh index c7e74c27fb79f952d590544f4bfad9d7908a15c9..23e49655968cc6431bf8164d9b8ee6d06e58efc1 100644 --- a/charts/shared-secrets/templates/_generate_secrets.sh +++ b/charts/shared-secrets/templates/_generate_secrets.sh @@ -51,7 +51,7 @@ generate_secret_if_needed {{ template "gitlab.redis.password.secret" . }} --from {{if not .Values.global.psql.host -}} # Postgres password -generate_secret_if_needed {{ template "gitlab.psql.password.secret" . }} --from-literal=postgres-password=$(gen_random 'a-zA-Z0-9' 64) +generate_secret_if_needed {{ template "gitlab.psql.password.secret" . }} --from-literal=postgresql-password=$(gen_random 'a-zA-Z0-9' 63) {{ end }} # Gitlab shell diff --git a/doc/advanced/external-db/index.md b/doc/advanced/external-db/index.md index 5e491d372f2aa2cc13568ca9233e729c940de238..f856a8fd830034273d653d0567b8998005bb52c1 100644 --- a/doc/advanced/external-db/index.md +++ b/doc/advanced/external-db/index.md @@ -44,5 +44,5 @@ helm install --set postgresql.install=false --set global.psql.host=psql.example --set global.psql.password.secret=gitlab-postgresql-password - --set global.psql.password.key=postgres-password + --set global.psql.password.key=postgresql-password ``` diff --git a/doc/installation/secrets.md b/doc/installation/secrets.md index ca389e4844d7fcbbdaebe8656e3972c350d77518..9a0feaad913e190311bd49485d26ab3ad2c43f54 100644 --- a/doc/installation/secrets.md +++ b/doc/installation/secrets.md @@ -187,7 +187,7 @@ Generate a random 64 character alpha-numeric password. Replace `` with the name of the release. ``` -kubectl create secret generic -postgresql-password --from-literal=postgres-password=$(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64) +kubectl create secret generic -postgresql-password --from-literal=postgresql-password=$(head -c 512 /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64) ``` ### Registry HTTP secret diff --git a/requirements.yaml b/requirements.yaml index 6e324e16b795a89ff549cb4ad3b7157329d9fbb0..2fff4dce278cd2854b5bea67d75405ae8e27adfb 100644 --- a/requirements.yaml +++ b/requirements.yaml @@ -9,7 +9,7 @@ dependencies: repository: https://kubernetes-charts.storage.googleapis.com/ condition: prometheus.install - name: postgresql - version: 0.12.0 + version: 5.3.7 repository: https://kubernetes-charts.storage.googleapis.com/ condition: postgresql.install - name: gitlab-runner diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index c4094d7e66b37464daee620d84fb3554c327d853..a34aac23cc4e9f19373b40b582985700bc27c2e0 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -183,11 +183,11 @@ Alias of gitlab.psql.password.secret to override upstream postgresql chart namin {{/* Return the name of the key in a secret that contains the postgres password -Uses `postgres-password` to match upstream postgresql chart when not using an +Uses `postgresql-password` to match upstream postgresql chart when not using an external postegresql */}} {{- define "gitlab.psql.password.key" -}} -{{- default "postgres-password" .Values.global.psql.password.key | quote -}} +{{- default "postgresql-password" .Values.global.psql.password.key | quote -}} {{- end -}} {{/* ######### ingress templates */}} diff --git a/values.yaml b/values.yaml index 0411c099a6e28445f71a9220e29e35c1d0d68651..f44e1898a43aa1894d5bbee56eeab53275869bd9 100644 --- a/values.yaml +++ b/values.yaml @@ -398,11 +398,16 @@ redis-ha: ## See requirements.yaml for current version postgresql: install: true - postgresUser: gitlab - postgresDatabase: gitlabhq_production - imageTag: 9.6.8 + postgresqlDatabase: gitlabhq_production + image: + tag: 11.3.0-debian-9-r38 usePasswordFile: true existingSecret: 'secret' + initdbScripts: + add_gitlab_user.sh: | + #!/bin/sh + export PGPASSWORD=$(cat /opt/bitnami/postgresql/secrets/postgresql-password) + psql -U postgres -c "CREATE USER gitlab WITH SUPERUSER PASSWORD '${PGPASSWORD}';" metrics: enabled: true ## Optionally define additional custom metrics