Skip to content

Commit 1dd4616

Browse files
authored
separating-keys-and-events (#34)
* separating-keys-and-events * remove-unused * set additional routes
1 parent 138a85f commit 1dd4616

15 files changed

Lines changed: 1528 additions & 536 deletions

charts/synapse/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v2
22
appVersion: 1.151.0
33
description: matrix synapse kubernetes deployment
44
name: synapse
5-
version: 2.4.17
5+
version: 2.5.0

charts/synapse/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ app: synapse
66
component: synapse-client-reader
77
{{- end }}
88

9+
{{/*
10+
Selector labels
11+
*/}}
12+
{{- define "synapse-client-keys.selectorLabels" -}}
13+
app: synapse
14+
component: synapse-client-keys
15+
{{- end }}
16+
917
{{/*
1018
Selector labels
1119
*/}}

charts/synapse/templates/envoy-configmap.yaml

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ data:
105105
{{- end }}
106106
107107
{{- if not .Values.matrixAuthentication.enabled }}
108-
{{- range $route := .Values.ingress.clientReaderRegister }}
108+
{{- range $route := .Values.ingress.clientReaderRegisterRoutes }}
109109
- match:
110110
safe_regex:
111111
regex: {{ printf "^%s" $route | squote }}
@@ -116,7 +116,7 @@ data:
116116
{{- end }}
117117
{{- end }}
118118
119-
{{- range $route := .Values.ingress.receipts }}
119+
{{- range $route := .Values.ingress.receiptsRoutes }}
120120
- match:
121121
safe_regex:
122122
regex: {{ printf "^%s" $route | squote }}
@@ -126,7 +126,7 @@ data:
126126
cluster: httpd-receipts
127127
{{- end }}
128128
129-
{{- range $route := .Values.ingress.typing }}
129+
{{- range $route := .Values.ingress.typingRoutes }}
130130
- match:
131131
safe_regex:
132132
regex: {{ printf "^%s" $route | squote }}
@@ -155,7 +155,7 @@ data:
155155
route:
156156
timeout: 300s
157157
auto_host_rewrite: true
158-
cluster: httpd-user-hash
158+
cluster: httpd-sync-user-ring-hash
159159
hash_policy:
160160
- header:
161161
header_name: X-Hash-Key
@@ -165,24 +165,7 @@ data:
165165
name: whoami_hash
166166
{{- end }}
167167
168-
{{- range $route := .Values.ingress.syncKeysRoutes }}
169-
- match:
170-
safe_regex:
171-
regex: {{ printf "^%s" $route | squote }}
172-
route:
173-
timeout: 300s
174-
auto_host_rewrite: true
175-
cluster: httpd-user-hash
176-
hash_policy:
177-
- header:
178-
header_name: X-Hash-Key
179-
typed_per_filter_config:
180-
envoy.filters.http.lua:
181-
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
182-
name: whoami_hash
183-
{{- end }}
184-
185-
{{- range $route := .Values.ingress.mediaRepository }}
168+
{{- range $route := .Values.ingress.mediaRepositoryRoutes }}
186169
- match:
187170
safe_regex:
188171
regex: {{ printf "^%s" $route | squote }}
@@ -192,7 +175,7 @@ data:
192175
cluster: httpd-media-repository
193176
{{- end }}
194177
195-
{{- range $route := .Values.ingress.toDevice }}
178+
{{- range $route := .Values.ingress.toDeviceRoutes }}
196179
- match:
197180
safe_regex:
198181
regex: {{ printf "^%s" $route | squote }}
@@ -202,7 +185,7 @@ data:
202185
cluster: httpd-to-device
203186
{{- end }}
204187
205-
{{- range $route := .Values.ingress.accountData }}
188+
{{- range $route := .Values.ingress.accountDataRoutes }}
206189
- match:
207190
safe_regex:
208191
regex: {{ printf "^%s" $route | squote }}
@@ -232,7 +215,7 @@ data:
232215
cluster: httpd-push-rules
233216
{{- end }}
234217
235-
{{- range $route := .Values.ingress.presence }}
218+
{{- range $route := .Values.ingress.presenceRoutes }}
236219
- match:
237220
safe_regex:
238221
regex: {{ printf "^%s" $route | squote }}
@@ -249,7 +232,7 @@ data:
249232
route:
250233
timeout: 300s
251234
auto_host_rewrite: true
252-
cluster: httpd-room-hash
235+
cluster: httpd-room-ring-hash
253236
hash_policy:
254237
- header:
255238
header_name: X-Hash-Key
@@ -283,7 +266,7 @@ data:
283266
{{- end }}
284267
285268
{{- if .Values.matrixAuthentication.enabled }}
286-
{{- range $route := .Values.ingress.matrixAuthentication }}
269+
{{- range $route := .Values.ingress.matrixAuthenticationRoutes }}
287270
- match:
288271
safe_regex:
289272
regex: {{ printf "^%s" $route | squote }}
@@ -294,24 +277,31 @@ data:
294277
{{- end }}
295278
{{- end }}
296279
297-
{{- range $route := .Values.ingress.clientReaderRoomKeys }}
280+
{{- range $route := .Values.ingress.clientKeysRoutes }}
298281
- match:
299282
safe_regex:
300283
regex: {{ printf "^%s" $route | squote }}
301284
route:
302285
timeout: 300s
303286
auto_host_rewrite: true
304-
cluster: httpd-client-reader
287+
cluster: httpd-client-keys
305288
{{- end }}
306289
307-
{{- range $route := .Values.ingress.clientReaderEventsRoutes }}
290+
{{- range $route := .Values.ingress.clientEventsRoutes }}
308291
- match:
309292
safe_regex:
310293
regex: {{ printf "^%s" $route | squote }}
311294
route:
312295
timeout: 300s
313296
auto_host_rewrite: true
314-
cluster: httpd-client-reader
297+
cluster: httpd-room-ring-hash
298+
hash_policy:
299+
- header:
300+
header_name: X-Hash-Key
301+
typed_per_filter_config:
302+
envoy.filters.http.lua:
303+
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.LuaPerRoute
304+
name: room_hash
315305
{{- end }}
316306
317307
{{- range $route := .Values.ingress.clientReaderRoutes }}
@@ -443,6 +433,39 @@ data:
443433
socket_address:
444434
address: synapse-client-reader-headless
445435
port_value: 8008
436+
- name: httpd-client-keys
437+
connect_timeout: 1.00s
438+
type: STRICT_DNS
439+
dns_lookup_family: V4_ONLY
440+
ignore_health_on_host_removal: true
441+
lb_policy: LEAST_REQUEST
442+
least_request_lb_config:
443+
choice_count: 2
444+
outlier_detection:
445+
consecutive_5xx: 5
446+
consecutive_gateway_failure: 5
447+
interval: 10s
448+
base_ejection_time: 30s
449+
max_ejection_percent: 50
450+
circuit_breakers:
451+
thresholds:
452+
- priority: DEFAULT
453+
max_connections: 30000
454+
max_requests: 8192
455+
max_retries: 3
456+
- priority: HIGH
457+
max_connections: 30000
458+
max_requests: 8192
459+
max_retries: 3
460+
load_assignment:
461+
cluster_name: httpd-client-keys
462+
endpoints:
463+
- lb_endpoints:
464+
- endpoint:
465+
address:
466+
socket_address:
467+
address: synapse-client-keys-headless
468+
port_value: 8008
446469
- name: httpd-federation-ip-hash
447470
connect_timeout: 1.00s
448471
type: STRICT_DNS
@@ -468,7 +491,7 @@ data:
468491
socket_address:
469492
address: synapse-federation-reader-headless
470493
port_value: 8008
471-
- name: httpd-room-hash
494+
- name: httpd-room-ring-hash
472495
connect_timeout: 1.00s
473496
type: STRICT_DNS
474497
dns_lookup_family: V4_ONLY
@@ -485,15 +508,15 @@ data:
485508
max_requests: 8192
486509
max_retries: 3
487510
load_assignment:
488-
cluster_name: httpd-room-hash
511+
cluster_name: httpd-room-ring-hash
489512
endpoints:
490513
- lb_endpoints:
491514
- endpoint:
492515
address:
493516
socket_address:
494517
address: synapse-room-headless
495518
port_value: 8008
496-
- name: httpd-user-hash
519+
- name: httpd-sync-user-ring-hash
497520
connect_timeout: 1.00s
498521
type: STRICT_DNS
499522
dns_lookup_family: V4_ONLY
@@ -510,7 +533,7 @@ data:
510533
max_requests: 8192
511534
max_retries: 3
512535
load_assignment:
513-
cluster_name: httpd-user-hash
536+
cluster_name: httpd-sync-user-ring-hash
514537
endpoints:
515538
- lb_endpoints:
516539
- endpoint:

charts/synapse/templates/synapse-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{- $streamWritersLocks := list "account_data"}}
77
{{- $streamWriters := list "master" "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" }}
88
{{- $replicationWorkers := list "master" "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "federation_sender" }}
9-
{{- $clientOnlyWorkers := list "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "sync" "client_reader" "user_dir" }}
9+
{{- $clientOnlyWorkers := list "typing" "to_device" "account_data" "presence" "push_rules" "receipts" "device_lists" "thread_subscriptions" "quarantined_media" "event_persister" "sync" "client_reader" "client_keys" "user_dir" }}
1010

1111
{{- $registration_shared_secret := .Values.registration_shared_secret }}
1212
{{- $form_secret := .Values.form_secret }}

charts/synapse/templates/synapse-service.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ spec:
4545
---
4646
apiVersion: v1
4747
kind: Service
48+
metadata:
49+
name: synapse-client-keys-headless
50+
{{- with $.Values.synapse.service.annotations }}
51+
annotations:
52+
{{- toYaml . | nindent 4 }}
53+
{{- end }}
54+
labels:
55+
{{- include "synapse-client-keys.selectorLabels" . | nindent 4 }}
56+
spec:
57+
clusterIP: None
58+
type: ClusterIP
59+
ports:
60+
- name: http
61+
port: 8008
62+
targetPort: 8008
63+
selector:
64+
{{- include "synapse-client-keys.selectorLabels" . | nindent 6 }}
65+
---
66+
apiVersion: v1
67+
kind: Service
4868
metadata:
4969
name: synapse-room-headless
5070
{{- with $.Values.synapse.service.annotations }}

0 commit comments

Comments
 (0)