From de1d5af8c8b62c86f2483f9308b70f1133ca03a6 Mon Sep 17 00:00:00 2001 From: pat-s Date: Tue, 18 Jul 2023 18:31:58 +0200 Subject: [PATCH] more postgresql-ha adjustments --- templates/_helpers.tpl | 10 +++++----- values.yaml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 2f734a9..6726856 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -113,7 +113,7 @@ app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} {{- define "postgresql.dns" -}} -{{- printf "%s-postgresql-ha.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "global" "postgresql-ha" "service" "ports" "postgresql-ha") -}} +{{- printf "%s-postgresql-ha.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "global" "postgresql" "service" "ports" "postgresql") -}} {{- end -}} {{- define "redis.dns" -}} @@ -344,14 +344,14 @@ https {{- end -}} {{- define "gitea.inline_configuration.defaults.database" -}} - {{- if .Values.postgresql.enabled -}} + {{- if .Values.postgresql-ha.enabled -}} {{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}} {{- if not (.Values.gitea.config.database.HOST) -}} {{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}} {{- end -}} - {{- $_ := set .Values.gitea.config.database "NAME" (index .Values "postgresql-ha" "global" "postgresql-ha" "auth" "database") -}} - {{- $_ := set .Values.gitea.config.database "USER" (index .Values "postgresql-ha" "global" "postgresql-ha" "auth" "username") -}} - {{- $_ := set .Values.gitea.config.database "PASSWD" (index .Values "postgresql-ha" "global" "postgresql-ha" "auth" "password") -}} + {{- $_ := set .Values.gitea.config.database "NAME" (index .Values "postgresql-ha" "global" "postgresql" "auth" "database") -}} + {{- $_ := set .Values.gitea.config.database "USER" (index .Values "postgresql-ha" "global" "postgresql" "auth" "username") -}} + {{- $_ := set .Values.gitea.config.database "PASSWD" (index .Values "postgresql-ha" "global" "postgresql" "auth" "password") -}} {{- end -}} {{- end -}} diff --git a/values.yaml b/values.yaml index 324837a..1db6bfc 100644 --- a/values.yaml +++ b/values.yaml @@ -489,14 +489,14 @@ redis-cluster: postgresql-ha: enabled: true global: - postgresql-ha: + postgresql: auth: password: gitea database: gitea username: gitea service: ports: - postgresql-ha: 5432 + postgresql: 5432 primary: persistence: size: 10Gi