Mosquitto MQTT deployment manifests for Kubernetes.
You can either use the plain YML files, or use Kustomize.
An example of overwriting FQDN can be found in ˙overlay/kustomize.yml`
Deployment is tested on K3s-v1.24.8+k3s1.
-
Create a namespace for Mosquitto:
kubectl create ns mosquitto -
Build the deployment by using kubectl's built-in kustomize feature:
kubectl apply -k overlay -n mosquitto
If you are using this for Home Assistant then you can use the same namespace you already have for HA.
After first run password authentication is set but /mosqitto/conf/password_file is empty.
Log into the container and use mosquitto_passwd utility to add users.
Alternatively if you already have password_file you can use the overlay/password_file too.