Nomploy Nomad Packs

← All packs

fleet v0.1.0

Device management

Fleet — open-source device management (osquery-based) for laptops and servers. Deployed all-in-one: the Fleet server plus its required MySQL and Redis, in a single host-networked Nomad job, with DB migrations run automatically on start.

nomad-pack run fleet --registry nomploy
3 tasks http 8080mysql 3306redis 6379 2 volumes
Variables 21
values.hcl

Save as values.hcl, edit, then run:

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

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

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

# The Fleet server container image. Pin a tag in production — Fleet runs schema migrations on start, so an unexpected major upgrade migrates your DB irreversibly.
fleet_image = "fleetdm/fleet:latest"

# Host port for Fleet's UI/API (host networking). Fleet serves plain HTTP here (TLS off) — front it with Traefik/a load balancer for TLS. Pick a free port on the target node.
port = 8080

# Whether Fleet terminates TLS itself. Keep false and terminate TLS at your reverse proxy; set true only if you also supply cert/key files into the container.
server_tls = false

# Optional 32-byte base64 key (openssl rand -base64 32) enabling MDM features and encrypted storage of secrets. Leave empty for basic osquery fleet management. If set, it is baked into the job env — treat it as a secret.
server_private_key = ""

# Resources for the Fleet server task.
fleet_resources = {
    cpu    = 500
    memory = 512
  }

# MySQL image. Fleet requires MySQL 8.0.x (8.0.44+ recommended).
mysql_image = "mysql:8"

# Host port MySQL listens on. Fleet connects to it on 127.0.0.1 (same host network namespace).
mysql_port = 3306

# Database name Fleet uses.
mysql_database = "fleet"

# Application DB user Fleet connects as.
mysql_username = "fleet"

# Password for the application DB user. CHANGE THIS.
mysql_password = "fleet"

# MySQL root password (used to bootstrap the instance). CHANGE THIS.
mysql_root_password = "fleet"

# Docker named volume for /var/lib/mysql. A fresh volume inherits the image's data-dir ownership so MySQL can write it. This is the only truly critical state — back it up.
mysql_data_volume = "fleet_mysql_data"

# Resources for the MySQL task.
mysql_resources = {
    cpu    = 500
    memory = 1024
  }

# Redis image. Fleet supports Redis 6/7.
redis_image = "redis:7"

# Host port Redis listens on. Fleet connects to it on 127.0.0.1 (same host network namespace).
redis_port = 6379

# Docker named volume for Redis /data (AOF). Redis holds only live/query state — losing it is not fatal, but persisting avoids a cold cache on reschedule.
redis_data_volume = "fleet_redis_data"

# Resources for the Redis task.
redis_resources = {
    cpu    = 200
    memory = 256
  }

# Placement constraints — pin the job to one node so the MySQL/Redis local volumes stay put (this pack runs a single all-in-one alloc). On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
NameTypeDefaultDescription
job_name string
"fleet"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
fleet_image string
"fleetdm/fleet:latest"
The Fleet server container image. Pin a tag in production — Fleet runs schema migrations on start, so an unexpected major upgrade migrates your DB irreversibly.
port number
8080
Host port for Fleet's UI/API (host networking). Fleet serves plain HTTP here (TLS off) — front it with Traefik/a load balancer for TLS. Pick a free port on the target node.
server_tls bool
false
Whether Fleet terminates TLS itself. Keep false and terminate TLS at your reverse proxy; set true only if you also supply cert/key files into the container.
server_private_key key string
""
Optional 32-byte base64 key (openssl rand -base64 32) enabling MDM features and encrypted storage of secrets. Leave empty for basic osquery fleet management. If set, it is baked into the job env — treat it as a secret.
fleet_resources object
{
    cpu    = 500
    memory = 512
  }
Resources for the Fleet server task.
mysql_image string
"mysql:8"
MySQL image. Fleet requires MySQL 8.0.x (8.0.44+ recommended).
mysql_port number
3306
Host port MySQL listens on. Fleet connects to it on 127.0.0.1 (same host network namespace).
mysql_database string
"fleet"
Database name Fleet uses.
mysql_username string
"fleet"
Application DB user Fleet connects as.
mysql_password key string
"fleet"
Password for the application DB user. CHANGE THIS.
mysql_root_password key string
"fleet"
MySQL root password (used to bootstrap the instance). CHANGE THIS.
mysql_data_volume string
"fleet_mysql_data"
Docker named volume for /var/lib/mysql. A fresh volume inherits the image's data-dir ownership so MySQL can write it. This is the only truly critical state — back it up.
mysql_resources object
{
    cpu    = 500
    memory = 1024
  }
Resources for the MySQL task.
redis_image string
"redis:7"
Redis image. Fleet supports Redis 6/7.
redis_port number
6379
Host port Redis listens on. Fleet connects to it on 127.0.0.1 (same host network namespace).
redis_data_volume string
"fleet_redis_data"
Docker named volume for Redis /data (AOF). Redis holds only live/query state — losing it is not fatal, but persisting avoids a cold cache on reschedule.
redis_resources object
{
    cpu    = 200
    memory = 256
  }
Resources for the Redis task.
constraints list
[]
Placement constraints — pin the job to one node so the MySQL/Redis local volumes stay put (this pack runs a single all-in-one alloc). On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
Readme

fleet

Fleet — open-source device management built on osquery, for querying and managing laptops and servers at scale (inventory, vulnerabilities, policies, optional MDM).

This pack is all-in-one: it runs the Fleet server together with its two required dependencies — MySQL 8 and Redis — in a single host-networked Nomad job. The dependencies start first (prestart sidecars) and share the host network namespace, so Fleet reaches them on 127.0.0.1. On start, Fleet waits for MySQL, runs its schema migrations (fleet prepare db), then serves the UI/API.

Good for a single-node or small deployment. To scale Fleet horizontally, run it against an external MySQL/Redis instead (see Production notes).

Usage

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

In nomploy: create a Compose service, type Nomad Pack, pack fleet, custom registry github.com/Nomploy/nomad-packs, then Deploy.

Once it's up, open http://<node-ip>:8080 and complete the first-run wizard to create the initial admin user. Generate an enroll secret / installer from the UI to enroll hosts.

What it deploys

count is fixed to 1 — a second alloc would start its own MySQL/Redis and fight over the same volumes. Pin the job to one node with constraints so the local volumes stay put.

Key variables

Variable Default Notes
fleet_image fleetdm/fleet:latest Pin a tag in production — Fleet migrates the DB on start.
port 8080 Fleet UI/API host port (HTTP).
server_tls false Keep false; terminate TLS at a proxy.
server_private_key "" Optional base64 32-byte key (openssl rand -base64 32) enabling MDM / encrypted secrets.
mysql_password / mysql_root_password fleet Change these.
mysql_data_volume fleet_mysql_data Critical state — back up.
mysql_port / redis_port 3306 / 6379 Host ports for the bundled deps.
constraints [] Pin to a node so volumes stay put.

See variables.hcl for the full list (images, credentials, per-task resources).

Production notes