tbmq-cluster

by Thingsboard

Helm chartv2.3.2App 2.4.2Apache-2.0Verified publisher

Helm chart for TBMQ cluster (Community and Professional Editions).

About this chart

Helm Chart for TBMQ Cluster

TBMQ is a high-performance MQTT message broker capable of handling 4M+ concurrent client connections, delivering 3M+ messages per second per single cluster node with low latency. In cluster mode, TBMQ scales to 100M+ concurrently connected clients.

This chart deploys a TBMQ cluster on Kubernetes. The same chart supports both editions of TBMQ:

  • Community Edition (CE) — open-source, default images.
  • Professional Edition (PE) — commercial edition with additional features. Enabled by switching the broker and integration-executor images to the PE variants in your values.yaml and supplying a license. All templates, configuration keys, and operational behavior are identical between editions. See Professional Edition (PE) under "Installing" for the exact edits.

Documentation & Resources:

Trademarks: This software listing is packaged by the TBMQ Team. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.

Architecture

The chart deploys only TBMQ application components:

  • tbmq-node — broker StatefulSet (default 2 replicas). Exposes MQTT (1883), MQTTS (8883), MQTT-WS (8084), MQTT-WSS (8085), and an HTTP management API (8083).
  • tbmq-ie — Integration Executor StatefulSet (default 2 replicas). Exposes HTTP (8082).
  • Helm hooks for one-shot install Pod and upgrade Job that run TBMQ's database schema initializer or migration tool.
  • Optional Ingress and Service resources for HTTP and MQTT load balancing (nginx, aws, azure, or gcp flavors).

Infrastructure dependencies — PostgreSQL, Kafka, and a Redis-compatible cache — must be deployed separately. Use whatever fits your environment: operators (CrunchyData PGO, Strimzi, Valkey Operator), managed services (RDS, MSK, ElastiCache), or raw manifests. The chart connects to your existing instances via the values you provide.

Prerequisites

  • Kubernetes 1.23+
  • Helm 3.8.0+
  • A default StorageClass (or set tbmq.persistence.storageClassName) — the broker requests a per-pod PVC for /data by default. See Persistence.
  • An external PostgreSQL instance with an empty database created for TBMQ (default name thingsboard_mqtt_broker, set via postgresql.database). The chart creates the schema, not the database.
  • An external Kafka cluster
  • An external Redis-compatible cache (Redis, Valkey, Dragonfly, etc.) — standalone or cluster
  • For the default load balancer settings: an NGINX Ingress Controller for HTTP, and support for Service type LoadBalancer for MQTT. Other options are covered in Step 2 and Load Balancer.

For a working step-by-step example using Minikube with CrunchyData PGO, Strimzi Kafka, and Valkey, see the Minikube Deployment Guide.

Installing

Step 1: Add the TBMQ Helm Repository

helm repo add tbmq-helm-chart https://helm.thingsboard.io/tbmq
helm repo update

Step 2: Prepare Your values.yaml

Export the chart defaults as a starting point, then edit it to match your environment:

helm show values tbmq-helm-chart/tbmq-cluster > values.yaml

The exported file pins every default at the chart version you exported it from, including the TBMQ image tags (tbmq.image.tag, tbmq-ie.image.tag) and the helper image versions (helperImages.*). Installing a newer chart version does not change them in your file — you update them yourself when you upgrade (see Standard Upgrade Procedure).

At a minimum you need to set:

  • postgresql.host and credentials (or existingSecret)
  • kafka.bootstrapServers
  • redis.nodes (cluster mode is the default) — or redis.connectionType: standalone plus redis.host/redis.port — and credentials if usePassword: true
  • loadbalancer.type — the default nginx needs an NGINX Ingress Controller already running in the cluster, and the MQTT Service of type LoadBalancer stays <pending> on clusters without a load balancer provider. Pick aws, azure, or gcp for those clouds, or set loadbalancer.http.enabled: false and loadbalancer.mqtt.enabled: false and reach TBMQ with kubectl port-forward (see Step 5).

The connection settings for PostgreSQL, Kafka, and Redis are described below.

Important: Do not set installation.installDbSchema: true in values.yaml. Pass it via --set on the helm install command instead. The post-install hook is also bound to post-upgrade to allow recovery from a forgotten flag, so a persisted flag re-runs the install pod on every helm upgrade. On a populated database it fails (User with email '[email protected]' already present in database!), and the upgrade fails with post-upgrade hooks failed. If you deleted the default [email protected] account or changed its email, the re-run first recreates it with the default password sysadmin, and the account stays after the Pod fails.

PostgreSQL

ParameterDescriptionDefault
postgresql.hostPostgreSQL hostname or service name.""
postgresql.portPostgreSQL port.5432
postgresql.databaseDatabase name. Must exist before install (the chart creates the schema, not the database)."thingsboard_mqtt_broker"
postgresql.usernamePostgreSQL username."postgres"
postgresql.passwordPostgreSQL password. Ignored if existingSecret is set. Stored in a chart-managed Secret.""
postgresql.existingSecretName of an existing Secret, in the release namespace, holding the password. Recommended for production.""
postgresql.existingSecretPasswordKeyKey inside existingSecret that holds the password. Falls back to postgres-password if left empty.""
postgresql:
  host: "my-postgres.example.com"
  port: 5432
  database: "thingsboard_mqtt_broker"
  username: "postgres"
  existingSecret: "my-pg-secret"
  existingSecretPasswordKey: "password"

Kafka

