more postgresql-ha adjustments

This commit is contained in:
pat-s 2023-07-18 18:31:58 +02:00
parent 46fb4d8026
commit de1d5af8c8
No known key found for this signature in database
GPG Key ID: 3C6318841EF78925
2 changed files with 7 additions and 7 deletions

View File

@ -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 -}}

View File

@ -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