Nomploy Nomad Packs

← All packs

mosquitto v0.1.0

Messaging

Eclipse Mosquitto — a lightweight open-source MQTT broker for IoT and pub/sub messaging (MQTT 3.1/3.1.1/5.0). Deployed as a host-networked Nomad service with a rendered config and a persistent volume for retained messages.

nomad-pack run mosquitto --registry nomploy
2 tasks mqtt 1883 1 volume image eclipse-mosquitto:2
Variables 9
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run mosquitto -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "mosquitto"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Eclipse Mosquitto container image. Pin a tag in production.
image = "eclipse-mosquitto:2"

# Host port for the MQTT listener (TCP).
port = 1883

# Allow clients to connect without credentials. Fine on a trusted network; set false and manage a password file for real use.
allow_anonymous = true

# Docker named volume for /mosquitto/data (retained messages / persistence DB). A prestart task chowns it to uid 1883 (the mosquitto user).
data_volume = "mosquitto_data"

# Placement constraints — pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 200
    memory = 128
  }
NameTypeDefaultDescription
job_name string
"mosquitto"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"eclipse-mosquitto:2"
The Eclipse Mosquitto container image. Pin a tag in production.
port number
1883
Host port for the MQTT listener (TCP).
allow_anonymous bool
true
Allow clients to connect without credentials. Fine on a trusted network; set false and manage a password file for real use.
data_volume string
"mosquitto_data"
Docker named volume for /mosquitto/data (retained messages / persistence DB). A prestart task chowns it to uid 1883 (the mosquitto user).
constraints list
[]
Placement constraints — pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 200
    memory = 128
  }
The task resources.
Readme

mosquitto

Eclipse Mosquitto — a lightweight open-source MQTT broker for IoT and pub/sub messaging (MQTT 3.1 / 3.1.1 / 5.0). Host-networked Nomad service with a rendered config and a persistent volume for retained messages.

Usage

nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run mosquitto --registry nomploy

In nomploy: create a Compose service, type Nomad Pack, pack mosquitto, custom registry github.com/Nomploy/nomad-packs, then Deploy. Broker at <node-ip>:1883.

Key variables

Variable Default Notes
image eclipse-mosquitto:2 Pin a tag in production.
port 1883 MQTT listener (TCP).
allow_anonymous true Open on a trusted network; set false + a password file for real use.
data_volume mosquitto_data Persistence DB / retained messages.
constraints [] Pin to a node so the local volume stays put.
resources cpu 200 / mem 128 Lightweight.

Notes