diff --git a/charts/matrix-synapse/templates/_helpers.tpl b/charts/matrix-synapse/templates/_helpers.tpl index 9b3ebdc..57290e5 100644 --- a/charts/matrix-synapse/templates/_helpers.tpl +++ b/charts/matrix-synapse/templates/_helpers.tpl @@ -270,3 +270,14 @@ Set redis password {{ .Values.externalRedis.password }} {{- end -}} {{- end -}} + +{{/* +Set redis database id +*/}} +{{- define "matrix-synapse.redis.dbid" -}} +{{- if .Values.redis.dbid -}} +{{ .Values.redis.dbid }} +{{- else if .Values.externalRedis.dbid -}} +{{ .Values.externalRedis.dbid }} +{{- end -}} +{{- end -}} diff --git a/charts/matrix-synapse/templates/secrets.yaml b/charts/matrix-synapse/templates/secrets.yaml index d818295..c8c3ec3 100644 --- a/charts/matrix-synapse/templates/secrets.yaml +++ b/charts/matrix-synapse/templates/secrets.yaml @@ -60,21 +60,25 @@ stringData: {{- $redisHost := include "matrix-synapse.redis.host" . }} {{- $redisPort := include "matrix-synapse.redis.port" . }} {{- $redisPass := include "matrix-synapse.redis.password" . }} +{{- $redisDbid := include "matrix-synapse.redis.dbid" . }} ## Redis configuration ## redis: enabled: true host: {{ $redisHost | quote }} +{{- if $redisPort }} + port: {{ $redisPort }} +{{- end }} {{- if or .Values.redis.auth.enabled .Values.redis.usePassword .Values.redis.password .Values.redis.auth.password .Values.externalRedis.password }} {{- if and $redisPass (not .Values.redis.existingSecret) }} password: {{ $redisPass | quote }} {{- else }} password: "@@REDIS_PASSWORD@@" {{- end }} - {{- if $redisPort }} - port: {{ $redisPort }} - {{- end }} +{{- end }} +{{- if $redisDbid }} + dbid: {{ $redisDbid }} {{- end }} {{- with .Values.extraSecrets }} diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index ac505e4..70dddfb 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -732,6 +732,9 @@ externalPostgresql: redis: enabled: true + ## Database ID for non-default database + # dbid: 0 + auth: enabled: true # XXX Change me! @@ -760,6 +763,9 @@ externalRedis: port: 6379 # password: synapse + ## Database ID for non-default database + # dbid: 0 + ## The name of an existing secret with redis credentials #existingSecret: redis-secrets