diff --git a/charts/matrix-synapse/templates/configuration.yaml b/charts/matrix-synapse/templates/configuration.yaml index 34a7e9a..99da0bb 100644 --- a/charts/matrix-synapse/templates/configuration.yaml +++ b/charts/matrix-synapse/templates/configuration.yaml @@ -113,23 +113,23 @@ data: {{- $default := .Values.workers.default }} {{- range $worker, $config := .Values.workers }} {{- if $config.enabled }} - {{- if eq $worker "pusher" }} + {{- if or (eq $worker "pusher") (eq $config.app "pusher") }} # For pusher worker start_pushers: false - {{- else if eq $worker "appservice" }} + {{- else if or (eq $worker "appservice") (eq $config.app "appservice") }} # For appservice worker notify_appservices: false - {{- else if eq $worker "federation_sender" }} + {{- else if or (eq $worker "federation_sender") (eq $config.app "federation_sender") }} # For federation_sender worker send_federation: false - {{- else if eq $worker "media_repository" }} + {{- else if or (eq $worker "media_repository") (eq $config.app "media_repository") }} # For media_repository worker enable_media_repo: false - {{- else if eq $worker "user_dir" }} + {{- else if or (eq $worker "user_dir") (eq $config.app "user_dir") }} # For user_dir worker update_user_directory: false diff --git a/charts/matrix-synapse/templates/worker-configuration.yaml b/charts/matrix-synapse/templates/worker-configuration.yaml index c3dc485..50a1e38 100644 --- a/charts/matrix-synapse/templates/worker-configuration.yaml +++ b/charts/matrix-synapse/templates/worker-configuration.yaml @@ -19,9 +19,10 @@ data: {{- range $worker, $config := .Values.workers -}} {{- if $config.enabled -}} {{- $name := $worker | replace "_" "-" }} + {{- $app := $config.app | default $worker }} {{ $name }}.worker: | - worker_app: "synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $worker }}" + worker_app: "synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $app }}" {{- if $config.name -}} {{- if (gt ($config.replicaCount | int) 1) -}} {{- fail "Replica count must be 1 if a worker has a unique name." -}} diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index d701239..5389ede 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -3,6 +3,7 @@ {{- range $worker, $config := .Values.workers }} {{- if $config.enabled }} {{- $name := $worker | replace "_" "-" }} +{{- $app := $config.app | default $worker }} --- apiVersion: apps/v1 kind: Deployment @@ -78,7 +79,7 @@ spec: {{- end }} {{- end }} - exec python -B -m synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $worker }} \ + exec python -B -m synapse.app.{{ (not (not $config.generic)) | ternary "generic_worker" $app }} \ -c /synapse/config/homeserver.yaml \ -c /synapse/config/conf.d/ \ -c /synapse/config/{{ $name }}.worker diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index 8dbb963..df163dd 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -529,6 +529,13 @@ workers: federation_sender: enabled: false + ## Specialized workers can also be run as multiple separate instances, + ## make sure to read the relevant documentation. + ## + # federation_sender_other: + # app: federation_sender + # enabled: false + ## This worker deals with serving and storing media. ## NB; Running multiple instances will conflict with background jobs. ##