tbmq-cluster
by Thingsboard
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.yamland 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:
- TBMQ Documentation
- TBMQ GitHub Repository
- ThingsBoard Charts GitHub Repository
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
IngressandServiceresources for HTTP and MQTT load balancing (nginx,aws,azure, orgcpflavors).
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/databy default. See Persistence. - An external PostgreSQL instance with an empty database created for TBMQ (default name
thingsboard_mqtt_broker, set viapostgresql.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
ServicetypeLoadBalancerfor 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.hostand credentials (orexistingSecret)kafka.bootstrapServersredis.nodes(cluster mode is the default) — orredis.connectionType: standaloneplusredis.host/redis.port— and credentials ifusePassword: trueloadbalancer.type— the defaultnginxneeds an NGINX Ingress Controller already running in the cluster, and the MQTTServiceof typeLoadBalancerstays<pending>on clusters without a load balancer provider. Pickaws,azure, orgcpfor those clouds, or setloadbalancer.http.enabled: falseandloadbalancer.mqtt.enabled: falseand reach TBMQ withkubectl port-forward(see Step 5).
The connection settings for PostgreSQL, Kafka, and Redis are described below.
Important: Do not set
installation.installDbSchema: trueinvalues.yaml. Pass it via--seton thehelm installcommand instead. The post-install hook is also bound topost-upgradeto allow recovery from a forgotten flag, so a persisted flag re-runs the install pod on everyhelm upgrade. On a populated database it fails (User with email '[email protected]' already present in database!), and the upgrade fails withpost-upgrade hooks failed. If you deleted the default[email protected]account or changed its email, the re-run first recreates it with the default passwordsysadmin, and the account stays after the Pod fails.
PostgreSQL
| Parameter | Description | Default |
|---|---|---|
| postgresql.host | PostgreSQL hostname or service name. | "" |
| postgresql.port | PostgreSQL port. | 5432 |
| postgresql.database | Database name. Must exist before install (the chart creates the schema, not the database). | "thingsboard_mqtt_broker" |
| postgresql.username | PostgreSQL username. | "postgres" |
| postgresql.password | PostgreSQL password. Ignored if existingSecret is set. Stored in a chart-managed Secret. | "" |
| postgresql.existingSecret | Name of an existing Secret, in the release namespace, holding the password. Recommended for production. | "" |
| postgresql.existingSecretPasswordKey | Key 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
| Parameter | Description | Default |
|---|---|---|
| kafka.bootstrapServers | Comma-separated host:port list of Kafka bootstrap nodes. | "" |
| kafka.existingSecret | Existing Secret with extra Kafka client properties, set as TB_KAFKA_DEFAULT_PRODUCER_CONSUMER_CONFIG on the broker and IE. | "" |
| kafka.existingSecretConfigKey | Key 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.
| Parameter | Description | Default |
|---|---|---|
| redis.connectionType | "standalone" (single-node) or "cluster" (Redis Cluster). | "cluster" |
| redis.host | Hostname for standalone mode. | "" |
| redis.port | Port for standalone mode. | 6379 |
| redis.nodes | Comma-separated host:port list for cluster mode. | "" |
| redis.usePassword | Whether the cache requires password authentication. | true |
| redis.password | Password. Ignored if existingSecret is set. Stored in a chart-managed Secret. | "" |
| redis.existingSecret | Name of an existing Secret, in the release namespace, holding the password. | "" |
| redis.existingSecretPasswordKey | Key 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:
- Switch the broker and integration-executor images to the PE variants.
- Provide a license.
The repo ships
values-pe.yamlas a reference for the canonical PE image repositories and tags at the current chart version. Copy those values into yourvalues.yaml; do not passvalues-pe.yamlitself as a-foverlay 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.yamlon 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
existingSecretat the name it produces and the chart picks it up unchanged. - Rotating the license is
kubectl edit secretplus 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the charttbmq-cluster is pinned at v2.3.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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