ParameterDescriptionDefault
kafka.bootstrapServersComma-separated host:port list of Kafka bootstrap nodes.""
kafka.existingSecretExisting Secret with extra Kafka client properties, set as TB_KAFKA_DEFAULT_PRODUCER_CONSUMER_CONFIG on the broker and IE.""
kafka.existingSecretConfigKeyKey within kafka.existingSecret that holds the properties."kafka-config"
kafka:
  bootstrapServers: "kafka-0:9092,kafka-1:9092,kafka-2:9092"

If your Kafka cluster requires TLS or SASL authentication, as managed Kafka services usually do, put the client properties in a Secret and reference it with kafka.existingSecret. The value is a list of property:value pairs separated by ;; escape a ; inside a value as \;. For example, for SASL/PLAIN over TLS:

kubectl create secret generic my-kafka-credentials -n <namespace> \
  --from-literal=kafka-config='security.protocol:SASL_SSL;sasl.mechanism:PLAIN;sasl.jaas.config:org.apache.kafka.common.security.plain.PlainLoginModule required username="USER" password="PASSWORD"\;'
kafka:
  bootstrapServers: "my-kafka.example.com:9092"
  existingSecret: "my-kafka-credentials"

The chart sets the Secret's value on the broker and Integration Executor containers, so the credentials stay out of values.yaml and the chart's ConfigMaps. Pods don't restart when the Secret changes; after you rotate the credentials, restart the broker and Integration Executor:

kubectl rollout restart statefulset/<release>-tbmq-node statefulset/<release>-tbmq-ie -n <namespace>

Redis / Valkey / Cache

TBMQ speaks the Redis protocol. Any Redis-compatible backend (Redis, Valkey, Dragonfly, KeyDB) works. Two connection modes are supported.

ParameterDescriptionDefault
redis.connectionType"standalone" (single-node) or "cluster" (Redis Cluster)."cluster"
redis.hostHostname for standalone mode.""
redis.portPort for standalone mode.6379
redis.nodesComma-separated host:port list for cluster mode.""
redis.usePasswordWhether the cache requires password authentication.true
redis.passwordPassword. Ignored if existingSecret is set. Stored in a chart-managed Secret.""
redis.existingSecretName of an existing Secret, in the release namespace, holding the password.""
redis.existingSecretPasswordKeyKey inside existingSecret that holds the password. Falls back to redis-password if left empty.""

Cluster mode:

redis:
  connectionType: "cluster"
  nodes: "redis-0:6379,redis-1:6379,redis-2:6379,redis-3:6379,redis-4:6379,redis-5:6379"
  existingSecret: "my-redis-secret"
  existingSecretPasswordKey: "redis-password"

Standalone mode (e.g., single-node Valkey):

redis:
  connectionType: "standalone"
  host: "valkey.example.com"
  port: 6379
  usePassword: false

In cluster mode, the chart renders cluster-only keys (REDIS_NODES, REDIS_MAX_REDIRECTS, REDIS_CLUSTER_USE_DEFAULT_POOL_CONFIG, and all REDIS_LETTUCE_* tunables) into the Redis ConfigMap; in standalone mode those keys are omitted and REDIS_HOST/REDIS_PORT are set instead. Both modes set REDIS_CONNECTION_TYPE and the CACHE_* keys.

Professional Edition (PE)

Skip this section for CE. PE installs from the same chart; you configure it with two more edits to the same values.yaml:

  1. Switch the broker and integration-executor images to the PE variants.
  2. Provide a license.

The repo ships values-pe.yaml as a reference for the canonical PE image repositories and tags at the current chart version. Copy those values into your values.yaml; do not pass values-pe.yaml itself as a -f overlay alongside your file.

Switch to PE images

Find the tbmq.image and tbmq-ie.image blocks in your values.yaml and change repository and tag to the PE values:

tbmq:
  image:
    repository: thingsboard/tbmq-pe-node                  # was: thingsboard/tbmq-node
    tag: 2.4.2PE                                          # was: 2.4.2

tbmq-ie:
  image:
    repository: thingsboard/tbmq-pe-integration-executor  # was: thingsboard/tbmq-integration-executor
    tag: 2.4.2PE                                          # was: 2.4.2

PE tags match the chart appVersion with a PE suffix (e.g. 2.4.2 → 2.4.2PE). The CE and PE image tags are not interchangeable.

Provide your license

Recommended (production): keep the license out of values.yaml by pre-creating a Kubernetes Secret in the namespace you will install into and referencing it from values:

kubectl create namespace <namespace>
kubectl create secret generic my-tbmq-license -n <namespace> \
  --from-literal=license-key='YOUR_LICENSE_VALUE'
license:
  existingSecret: my-tbmq-license
  # The chart reads the license from a key named "license-key" inside the Secret.
  # If your Secret uses a different key, set existingSecretLicenseKey: <your-key>.

Why this is the recommended path:

  • The license value never lives in values.yaml on disk, so the file is safe to keep in version control alongside the rest of your infra config.
  • Composes with sealed-secrets, External Secrets Operator, SOPS, Vault, or any other tool that produces a Kubernetes Secret in the release's namespace — point existingSecret at the name it produces and the chart picks it up unchanged.
  • Rotating the license is kubectl edit secret plus a broker restart (kubectl rollout restart statefulset/<release>-tbmq-node -n <namespace>) — no `hel

Deploy tbmq-cluster with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tbmq-cluster on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttbmq-cluster is pinned at v2.3.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply