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 -}} {{- end -}}
{{- define "postgresql.dns" -}} {{- 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 -}} {{- end -}}
{{- define "redis.dns" -}} {{- define "redis.dns" -}}
@ -344,14 +344,14 @@ https
{{- end -}} {{- end -}}
{{- define "gitea.inline_configuration.defaults.database" -}} {{- define "gitea.inline_configuration.defaults.database" -}}
{{- if .Values.postgresql.enabled -}} {{- if .Values.postgresql-ha.enabled -}}
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}} {{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
{{- if not (.Values.gitea.config.database.HOST) -}} {{- if not (.Values.gitea.config.database.HOST) -}}
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}} {{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
{{- end -}} {{- end -}}
{{- $_ := set .Values.gitea.config.database "NAME" (index .Values "postgresql-ha" "global" "postgresql-ha" "auth" "database") -}} {{- $_ := 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-ha" "auth" "username") -}} {{- $_ := 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-ha" "auth" "password") -}} {{- $_ := set .Values.gitea.config.database "PASSWD" (index .Values "postgresql-ha" "global" "postgresql" "auth" "password") -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -489,14 +489,14 @@ redis-cluster:
postgresql-ha: postgresql-ha:
enabled: true enabled: true
global: global:
postgresql-ha: postgresql:
auth: auth:
password: gitea password: gitea
database: gitea database: gitea
username: gitea username: gitea
service: service:
ports: ports:
postgresql-ha: 5432 postgresql: 5432
primary: primary:
persistence: persistence:
size: 10Gi size: 10Gi