matrix-synapse: Add support for extra postgresql args
Allows passing extra arguments to the pqlib library upon connection, for instance to set keepalive settings, as documented in: https://github.com/matrix-org/synapse/blob/develop/docs/postgres.md#synapse-config
This commit is contained in:
parent
c7aa912f0c
commit
53c2003cc5
4 changed files with 52 additions and 1 deletions
|
@ -6,7 +6,7 @@ icon: https://matrix.org/images/matrix-logo.svg
|
||||||
appVersion: 1.38.1
|
appVersion: 1.38.1
|
||||||
|
|
||||||
type: application
|
type: application
|
||||||
version: 2.1.4
|
version: 2.1.5
|
||||||
maintainers:
|
maintainers:
|
||||||
- name: Alexander Olofsson
|
- name: Alexander Olofsson
|
||||||
email: ace@haxalot.com
|
email: ace@haxalot.com
|
||||||
|
|
|
@ -197,6 +197,25 @@ Set postgresql sslmode
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Set postgresql extra args
|
||||||
|
Refer to https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
|
||||||
|
for a list of options that can be passed.
|
||||||
|
*/}}
|
||||||
|
{{- define "matrix-synapse.postgresql.extraArgs" -}}
|
||||||
|
{{- if .Values.postgresql.enabled -}}
|
||||||
|
{{- with .Values.postgresql.extraArgs }}
|
||||||
|
{{- . | toYaml }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else -}}
|
||||||
|
{{- with .Values.externalPostgresql.extraArgs }}
|
||||||
|
{{- . | toYaml }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Set redis host
|
Set redis host
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -36,6 +36,7 @@ stringData:
|
||||||
{{- $postgresPort := include "matrix-synapse.postgresql.port" . }}
|
{{- $postgresPort := include "matrix-synapse.postgresql.port" . }}
|
||||||
{{- $postgresPass := include "matrix-synapse.postgresql.password" . }}
|
{{- $postgresPass := include "matrix-synapse.postgresql.password" . }}
|
||||||
{{- $postgresSSLMode := include "matrix-synapse.postgresql.sslmode" . }}
|
{{- $postgresSSLMode := include "matrix-synapse.postgresql.sslmode" . }}
|
||||||
|
{{- $postgresExtraArgs := include "matrix-synapse.postgresql.extraArgs" . }}
|
||||||
|
|
||||||
## Database configuration ##
|
## Database configuration ##
|
||||||
|
|
||||||
|
@ -54,6 +55,7 @@ stringData:
|
||||||
sslmode: {{ $postgresSSLMode | quote }}
|
sslmode: {{ $postgresSSLMode | quote }}
|
||||||
cp_min: 5
|
cp_min: 5
|
||||||
cp_max: 10
|
cp_max: 10
|
||||||
|
{{- $postgresExtraArgs | nindent 8 }}
|
||||||
|
|
||||||
{{- $redisHost := include "matrix-synapse.redis.host" . }}
|
{{- $redisHost := include "matrix-synapse.redis.host" . }}
|
||||||
{{- $redisPort := include "matrix-synapse.redis.port" . }}
|
{{- $redisPort := include "matrix-synapse.redis.port" . }}
|
||||||
|
|
|
@ -597,6 +597,21 @@ postgresql:
|
||||||
# storageClass: "-"
|
# storageClass: "-"
|
||||||
size: 16Gi
|
size: 16Gi
|
||||||
|
|
||||||
|
## Extra arguments for the database connection
|
||||||
|
## ref: https://github.com/matrix-org/synapse/blob/develop/docs/postgres.md#synapse-config
|
||||||
|
##
|
||||||
|
extraArgs: {}
|
||||||
|
# # seconds of inactivity after which TCP should send a keepalive message to the server
|
||||||
|
# keepalives_idle: 10
|
||||||
|
#
|
||||||
|
# # the number of seconds after which a TCP keepalive message that is not
|
||||||
|
# # acknowledged by the server should be retransmitted
|
||||||
|
# keepalives_interval: 10
|
||||||
|
#
|
||||||
|
# # the number of TCP keepalives that can be lost before the client's connection
|
||||||
|
# # to the server is considered dead
|
||||||
|
# keepalives_count: 3
|
||||||
|
|
||||||
## An externally configured Postgres server to use for Synapse's database, note
|
## An externally configured Postgres server to use for Synapse's database, note
|
||||||
## that the database needs to have both COLLATE and CTYPE set to "C".
|
## that the database needs to have both COLLATE and CTYPE set to "C".
|
||||||
##
|
##
|
||||||
|
@ -608,6 +623,21 @@ externalPostgresql:
|
||||||
database: synapse
|
database: synapse
|
||||||
# sslmode: prefer
|
# sslmode: prefer
|
||||||
|
|
||||||
|
## Extra arguments for the database connection
|
||||||
|
## ref: https://github.com/matrix-org/synapse/blob/develop/docs/postgres.md#synapse-config
|
||||||
|
##
|
||||||
|
extraArgs: {}
|
||||||
|
# # seconds of inactivity after which TCP should send a keepalive message to the server
|
||||||
|
# keepalives_idle: 10
|
||||||
|
#
|
||||||
|
# # the number of seconds after which a TCP keepalive message that is not
|
||||||
|
# # acknowledged by the server should be retransmitted
|
||||||
|
# keepalives_interval: 10
|
||||||
|
#
|
||||||
|
# # the number of TCP keepalives that can be lost before the client's connection
|
||||||
|
# # to the server is considered dead
|
||||||
|
# keepalives_count: 3
|
||||||
|
|
||||||
## This configuration is for the internal Redis that's deployed for use with
|
## This configuration is for the internal Redis that's deployed for use with
|
||||||
## workers/sharding, for an external Redis server you want to set enabled to
|
## workers/sharding, for an external Redis server you want to set enabled to
|
||||||
## false and configure the externalRedis block.
|
## false and configure the externalRedis block.
|
||||||
|
|
Loading…
Reference in a new issue