3
0
mirror of https://github.com/mastodon/chart synced 2025-05-17 20:43:21 +00:00

Merge branch 'main' into INF-251-add-puma-metrics

This commit is contained in:
Tim Campbell 2025-03-05 16:46:59 +01:00
commit 022afbabea
6 changed files with 41 additions and 6 deletions

View File

@ -57,11 +57,11 @@ spec:
{{- end }}
env:
- name: "DB_HOST"
value: {{ template "mastodon.postgres.host" . }}
value: {{ template "mastodon.postgres.direct.host" . }}
- name: "DB_PORT"
value: {{ template "mastodon.postgres.port" . }}
value: {{ template "mastodon.postgres.direct.port" . }}
- name: "DB_NAME"
value: {{ .Values.postgresql.auth.database }}
value: {{ template "mastodon.postgres.direct.database" . }}
- name: "DB_USER"
value: {{ .Values.postgresql.auth.username }}
- name: "DB_PASS"

View File

@ -140,6 +140,33 @@ Establish which values we will use for remote connections
{{- end }}
{{- end }}
{{/*
Establish which values we will use for direct remote DB connections
*/}}
{{- define "mastodon.postgres.direct.host" -}}
{{- if .Values.postgresql.direct.hostname }}
{{- printf "%s" .Values.postgresql.direct.hostname -}}
{{- else }}
{{- printf "%s" (include "mastodon.postgres.host" .) -}}
{{- end }}
{{- end }}
{{- define "mastodon.postgres.direct.port" -}}
{{- if .Values.postgresql.direct.port }}
{{- printf "%d" (int .Values.postgresql.direct.port) | quote -}}
{{- else }}
{{- printf "%s" (include "mastodon.postgres.port" .) -}}
{{- end }}
{{- end }}
{{- define "mastodon.postgres.direct.database" -}}
{{- if .Values.postgresql.direct.database }}
{{- printf "%s" .Values.postgresql.direct.database -}}
{{- else }}
{{- printf "%s" .Values.postgresql.auth.database -}}
{{- end }}
{{- end }}
{{- define "mastodon.redis.host" -}}
{{- if .Values.redis.enabled }}
{{- printf "%s-%s" (include "mastodon.redis.fullname" .) "master" -}}

View File

@ -7,7 +7,7 @@ metadata:
{{- include "mastodon.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "-1"
spec:
template:

View File

@ -1,4 +1,3 @@
# Does not work with included database because of helm install order.
{{- if not .Values.postgresql.enabled }}
{{- include "mastodon.dbMigrateJob" (merge (dict "prepare" true ) .) }}
{{- end }}

View File

@ -1,4 +1,3 @@
# Does not work with included database because of helm install order.
{{- if and (include "mastodon.createSecret" .) (not .Values.postgresql.enabled) -}}
{{- include "mastodon.secrets.object" (merge (dict "prepare" true ) .) }}
{{- end }}

View File

@ -550,6 +550,16 @@ postgresql:
enabled: true
# postgresqlHostname: preexisting-postgresql
# postgresqlPort: 5432
# If using a connection pooler such as pgbouncer, please specify a hostname/IP
# that serves as a "direct" connection to the database, rather than going
# through the connection pooler. This is required for migrations to work
# properly.
direct:
hostname:
port:
database:
auth:
database: mastodon_production
username: mastodon