From aefb0cfae29285c4876c57b3cff3ceb833396866 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Tue, 18 Jul 2023 18:05:09 +0200 Subject: [PATCH] matrix-synapse: Update to 1.88.0 This update is going to be the first part of a larger change to how the use of workers affects the shared configuration, more changes to the handling of stream writers and federation senders will be coming soon as well. Fixes #26 --- charts/matrix-synapse/Chart.yaml | 4 ++-- .../templates/configuration.yaml | 18 ++++++++++++++-- charts/matrix-synapse/templates/service.yaml | 6 ++++++ .../templates/worker-configuration.yaml | 21 ++++++++++++++----- .../templates/worker-deployment.yaml | 5 +++++ charts/matrix-synapse/values.yaml | 2 ++ 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/charts/matrix-synapse/Chart.yaml b/charts/matrix-synapse/Chart.yaml index 065db20..9762775 100644 --- a/charts/matrix-synapse/Chart.yaml +++ b/charts/matrix-synapse/Chart.yaml @@ -3,10 +3,10 @@ apiVersion: v2 name: matrix-synapse description: Matrix reference homeserver icon: https://matrix.org/images/matrix-logo.svg -appVersion: 1.87.0 +appVersion: 1.88.0 type: application -version: 3.5.0 +version: 3.6.0 maintainers: - name: Alexander Olofsson email: ace@haxalot.com diff --git a/charts/matrix-synapse/templates/configuration.yaml b/charts/matrix-synapse/templates/configuration.yaml index 2afb12d..7a63525 100644 --- a/charts/matrix-synapse/templates/configuration.yaml +++ b/charts/matrix-synapse/templates/configuration.yaml @@ -49,6 +49,20 @@ data: log_config: "/synapse/config/log.yaml" report_stats: {{ required "You need to specify config.reportStats" .Values.config.reportStats }} + instance_map: + main: + host: {{ include "matrix-synapse.replicationname" . }} + port: 9093 + {{- $default := .Values.workers.default }} + {{- range $worker, $config := .Values.workers }} + {{- if and $config.enabled $config.name $config.listeners (has "replication" $config.listeners) }} + {{- $name := $worker | replace "_" "-" }} + {{ $config.name | quote }}: + host: {{ include "matrix-synapse.workername" (dict "global" $ "worker" $name) | quote }} + port: 9093 + {{- end }} + {{- end }} + ## Ports ## listeners: @@ -133,7 +147,7 @@ data: {{- else if or (eq $worker "appservice") (eq ($config.app | default "") "appservice") }} # For appservice worker - notify_appservices: false + notify_appservices_from_worker: {{ $config.name | quote }} {{- else if or (eq $worker "federation_sender") (eq ($config.app | default "") "federation_sender") }} # For federation_sender worker @@ -145,7 +159,7 @@ data: {{- else if or (eq $worker "user_dir") (eq ($config.app | default "") "user_dir") }} # For user_dir worker - update_user_directory: false + update_user_directory_from_worker: {{ $config.name | quote }} {{- end }} {{- end }} {{- end }} diff --git a/charts/matrix-synapse/templates/service.yaml b/charts/matrix-synapse/templates/service.yaml index 42c3785..b0e3839 100644 --- a/charts/matrix-synapse/templates/service.yaml +++ b/charts/matrix-synapse/templates/service.yaml @@ -51,6 +51,12 @@ spec: targetPort: listener protocol: TCP name: listener + {{- if has "replication" $config.listeners }} + - port: 9093 + targetPort: replication + protocol: TCP + name: replication + {{- end }} selector: {{- include "matrix-synapse.selectorLabels" $ | nindent 4 }} app.kubernetes.io/component: {{ $name }} diff --git a/charts/matrix-synapse/templates/worker-configuration.yaml b/charts/matrix-synapse/templates/worker-configuration.yaml index 50a1e38..c9d134c 100644 --- a/charts/matrix-synapse/templates/worker-configuration.yaml +++ b/charts/matrix-synapse/templates/worker-configuration.yaml @@ -30,10 +30,6 @@ data: worker_name: {{ $config.name }} {{- end }} - worker_main_http_uri: http://{{ include "matrix-synapse.fullname" $ }}:{{ $.Values.service.port }} - worker_replication_host: {{ include "matrix-synapse.replicationname" $ | quote }} - worker_replication_http_port: 9093 - worker_listeners: - port: 9090 tls: false @@ -44,6 +40,21 @@ data: - names: [metrics] compress: false {{- if $config.listeners }} + {{- if has "replication" $config.listeners }} + {{- if not $config.name }} + {{- fail "Workers with replication listeners must have unique names." }} + {{- end }} + + - port: 9093 + tls: false + bind_addresses: ['::'] + type: http + x_forwarded: true + + resources: + - names: [replication] + compress: false + {{- end }} - port: 8083 tls: false @@ -53,7 +64,7 @@ data: resources: - names: - {{- toYaml $config.listeners | nindent 14 }} + {{- toYaml (without $config.listeners "replication") | nindent 14 }} compress: false {{- end }} diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index 3fc98bc..fa91947 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -123,6 +123,11 @@ spec: - name: listener containerPort: 8083 protocol: TCP + {{- if has "replication" $config.listeners }} + - name: replication + containerPort: 9093 + protocol: TCP + {{- end }} {{- if (or $config.readinessProbe $default.readinessProbe) }} readinessProbe: {{- $config.readinessProbe | default $default.readinessProbe | toYaml | nindent 12 }} diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index 0352345..0e6e76a 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -553,6 +553,7 @@ workers: ## appservice: enabled: false + name: appservices ## This worker handles sending federation traffic to other Synapse servers. ## @@ -587,6 +588,7 @@ workers: ## user_dir: enabled: false + name: userdir listeners: [client] csPaths: - "/_matrix/client/(api/v1|r0|v3|unstable)/user_directory/search$"