vernemq
by FZJ ICE-1
Deploys a clusterable VerneMQ MQTT broker StatefulSet with optional MQTT, MQTTS and/or WebSocket listeners.
About this chart
VerneMQ
This chart creates a clusterable deployment of the VerneMQ MQTT broker as a StatefulSet.
Requirements
Without users and with auth.allowAnonymous: false (default) no client can connect,
therefore create a secret with one key per username and the password as value:
apiVersion: v1
kind: Namespace
metadata:
name: vernemq
---
apiVersion: v1
kind: Secret
metadata:
name: vernemq-users
namespace: vernemq
type: Opaque
stringData:
alice: some-password
bob: another-password
# values.yaml
auth:
users:
existingSecrets:
- vernemq-users
When enabling the MQTTS listener (listeners.mqtts.enabled) a secret with tls.crt and tls.key is required,
e.g. issued by cert-manager:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: vernemq-tls
namespace: vernemq
spec:
secretName: vernemq-tls
issuerRef:
name: <issuer>
kind: ClusterIssuer
dnsNames:
- mqtt.example.com
# values.yaml
listeners:
mqtts:
enabled: true
tls:
existingSecret: vernemq-tls
Without an ACL, every authenticated user can read and write every topic, therefore create a secret with the ACL file and enable it:
apiVersion: v1
kind: Secret
metadata:
name: vernemq-acl
namespace: vernemq
type: Opaque
stringData:
vmq.acl: |
user alice
topic write sensors/alice/#
pattern read commands/%u/#
# values.yaml
acl:
enabled: true
existingSecret: vernemq-acl
Installing the Chart
Using Helm Install via Repository
Add the repository as described here.
# Install latest Version
helm repo update
helm upgrade -i -n vernemq vernemq ict-platform/vernemq -f values.yaml
# List available versions
helm search repo ict-platform --versions
# Install specific version
helm install -n vernemq vernemq ict-platform/vernemq --version <x.x.x> -f values.yaml
Using OCI Container Registry
# Show the default values
helm show values oci://jugit-registry.fz-juelich.de/iek-10/public/ict-platform/deployment/kubernetes/helm-charts/vernemq --version <x.x.x>
# Show the rendered manifests with your values
helm template -n vernemq vernemq oci://jugit-registry.fz-juelich.de/iek-10/public/ict-platform/deployment/kubernetes/helm-charts/vernemq --version <x.x.x> -f values.yaml
# Install
helm upgrade -i -n vernemq vernemq oci://jugit-registry.fz-juelich.de/iek-10/public/ict-platform/deployment/kubernetes/helm-charts/vernemq --version <x.x.x> -f values.yaml
Using Rancher
Follow the steps described here.
Deploy vernemq with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has vernemq 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 chartvernemq is pinned at v1.0.1 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