1- {{- $workers := merge (deepCopy .Values.synapse.autoscalingWorkers) (deepCopy .Values.synapse.deployScalingWorkers) (deepCopy .Values.synapse.singletonWorkers) -}}
1+ {{- $workers := merge (deepCopy .Values.synapse.autoscalingWorkers) (deepCopy .Values.synapse.deployScalingWorkers) (deepCopy .Values.synapse.singletonWorkers) }}
2+ {{- $mediaWorkers := list "media_repository" "media_repository_background_jobs" }}
3+ {{- $fedOnlyWorkers := list "federation_reader" "federation_sender" }}
4+ {{- $clientFedWorkers := list "master" "room" }}
5+ {{- $noHttpWorkers := list "background_worker" "pusher" }}
6+ {{- $streamWriters := list "master" "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" }}
7+ {{- $replicationWorkers := list "master" "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "federation_sender" }}
8+ {{- $clientOnlyWorkers := list "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "sync" "client_reader" "user_dir" }}
29
3- {{- $registration_shared_secret := .Values.registration_shared_secret - }}
4- {{- $form_secret := .Values.form_secret - }}
5- {{- $macaroon_secret_key := .Values.macaroon_secret_key - }}
6- {{- $media_storage_providers := .Values.media_storage_providers - }}
7- {{- $turn_uris := .Values.turn_uris - }}
8- {{- $password_providers := .Values.password_providers - }}
9- {{- $oidc_providers := .Values.oidc_providers - }}
10- {{- $signing_key := .Values.signing_key - }}
10+ {{- $registration_shared_secret := .Values.registration_shared_secret }}
11+ {{- $form_secret := .Values.form_secret }}
12+ {{- $macaroon_secret_key := .Values.macaroon_secret_key }}
13+ {{- $media_storage_providers := .Values.media_storage_providers }}
14+ {{- $turn_uris := .Values.turn_uris }}
15+ {{- $password_providers := .Values.password_providers }}
16+ {{- $oidc_providers := .Values.oidc_providers }}
17+ {{- $signing_key := .Values.signing_key }}
1118{{- $federation_domain_whitelist := .Values.federation_domain_whitelist }}
1219{{- $federation_metrics_domains := .Values.federation_metrics_domains }}
1320{{- $idp_metadata := .Values.idp_metadata | default "" }}
1421{{- $password_enabled := .Values.password_enabled }}
15- {{- $rc_message := .Values.rc_message - }}
22+ {{- $rc_message := .Values.rc_message }}
1623
1724{{- range $worker, $options := $workers }}
1825{{ $name := $worker | replace "_" "-"}}
@@ -35,7 +42,7 @@ stringData:
3542 ---
3643 server_name: {{ $.Values.synapse.serverName }}
3744 {{- if ne $worker "master" }}
38- {{- if has $worker (list "media_repository" "media_repository_background_jobs") }}
45+ {{- if has $worker $mediaWorkers }}
3946 worker_app: synapse.app.media_repository
4047 {{- else }}
4148 worker_app: synapse.app.generic_worker
@@ -66,7 +73,11 @@ stringData:
6673 cp_max: {{ $.Values.synapse.postgres.cp_max }}
6774 cp_min: {{ $.Values.synapse.postgres.cp_min }}
6875 database: {{ $.Values.synapse.postgres.dbname }}
76+ {{- if and $.Values.synapse.disablePgBouncerForStreamWriters (has $worker $streamWriters) }}
77+ host: {{ $.Values.synapse.postgres.host }}
78+ {{- else }}
6979 host: synapse-pgbouncer
80+ {{- end }}
7081 password: {{ $.Values.synapse.postgres.password }}
7182 user: {{ $.Values.synapse.postgres.user }}
7283 name: psycopg2
@@ -98,30 +109,30 @@ stringData:
98109 resources:
99110 - names: [metrics]
100111 compress: false
101- {{- if not (has $worker (list "background_worker" "pusher") ) }}
112+ {{- if not (has $worker $noHttpWorkers ) }}
102113 - port: 8008
103114 tls: false
104115 type: http
105116 x_forwarded: true
106117 bind_addresses: ['0.0.0.0']
107118 resources:
108- {{- if has $worker (list "master" "room") }}
119+ {{- if has $worker $clientFedWorkers }}
109120 - names: [client, federation]
110121 compress: true
111122 {{- end }}
112- {{- if has $worker (list "federation_reader" "federation_sender") }}
123+ {{- if has $worker $fedOnlyWorkers }}
113124 - names: [federation]
114125 compress: true
115126 {{- end }}
116- {{- if has $worker (list "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "sync" "client_reader" "user_dir") }}
127+ {{- if has $worker $clientOnlyWorkers }}
117128 - names: [client]
118129 compress: true
119130 {{- end }}
120- {{- if has $worker (list "media_repository" "media_repository_background_jobs") }}
131+ {{- if has $worker $mediaWorkers }}
121132 - names: [media]
122133 compress: false
123134 {{- end }}
124- {{- if has $worker (list "master" "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "federation_sender") }}
135+ {{- if has $worker $replicationWorkers }}
125136 - port: 9093
126137 tls: false
127138 type: http
@@ -223,7 +234,7 @@ stringData:
223234 run_background_tasks_on: synapse-background-worker-0
224235 log_config: /data/log.config
225236 macaroon_secret_key: "{{ $macaroon_secret_key }}"
226- {{- if has $worker (list "media_repository" "media_repository_background_jobs") }}
237+ {{- if has $worker $mediaWorkers }}
227238 enable_media_repo: true
228239 media_storage_providers: {{ toYaml $media_storage_providers | nindent 6 }}
229240 {{- else }}
@@ -233,11 +244,11 @@ stringData:
233244 media_store_path: /tmp/media_store
234245 enable_local_media_storage: true
235246 metrics_flags: ~
236- oidc_providers: {{ $oidc_providers | toYaml | nindent 6 }}
247+ oidc_providers: {{ toYaml $oidc_providers | nindent 6 }}
237248 old_signing_keys: ~
238249 password_config:
239250 enabled: {{ $password_enabled }}
240- password_providers: {{- $password_providers | toYaml | nindent 6 }}
251+ password_providers: {{ toYaml $password_providers | nindent 6 }}
241252 pid_file: /tmp/homeserver.pid
242253 push: ~
243254 start_pushers: False
0 commit comments