mqtt-broker
by janip81
A Helm chart for Eclipse Mosquitto
About this chart
mqtt-broker
A Helm chart for Eclipse Mosquitto
Homepage: https://mosquitto.org/
Maintainers
| Name | Url | |
|---|---|---|
| janip81 | [email protected] |
Source Code
- https://github.com/janip81/helm-charts/tree/main/charts/mqtt-broker
- https://github.com/eclipse/mosquitto
Overview
This Helm chart deploys the Eclipse Mosquitto MQTT broker using the official Docker image. It provides a lightweight and secure message broker for your home automation, IoT, or internal messaging needs.
Features
- Simple deployment of the Eclipse Mosquitto MQTT broker
- Optional persistence support via PVC
- Configurable listener ports (MQTT and WebSocket)
- Optional password authentication support
- Automatically creates a password file secret if
auth.usernameandauth.passwordare provided invalues.yamlor via--set - Skips secret creation and runs in passwordless mode if
auth.enabled: false - Can mount an existing manually-created password secret via
auth.existingSecret
- Automatically creates a password file secret if
Prerequisites
- Kubernetes 1.22+
- Helm 3.6.0+
- PV provisioner support in the underlying infrastructure (for persistence)
TL;DR
helm repo add janip81 https://janip81.github.io/helm-charts/
helm install my-mqtt-broker janip81/mqtt-broker
Installation
Without Authentication (open broker)
helm install mqtt janip81/mqtt-broker \
--namespace mqtt \
--create-namespace \
--set auth.enabled=false
With Authentication (inline credentials via CLI)
helm install mqtt janip81/mqtt-broker \
--namespace mqtt \
--create-namespace \
--set auth.enabled=true \
--set auth.username=mqttuser \
--set auth.password=mqttpassword
⚠️ This creates a simple username:password pair in a secret using Helm — not bcrypt-hashed. Best for internal/test clusters only.
With Authentication (pre-created password file)
mosquitto_passwd -c passwd.txt mqttuser
kubectl create secret generic mqtt-auth \
--from-file=passwd=passwd.txt \
-n mqtt
helm install mqtt janip81/mqtt-broker \
--namespace mqtt \
--create-namespace \
--set auth.enabled=true \
--set auth.existingSecret=mqtt-auth
This is the most secure option.
passwd.txtmust contain bcrypt-hashed credentials.
Uninstallation
helm uninstall mqtt -n mqtt
To remove persistent data:
kubectl delete pvc -l app.kubernetes.io/instance=mqtt -n mqtt
Values
| Key | Type | Default | Description |
|---|---|---|---|
| auth.enabled | bool | false | |
| auth.existingSecret | string | "" | |
| auth.password | string | "ChangeMe!" | |
| auth.username | string | "mqttuser" | |
| config.allowAnonymous | bool | true | |
| config.passwordFile | string | "/mosquitto/config/passwd" | |
| image.pullPolicy | string | "IfNotPresent" | |
| image.repository | string | "eclipse-mosquitto" | |
| image.tag | string | "2.0.18" | |
| persistence.enabled | bool | true | |
| persistence.size | string | "1Gi" | |
| persistence.storageClass | string | "vsphere-csi" | |
| podSecurityContext | object | {"seccompProfile":{"type":"RuntimeDefault"}} | Pod security context. RuntimeDefault seccomp blocks syscalls no normal app needs. Add runAsNonRoot: true (and runAsUser) here if the image runs as a non-root user. |
| resources.limits.cpu | string | "100m" | |
| resources.limits.memory | string | "128Mi" | |
| resources.requests.cpu | string | "50m" | |
| resources.requests.memory | string | "64Mi" | |
| securityContext | object | {"allowPrivilegeEscalation":false} | Container security context, applied to every container (incl. init and migrate containers). |
| service.port | int | 1883 | |
| service.type | string | "ClusterIP" | |
| service.websocketPort | int | 9001 |
Autogenerated from chart metadata using helm-docs v1.14.2
Deploy mqtt-broker with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mqtt-broker 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 chartmqtt-broker is pinned at v0.1.5 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