MQTT (mosquitto) swarm template¶
Description¶
This template runs mqtt for use with home automation
State Considerations for SWARM¶
- Mosquitto 2 needs a config before it will listen on anything but localhost.
- The config is
mosquitto.confin git. It deploys as a swarm config, which is available to the whole swarm, with a version in its name, see stack conventions.
Network Considerations¶
none, this publishes the default port of 1883 (if you need port 9001 then you already know why and how to modify this example :-) )
Placement Considerations¶
- None, this runs a single replica.
- This is for home network so no additional scale or redundancy needed in my usecase.
compose.yml, 22 lines, 1 note
each in the code opens a note on that line. download compose.yml
- the config is
mosquitto.conf, below, deployed as a swarm config. swarm refuses a deploy that changes a config's content under the same name, so each change to the file bumps the_v2suffix.
The config looks like this :-)
mosquitto.conf: the broker's config, 2 lines
This page started as a gist: the original, with its comments