diff --git a/rocketchat/README.md b/rocketchat/README.md index 7205904..d8d3390 100644 --- a/rocketchat/README.md +++ b/rocketchat/README.md @@ -122,6 +122,7 @@ The following table lists the configurable parameters of the Rocket.Chat chart a | `global.affinity` | common affinity for all pods (rocket.chat and all microservices) | {} | | `tolerations` | tolerations for main rocket.chat pods (the `meteor` service) | [] | | `microservices.enabled` | Use [microservices](https://docs.rocket.chat/quick-start/installing-and-updating/micro-services-setup-beta) architecture | `false` | +| `microservices.streamHub.enabled` | Enable the Stream Hub microservice. **DEPRECATED**: Disabled by default for versions >= 7.7.3. For versions < 7.7.3, enabled by default unless explicitly disabled. Will be removed completely in version 8.0.0. When enabled, automatically sets `DB_WATCHERS=true` on all services. | `false` (auto-enabled for < 7.7.3) | | `microservices.presence.replicas` | Number of replicas to run for the presence service | `1` | | `microservices.ddpStreamer.replicas` | Number of replicas to run for the ddpStreamer service | `1` | | `microservices.account.replicas` | Number of replicas to run for the account service | `1` | @@ -217,6 +218,27 @@ nats: key: "nats-url" ``` +### Stream Hub Microservice Deprecation + +> **IMPORTANT**: As of Rocket.Chat version 7.7.3, the Stream Hub microservice is deprecated and disabled by default. + +The Stream Hub microservice (`microservices.streamHub`) is being phased out: + +- **Versions < 7.7.3**: Stream Hub is automatically enabled when using microservices architecture (unless explicitly disabled) +- **Versions >= 7.7.3**: Stream Hub is disabled by default and should not be used for new deployments +- **Version 8.0.0+**: Stream Hub will be removed completely + +If you need to enable Stream Hub for older versions or backward compatibility, set: + +```yaml +microservices: + enabled: true + streamHub: + enabled: true +``` + +**Note**: When Stream Hub is enabled, the `DB_WATCHERS=true` environment variable is automatically set on all Rocket.Chat services to support database change stream watching. + ### Database Setup Rocket.Chat uses a MongoDB instance to presist its data. diff --git a/rocketchat/templates/_helpers.tpl b/rocketchat/templates/_helpers.tpl index 3d8727b..4caa509 100644 --- a/rocketchat/templates/_helpers.tpl +++ b/rocketchat/templates/_helpers.tpl @@ -203,3 +203,24 @@ One of the following must be true to set the TRANSPORTER environment variable: {{- end -}} {{- end -}} {{/* End if Nats enabled */}} {{- end -}} {{/* rocketchat.transporter.connectionString */}} + +{{/* +Check if streamHub should be enabled. +Logic: +1. If explicitly set (.Values.microservices.streamHub.enabled), use that value +2. For versions < 7.7.3, enable by default +3. For versions >= 7.7.3, disable by default +*/}} +{{- define "rocketchat.streamHub.enabled" -}} +{{- $version := .Values.image.tag | default .Chart.AppVersion -}} +{{- $explicitlySet := hasKey .Values.microservices.streamHub "enabled" -}} +{{- if $explicitlySet -}} +{{- .Values.microservices.streamHub.enabled -}} +{{- else -}} +{{- if semverCompare "<7.7.3" $version -}} +{{- print "true" -}} +{{- else -}} +{{- print "false" -}} +{{- end -}} +{{- end -}} +{{- end -}} diff --git a/rocketchat/templates/chat-deployment.yaml b/rocketchat/templates/chat-deployment.yaml index d3fe60e..d762067 100644 --- a/rocketchat/templates/chat-deployment.yaml +++ b/rocketchat/templates/chat-deployment.yaml @@ -134,6 +134,10 @@ spec: # Environment variables for microservices option {{- include "rocketchat.transporter.connectionString" (dict "Values" $.Values "Release" $.Release) | nindent 8 }} {{- if .Values.microservices.enabled }} + {{- if eq (include "rocketchat.streamHub.enabled" .) "true" }} + - name: DB_WATCHERS + value: "true" + {{- end }} - name: MOLECULER_LOG_LEVEL value: {{ .Values.microservices.logLevel | quote }} - name: HEARTBEAT_INTERVAL diff --git a/rocketchat/templates/microservices-account-deployment.yaml b/rocketchat/templates/microservices-account-deployment.yaml index d8e448f..14e19e8 100644 --- a/rocketchat/templates/microservices-account-deployment.yaml +++ b/rocketchat/templates/microservices-account-deployment.yaml @@ -61,6 +61,10 @@ spec: key: mongo-uri {{- end }} {{- include "rocketchat.transporter.connectionString" (dict "Values" $.Values "Release" $.Release) | nindent 8 }} + {{- if eq (include "rocketchat.streamHub.enabled" .) "true" }} + - name: DB_WATCHERS + value: "true" + {{- end }} - name: MOLECULER_LOG_LEVEL value: {{ .Values.microservices.logLevel | quote }} - name: HEARTBEAT_INTERVAL diff --git a/rocketchat/templates/microservices-authorization-deployment.yaml b/rocketchat/templates/microservices-authorization-deployment.yaml index 4608e01..e89cd95 100644 --- a/rocketchat/templates/microservices-authorization-deployment.yaml +++ b/rocketchat/templates/microservices-authorization-deployment.yaml @@ -63,6 +63,10 @@ spec: key: mongo-uri {{- end }} {{- include "rocketchat.transporter.connectionString" (dict "Values" $.Values "Release" $.Release) | nindent 8 }} + {{- if eq (include "rocketchat.streamHub.enabled" .) "true" }} + - name: DB_WATCHERS + value: "true" + {{- end }} - name: MOLECULER_LOG_LEVEL value: {{ .Values.microservices.logLevel | quote }} - name: HEARTBEAT_INTERVAL diff --git a/rocketchat/templates/microservices-ddp-streamer-deployment.yaml b/rocketchat/templates/microservices-ddp-streamer-deployment.yaml index b044665..08891b9 100644 --- a/rocketchat/templates/microservices-ddp-streamer-deployment.yaml +++ b/rocketchat/templates/microservices-ddp-streamer-deployment.yaml @@ -61,6 +61,10 @@ spec: key: mongo-uri {{- end }} {{- include "rocketchat.transporter.connectionString" (dict "Values" $.Values "Release" $.Release) | nindent 8 }} + {{- if eq (include "rocketchat.streamHub.enabled" .) "true" }} + - name: DB_WATCHERS + value: "true" + {{- end }} - name: MOLECULER_LOG_LEVEL value: {{ .Values.microservices.logLevel | quote }} - name: PORT diff --git a/rocketchat/templates/microservices-presence-deployment.yaml b/rocketchat/templates/microservices-presence-deployment.yaml index 933fb1a..9145539 100644 --- a/rocketchat/templates/microservices-presence-deployment.yaml +++ b/rocketchat/templates/microservices-presence-deployment.yaml @@ -62,6 +62,10 @@ spec: key: mongo-uri {{- end }} {{- include "rocketchat.transporter.connectionString" (dict "Values" $.Values "Release" $.Release) | nindent 8 }} + {{- if eq (include "rocketchat.streamHub.enabled" .) "true" }} + - name: DB_WATCHERS + value: "true" + {{- end }} - name: MOLECULER_LOG_LEVEL value: {{ .Values.microservices.logLevel | quote }} - name: HEARTBEAT_INTERVAL diff --git a/rocketchat/templates/microservices-stream-hub-deployment.yaml b/rocketchat/templates/microservices-stream-hub-deployment.yaml index 498a1fe..de05a94 100644 --- a/rocketchat/templates/microservices-stream-hub-deployment.yaml +++ b/rocketchat/templates/microservices-stream-hub-deployment.yaml @@ -1,4 +1,4 @@ -{{- if .Values.microservices.enabled }} +{{- if and .Values.microservices.enabled (eq (include "rocketchat.streamHub.enabled" .) "true") }} apiVersion: apps/v1 kind: Deployment metadata: @@ -72,6 +72,8 @@ spec: key: mongo-oplog-uri {{- end }} {{- include "rocketchat.transporter.connectionString" (dict "Values" $.Values "Release" $.Release) | nindent 8 }} + - name: DB_WATCHERS + value: "true" - name: MOLECULER_LOG_LEVEL value: {{ .Values.microservices.logLevel | quote }} - name: HEARTBEAT_INTERVAL diff --git a/rocketchat/templates/microservices-stream-hub-service.yaml b/rocketchat/templates/microservices-stream-hub-service.yaml index 77df695..b087268 100644 --- a/rocketchat/templates/microservices-stream-hub-service.yaml +++ b/rocketchat/templates/microservices-stream-hub-service.yaml @@ -1,4 +1,4 @@ -{{- if .Values.microservices.enabled }} +{{- if and .Values.microservices.enabled (eq (include "rocketchat.streamHub.enabled" .) "true") }} {{- if .Values.prometheusScraping.enabled }} {{- $service := .Values.service -}} apiVersion: v1 diff --git a/rocketchat/values.yaml b/rocketchat/values.yaml index 3f17172..760caba 100644 --- a/rocketchat/values.yaml +++ b/rocketchat/values.yaml @@ -389,6 +389,11 @@ microservices: tolerations: [] streamHub: + # IMPORTANT: Stream Hub is disabled by default as of Rocket.Chat 7.7.3 + # For versions < 7.7.3, it will be automatically enabled unless explicitly disabled here + # After version 8.0.0, this service will be removed completely + # Note: When enabled, DB_WATCHERS=true is automatically set on all services + enabled: false image: repository: rocketchat/stream-hub-service pullPolicy: IfNotPresent