LABINTERMEDIATE

Nomad Advanced Job Placement

Control where Nomad runs your jobs using Constraints, Affinities, and Spread.

60 minutes
hashicorp/nomad
Nomad Advanced Job Placement - Platform Engineering Hands-On Lab Icon
Share this Lab

Lab Overview

Nomad gives operators fine-grained control over where allocations land. In this lab you deploy a web application and the Traefik load balancer as Nomad jobs on a 4-node cluster (1 server, 3 clients) backed by Consul service discovery, then use Nomad's placement stanzas to steer them:

  • Use a constraint to pin Traefik to a specific Nomad client so you can reach its dashboard.
  • Use spread to distribute the web app's allocations evenly across all 3 clients for failure tolerance.
  • Use an affinity to express a soft preference to run the web app on a larger client, and observe how

Nomad weighs your preference against its own anti-affinity and bin-packing logic.

Along the way you use Nomad's variable interpolation so each web app instance binds to the dynamic port Nomad selects, letting multiple instances share a client, while Traefik load balances across them using the services they register in Consul.

We recommend completing the Nomad Basics and Nomad Simple Cluster labs first.

What You'll Learn

Verify the health of a Nomad and Consul cluster

Deploy a web application and Traefik as Nomad jobs with dynamic ports via variable interpolation

Use a constraint stanza to pin a job to a specific Nomad client

Use a spread stanza to distribute allocations evenly across clients

Use an affinity stanza to express a soft placement preference and interpret placement metrics

Prerequisites

nomad-basics

nomad-simple-cluster

linux-command-line

Technologies Covered

nomadjob placementconstraintaffinityspreadvariable interpolationconsultraefik

Choose your plan

Simple, Transparent Pricing

Unlock full access to TeKanAid courses, labs, and bootcamps

Buying for a team? Private corporate training is available for up to 15 learners.View team training
MonthlyQuarterly
Try Premium free for 7 days →

Just exploring? Start free below. Want the full experience? Try Premium free for 7 days (card required, $0 today).

Pro

All courses, with lab scripts to run on your own machine

$59/month

Renews automatically. Cancel anytime.

Final price verified at checkout.

  • Full access to all courses
  • Lab scripts to download and run on your own machine (hosted labs not included)
  • Progress tracking
  • Certificate of completion
  • Community access
  • Self-paced bootcamps
  • Premium puzzle library not included (5 free puzzles available)
  • New content access
Recommended

Premium

Full access, including unlimited hosted labs

$99/month

Renews automatically. Cancel anytime.

Final price verified at checkout.

  • Everything in Pro
  • Unlimited hands-on labs, fully hosted on TeKanAid Academy (nothing to set up)
  • Full access to the puzzle library
  • Lab AI Assistant
  • Priority support

Prefer a single course?

Purchase individual courses for a one-time fee of $79. Full access to course content, quizzes, certificates, and community features, lab access is not included.

Browse Courses

Just exploring? Start free, no account needed

Three free ways to start. All bridge into the paid Premium catalog when you're ready.

Not ready to commit? The crash course is email-only. No academy account required.

Ready to Get Started?

Start this hands-on lab and build real-world Platform Engineering skills

Get Access Now