- what should run,
- how many copies should exist, and
- what each copy needs to run.
A job spec is declarative: you describe the desired state and Nomad converges the cluster to match it. This is different from imperatively executing commands on individual machines.

Three nested levels
A Nomad job spec has three nested levels. Each level has a clear responsibility and affects placement and lifecycle.
- Job — The top-level declaration you submit and version. It states metadata such as datacenters and job type.
- Group — The unit of placement and scaling. All tasks in one group land on the same client and scale together.
- Task — The actual runnable unit: a container, binary, or process.
Now let’s walk through the example file Maya uses for Tidepool’s API.
A simple job header
This job is namedtidepool-api, runs in datacenter dc1, and is a service job:
type controls lifecycle expectations:
service— expected to run continuously; Nomad restarts failures.batch— expected to run to completion and exit.system— run one copy on every client node (useful for agents like log shippers).

batch job: upload → process → exit. Tidepool’s Fluent Bit runs as an agent today; converting it to a system job would make Nomad run it automatically on every node.
Group, tasks, and resources
Inside the job is agroup named api. A group commonly sets:
count— how many copies (allocations) should run,network— declared ports and labels, andtasks— the runnable units.
task sets a driver (for example, docker), a config block with driver-specific settings (like image for Docker), and a resources block that declares CPU (MHz) and memory (MB) requirements — the inputs Nomad uses to decide placement.

Resource requests (CPU in MHz, memory in MB) directly affect placement. Incorrect sizing can lead to poor utilization or performance problems. Always profile workloads and set conservative defaults.
From plan to run
Before changing the cluster, Maya previews the outcome with a local plan.nomad job plan simulates placement without altering the cluster. When ready, she runs nomad job run with the same file. A few seconds later nomad job status shows allocations and health.
Links and references
- Nomad documentation: https://www.nomadproject.io/
- HCL (HashiCorp Configuration Language): https://developer.hashicorp.com/hcl