Skip to content
Blog

HashiCorp Nomad for Container and Non-Container Workloads

Nomad schedules containers, binaries, batch jobs, and more — a tutorial overview of jobs, task drivers, clusters, and the Consul/Vault ecosystem around it.

Published on • November 14, 2026

AI Assistant

Most schedulers assume everything is a container. HashiCorp Nomad doesn’t — its task drivers schedule bare binaries, JVM services, QEMU guests, and batch workloads alongside Docker containers from one job spec, which is why it keeps showing up in HPC, data pipelines, and AI inference fleets. Here’s how it fits together and what running a job actually looks like.

What Nomad actually is

Nomad calls itself “a simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerized applications across on-prem and clouds at scale.” Three properties define it:

  • A single lightweight binary. No separate etcd, no API-server/controller/scheduler trio. Nomad servers keep cluster state in their own Raft-backed store, and the whole server-side config fits in a few dozen lines.
  • Workload diversity via task drivers. A driver is Nomad’s adapter to a runtime: docker, exec (spawns a local binary), raw_exec, java, qemu, podman, isolated (Linux namespaces), and device plugins for GPUs.
  • Declarative HCL job specs. You declare desired state in a file, submit it with nomad job run, and Nomad’s reconciliation loop keeps matching reality to the spec — rescheduling failed tasks onto healthy nodes the same way Swarm does.

Nomad is deliberately the scheduler only: service discovery and health checking come from Consul, secrets from Vault. That separation is the design, not a gap.

A minimal job spec

Save this as hello.nomad.hcl:

job "hello" {
  datacenters = ["dc1"]
  type        = "service"

  group "web" {
    count = 2

    network {
      port "http" { to = 8080 }
    }

    task "app" {
      driver = "docker"

      config {
        image = "nginx:1.27"
        ports = ["http"]
      }

      resources {
        cpu    = 500
        memory = 128
      }
    }
  }
}

Read it top-down: a job contains groups (scheduling and co-location unit — groups map to nodes, and tasks in a group run together), and each group contains tasks (the execution unit, each with its own driver). resources are in MHz-equivalent CPU and MB — no milli-core arithmetic.

Change one word and the job stops being a web service:

type = "batch"          # or "system", "sysbatch", "parameterized"
driver = "exec"
config { command = "/opt/jobs/nightly-report" }

A compiled binary with no container image around it runs the same way. type = "system" runs one allocation per eligible node (Swarm’s global mode); type = "batch" is for finite jobs that exit; parameterized makes a job a template you trigger with parameters — the primitive behind batch pipelines.

Running and inspecting jobs

nomad job validate hello.nomad.hcl
nomad job run -verbose hello.nomad.hcl
nomad status hello
nomad job allocs hello
nomad alloc logs -stdout <alloc-id>

nomad status shows the job’s summary — desired, running, failed allocations. nomad alloc logs is where you live during a rollout. Plan before you apply:

nomad job plan hello.nomad.hcl

It diffs proposed changes against the running spec and tells you whether an update would cause downtime — Nomad’s version of a dry run, and cheap enough that there’s no excuse not to use it.

Cluster topology: servers and clients

A Nomad cluster is servers (3 or 5, Raft, hold state) and clients (run the actual workloads). Bootstrap:

# server
nomad agent -dev            # single-node dev mode
# production: nomad agent -config=/etc/nomad.d/

# client joins
nomad node-status

The -dev flag gives you a single-process all-in-one cluster in seconds — genuinely one of the best onboarding experiences in orchestration. Production is the same binary with a config file: servers enable Raft, clients register with servers, and drivers are enabled per client (client { options { "driver.raw_exec.enable" = "true" } } — note that raw_exec is disabled by default for obvious security reasons).

Beyond placement basics, Nomad gives you affinities (pin a job to nodes with a specific attribute), spread (balance allocations across datacenters), and preemption (higher-priority jobs evict lower-priority ones — important when batch shares a cluster with services).

Consul and Vault: the ecosystem around it

Nomad alone schedules; production teams wire it to its siblings:

  • Consul — every task group can register services in Consul’s catalog and receive health checks (script, http, tcp, or TTL). The result is service discovery plus DNS (*.service.consul) and, with Consul Connect, a service mesh with mTLS between tasks. Nomad’s template block can also render config files from Consul KV before a task starts.
  • Vault — the template block likewise pulls secrets from Vault at task startup, with Nomad’s workload identity / Vault integration handling auth automatically. No secrets baked into images, no secrets in the job file.

This trio (Nomad + Consul + Vault) is the actual product. Teams that adopt only Nomad typically reimplement discovery and secrets later; teams that adopt all three get a coherent platform but take on three upgrade paths.

Where it fits

Nomad’s center of gravity is workloads that don’t fit the container mold:

  • Batch and data pipelines — parameterized jobs, sysbatch for node-local periodic work, and queueing semantics for thousands of finite tasks.
  • HPC-style and edge fleets — a single binary on thousands of heterogeneous clients (Nomad is used at CERN-scale deployments) where Kubernetes’s per-node footprint is too heavy.
  • AI/inference serving — HashiCorp’s official tutorials walk through scheduling Ollama with IBM Granite models on Nomad, using device plugins for GPUs; the exec-style drivers also fit ML jobs that are easier as native binaries than container images.
  • Multi-runtime shops — teams running JVM apps, Go services, and containers side by side get one scheduler, one job language, one nomad status.

The honest caveats: the ecosystem is smaller than Kubernetes’s (far fewer operators, charts, and off-the-shelf integrations), HashiCorp’s licensing shifts have pushed some teams to community forks like OpenBao for Vault, and hiring is thinner. Nomad wins when workload breadth is a first-class requirement; it loses when you need the Kubernetes extension machinery.

Further reading