mirror of
https://github.com/mastodon/chart
synced 2025-03-15 13:31:51 +00:00
Add support for read replica (#105)
This commit is contained in:
parent
8f5e9dc971
commit
0072b14a6a
|
@ -15,6 +15,21 @@ data:
|
||||||
DB_NAME: {{ .Values.postgresql.auth.database }}
|
DB_NAME: {{ .Values.postgresql.auth.database }}
|
||||||
DB_POOL: {{ include "mastodon.maxDbPool" . }}
|
DB_POOL: {{ include "mastodon.maxDbPool" . }}
|
||||||
DB_USER: {{ .Values.postgresql.auth.username }}
|
DB_USER: {{ .Values.postgresql.auth.username }}
|
||||||
|
{{- if .Values.postgresql.readReplica.hostname }}
|
||||||
|
REPLICA_DB_HOST: {{ .Values.postgresql.readReplica.hostname }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.postgresql.readReplica.port }}
|
||||||
|
REPLICA_DB_PORT: {{ .Values.postgresql.readReplica.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.postgresql.readReplica.auth.database }}
|
||||||
|
REPLICA_DB_NAME: {{ .Values.postgresql.readReplica.auth.database }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.postgresql.readReplica.auth.username }}
|
||||||
|
REPLICA_DB_USER: {{ .Values.postgresql.readReplica.auth.username }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.postgresql.readReplica.auth.password }}
|
||||||
|
REPLICA_DB_PASS: {{ .Values.postgresql.readReplica.auth.password }}
|
||||||
|
{{- end }}
|
||||||
PREPARED_STATEMENTS: {{ .Values.mastodon.preparedStatements | quote }}
|
PREPARED_STATEMENTS: {{ .Values.mastodon.preparedStatements | quote }}
|
||||||
DEFAULT_LOCALE: {{ .Values.mastodon.locale }}
|
DEFAULT_LOCALE: {{ .Values.mastodon.locale }}
|
||||||
{{- if .Values.elasticsearch.enabled }}
|
{{- if .Values.elasticsearch.enabled }}
|
||||||
|
|
|
@ -102,6 +102,13 @@ spec:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ template "mastodon.postgresql.secretName" $context }}
|
name: {{ template "mastodon.postgresql.secretName" $context }}
|
||||||
key: password
|
key: password
|
||||||
|
{{- if $context.Values.postgresql.readReplica.auth.existingSecret }}
|
||||||
|
- name: "REPLICA_DB_PASS"
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ $context.Values.postgresql.readReplica.auth.existingSecret }}
|
||||||
|
key: password
|
||||||
|
{{- end }}
|
||||||
- name: "REDIS_PASSWORD"
|
- name: "REDIS_PASSWORD"
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|
|
@ -56,6 +56,13 @@ spec:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ template "mastodon.postgresql.secretName" . }}
|
name: {{ template "mastodon.postgresql.secretName" . }}
|
||||||
key: password
|
key: password
|
||||||
|
{{- if .Values.postgresql.readReplica.auth.existingSecret }}
|
||||||
|
- name: "REPLICA_DB_PASS"
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Values.postgresql.readReplica.auth.existingSecret }}
|
||||||
|
key: password
|
||||||
|
{{- end }}
|
||||||
- name: "REDIS_PASSWORD"
|
- name: "REDIS_PASSWORD"
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|
|
@ -79,6 +79,13 @@ spec:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: {{ template "mastodon.postgresql.secretName" . }}
|
name: {{ template "mastodon.postgresql.secretName" . }}
|
||||||
key: password
|
key: password
|
||||||
|
{{- if .Values.postgresql.readReplica.auth.existingSecret }}
|
||||||
|
- name: "REPLICA_DB_PASS"
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Values.postgresql.readReplica.auth.existingSecret}}
|
||||||
|
key: password
|
||||||
|
{{- end }}
|
||||||
- name: "REDIS_PASSWORD"
|
- name: "REDIS_PASSWORD"
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|
13
values.yaml
13
values.yaml
|
@ -362,6 +362,19 @@ postgresql:
|
||||||
# with a key of password set to the password you want
|
# with a key of password set to the password you want
|
||||||
existingSecret: ""
|
existingSecret: ""
|
||||||
|
|
||||||
|
# Options for a read-only replica.
|
||||||
|
# If enabled, mastodon uses existing defaults for postgres for these values as well.
|
||||||
|
# Documentation for more information on this feature:
|
||||||
|
# https://docs.joinmastodon.org/admin/scaling/#read-replicas
|
||||||
|
readReplica:
|
||||||
|
hostname:
|
||||||
|
port:
|
||||||
|
auth:
|
||||||
|
database:
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
existingSecret:
|
||||||
|
|
||||||
# https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters
|
# https://github.com/bitnami/charts/tree/master/bitnami/redis#parameters
|
||||||
redis:
|
redis:
|
||||||
# disable if you want to use an existing redis instance; in which case the
|
# disable if you want to use an existing redis instance; in which case the
|
||||||
|
|
Loading…
Reference in New Issue
Block a user