mqtt-broker

by janip81

Helm chartv0.1.5App 2.0.18MITVerified publisher

A Helm chart for Eclipse Mosquitto

About this chart

mqtt-broker

A Helm chart for Eclipse Mosquitto

Homepage: https://mosquitto.org/

Maintainers

NameEmailUrl
janip81[email protected]

Source Code

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.username and auth.password are provided in values.yaml or 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

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.txt must 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

KeyTypeDefaultDescription
auth.enabledboolfalse
auth.existingSecretstring""
auth.passwordstring"ChangeMe!"
auth.usernamestring"mqttuser"
config.allowAnonymousbooltrue
config.passwordFilestring"/mosquitto/config/passwd"
image.pullPolicystring"IfNotPresent"
image.repositorystring"eclipse-mosquitto"
image.tagstring"2.0.18"
persistence.enabledbooltrue
persistence.sizestring"1Gi"
persistence.storageClassstring"vsphere-csi"
podSecurityContextobject{"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.cpustring"100m"
resources.limits.memorystring"128Mi"
resources.requests.cpustring"50m"
resources.requests.memorystring"64Mi"
securityContextobject{"allowPrivilegeEscalation":false}Container security context, applied to every container (incl. init and migrate containers).
service.portint1883
service.typestring"ClusterIP"
service.websocketPortint9001

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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmqtt-broker is pinned at v0.1.5 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