Nomad Integration with Vault
Give a Nomad-scheduled web app dynamic PostgreSQL credentials from Vault using Workload Identity.
Lab Overview
Applications orchestrated by Nomad rarely run without secrets. They connect to databases, call APIs, and read queues, and every one of those connections needs a credential that must never be hardcoded, baked into an image, or shared forever.
In this lab you integrate Nomad with Vault using the current Workload Identity (JWT) flow, then use it to hand a web application short-lived, dynamically generated PostgreSQL credentials that no human ever sees.
You will:
- Verify a 1-server, 2-client Nomad, Consul, and Vault cluster
- Configure Vault's JWT auth method to trust Nomad's JWKS endpoint
- Create a Vault JWT auth role that binds Nomad workload identity claims to a policy
- Enable the Vault integration on the Nomad server with the Workload Identity vault block
- Deploy a PostgreSQL database with a Nomad job
- Configure Vault's database secrets engine to mint dynamic PostgreSQL users
- Deploy a web application whose template stanza pulls dynamic database credentials from Vault
Nomad finds the active Vault server through Consul DNS at active.vault.service.consul, completing the Nomad, Consul, and Vault stack.
What You'll Learn
Explain how Nomad's Workload Identity authenticates a task to Vault with a signed JWT
Configure Vault's JWT auth method against Nomad's JWKS endpoint
Create a Vault JWT auth role and policy that grant a Nomad job access to dynamic secrets
Enable the Workload Identity vault block on a Nomad agent
Use Vault's database secrets engine to issue short-lived PostgreSQL credentials
Retrieve dynamic database credentials into a task with the Nomad template stanza
Prerequisites
nomad-basics
consul-basics
vault-basics
linux-command-line
Technologies Covered
Choose your plan
Simple, Transparent Pricing
Unlock full access to TeKanAid courses, labs, and bootcamps
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
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
Premium
Full access, including unlimited hosted labs
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 CoursesJust 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