Nomploy Nomad Packs

← All packs

consul v0.1.0

Networking

Consul — HashiCorp's service networking layer: a key/value store, service discovery, health checking, and DNS. Deployed here as a single-node server with the web UI, host-networked with a data volume. Handy alongside Nomad for app config and cross-service discovery.

nomad-pack run consul --registry nomploy
2 tasks http 8500dns 8600 1 volume image hashicorp/consul:latest
Variables 10
values.hcl

Save as values.hcl, edit, then run:

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

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

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

# The Consul container image. Pin a tag in production.
image = "hashicorp/consul:latest"

# Host port for the Consul HTTP API and web UI.
http_port = 8500

# Host port for the Consul DNS interface (TCP and UDP).
dns_port = 8600

# UID Consul runs as. The data volume is chown'd to this at startup.
uid = 100

# Named volume for Consul's data — KV store, state (/consul/data).
data_volume = "consul_data"

# Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 300
    memory = 256
  }
NameTypeDefaultDescription
job_name string
"consul"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"hashicorp/consul:latest"
The Consul container image. Pin a tag in production.
http_port number
8500
Host port for the Consul HTTP API and web UI.
dns_port number
8600
Host port for the Consul DNS interface (TCP and UDP).
uid number
100
UID Consul runs as. The data volume is chown'd to this at startup.
data_volume string
"consul_data"
Named volume for Consul's data — KV store, state (/consul/data).
constraints list
[]
Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 300
    memory = 256
  }
The task resources.
Readme

consul

Consul — HashiCorp's service networking layer: a key/value store, service discovery, health checking, and DNS. Handy alongside Nomad for application config and cross-service discovery.

Single-node server with the web UI, host-networked with a data volume. A busybox prestart task chowns the data volume to Consul's UID.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run consul --registry=nomploy

Configure

Variable Default Description
http_port 8500 HTTP API + web UI.
dns_port 8600 DNS interface (TCP + UDP).
uid 100 User Consul runs as; data volume is chown'd to it.
data_volume consul_data /consul/data — KV store, state.
image hashicorp/consul:latest Container image. Pin a tag in production.
resources { cpu = 300, memory = 256 } Task resources.

This is a single-node, ACL-open server for KV/config/discovery on a trusted network. For production, run an HA cluster with gossip encryption and ACLs. Pin the job to the node holding the volume with constraints.