Overview
Nomad is a flexible workload orchestrator for deploying containers, VMs, and standalone applications. Supports multiple task drivers, bin packing, and multi-region federation.
Capabilities
- Multi-driver task scheduling (Docker, exec, Java, QEMU)
- Job specification in HCL
- Rolling updates and canary deployments
- Multi-region federation
- Autoscaling with external metrics
- Integration with Consul and Vault
When to Use
Trigger phrases:
"nomad scheduler"
"Mixed workloads (containers + non-containerized)"
"Simple alternative to Kubernetes"
"Multi-region deployments"
Mixed workloads (containers + non-containerized)
Simple alternative to Kubernetes
Multi-region deployments
Batch job scheduling
Integration with HashiCorp stack (Consul, Vault)
When NOT to Use
- Task is outside your authorization scope
- You need to implement controls (use implementing-* skills)
- Task is about analysis, not action (use analyzing-* skills)
- You don't have access to target systems
- Task requires compliance expertise (consult professionals)
- Task is about defense, not offense (use defensive skills)
Pseudo Code
The nomad-scheduler workflow follows a standard pipeline pattern.
Core flow:
# nomad-scheduler primary flow
input = prepare(raw_data)
result = process(input, config={allocations, drivers, federation, hashicorp, nomad})
validate(result)
deliver(result)
Error handling:
on error:
log(error_details)
retry_with_backoff(max=3)
if still_failing: alert_and_escalate()
Job Specification
# web.nomad
job "web" {
datacenters = ["dc1"]
type = "service"
group "app" {
count = 3
network {
port "http" { to = 8080 }
}
service {
name = "web"
port = "http"
provider = "consul"
check {
type = "http"
path = "/health"
interval = "10s"
}
}
task "server" {
driver = "docker"
config {
image = "nginx:alpine"
ports = ["http"]
}
resources {
cpu = 256
memory = 256
}
template {
data = "{{ key \"config/nginx.conf\" }}"
destination = "local/nginx.conf"
}
vault {
policies = ["web-policy"]
}
}
}
update {
max_parallel = 1
canary = 1
auto_revert = true
}
}
Commands
# Run job
nomad job run web.nomad
# Status
nomad job status web
nomad alloc status <alloc-id>
# Scale
nomad job scale web app 5
# Stop
nomad job stop web
# Plan (dry run)
nomad job plan web.nomad
# Regions
nomad server members
nomad job run -region=eu web.nomad
Common Patterns
- Periodic jobs:
cron schedule for batch work
- Parameterized jobs: trigger with meta payload
- Canary deploys:
canary = 1 for safe rollouts
- Spread: distribute across datacenters
- Affinity/Constraints: pin to specific nodes
How to Use
- Define infrastructure as code (Terraform, CloudFormation, Pulumi)
- Review changes through PR process before applying
- Configure monitoring and alerting for critical paths
- Set up secrets management (Vault, AWS Secrets Manager, etc.)
- Document runbooks for deployment, rollback, and incident response
- Test disaster recovery procedures regularly
Red Flags
- Infrastructure changes without review: Unreviewed changes cause outages — use PRs for infra code
- No rollback strategy: Every deployment needs a tested rollback plan before it runs
- Secrets in configuration files: Secrets in YAML/JSON get committed to version control
- Missing monitoring and alerting: Without monitoring, outages go undetected until users report them
- No documentation for runbooks: Without runbooks, on-call engineers waste time re-discovering procedures
Verification
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "Manual deployments are fine" |
Manual deployments are error-prone and不可 repeatable. Automate. |
| "We do not need monitoring" |
Without monitoring, you are flying blind. Add observability from day one. |
| "Infrastructure as code is overkill" |
IaC enables reproducibility, version control, and disaster recovery. |
1---2name: nomad-scheduler3description: Use when hashiCorp Nomad — job scheduling, task drivers, allocations, scaling, federation. Use when working with nomad scheduler.4license: Apache-2.05---6789## Overview1011Nomad is a flexible workload orchestrator for deploying containers, VMs, and standalone applications. Supports multiple task drivers, bin packing, and multi-region federation.1213## Capabilities1415- Multi-driver task scheduling (Docker, exec, Java, QEMU)16- Job specification in HCL17- Rolling updates and canary deployments18- Multi-region federation19- Autoscaling with external metrics20- Integration with Consul and Vault2122## When to Use2324**Trigger phrases:**25- "nomad scheduler"26- "Mixed workloads (containers + non-containerized)"27- "Simple alternative to Kubernetes"28- "Multi-region deployments"293031- Mixed workloads (containers + non-containerized)32- Simple alternative to Kubernetes33- Multi-region deployments34- Batch job scheduling35- Integration with HashiCorp stack (Consul, Vault)3637## When NOT to Use3839- Task is outside your authorization scope40- You need to implement controls (use implementing-* skills)41- Task is about analysis, not action (use analyzing-* skills)42- You don't have access to target systems43- Task requires compliance expertise (consult professionals)44- Task is about defense, not offense (use defensive skills)454647## Pseudo Code4849The nomad-scheduler workflow follows a standard pipeline pattern.5051Core flow:52```53# nomad-scheduler primary flow54input = prepare(raw_data)55result = process(input, config={allocations, drivers, federation, hashicorp, nomad})56validate(result)57deliver(result)58```5960Error handling:61```62on error:63 log(error_details)64 retry_with_backoff(max=3)65 if still_failing: alert_and_escalate()66```676869### Job Specification70```hcl71# web.nomad72job "web" {73 datacenters = ["dc1"]74 type = "service"7576 group "app" {77 count = 37879 network {80 port "http" { to = 8080 }81 }8283 service {84 name = "web"85 port = "http"86 provider = "consul"8788 check {89 type = "http"90 path = "/health"91 interval = "10s"92 }93 }9495 task "server" {96 driver = "docker"9798 config {99 image = "nginx:alpine"100 ports = ["http"]101 }102103 resources {104 cpu = 256105 memory = 256106 }107108 template {109 data = "{{ key \"config/nginx.conf\" }}"110 destination = "local/nginx.conf"111 }112113 vault {114 policies = ["web-policy"]115 }116 }117 }118119 update {120 max_parallel = 1121 canary = 1122 auto_revert = true123 }124}125```126127### Commands128```bash129# Run job130nomad job run web.nomad131132# Status133nomad job status web134nomad alloc status <alloc-id>135136# Scale137nomad job scale web app 5138139# Stop140nomad job stop web141142# Plan (dry run)143nomad job plan web.nomad144145# Regions146nomad server members147nomad job run -region=eu web.nomad148```149150## Common Patterns151152- **Periodic jobs**: `cron` schedule for batch work153- **Parameterized jobs**: trigger with meta payload154- **Canary deploys**: `canary = 1` for safe rollouts155- **Spread**: distribute across datacenters156- **Affinity/Constraints**: pin to specific nodes157158## How to Use1591601. Define infrastructure as code (Terraform, CloudFormation, Pulumi)1612. Review changes through PR process before applying1623. Configure monitoring and alerting for critical paths1634. Set up secrets management (Vault, AWS Secrets Manager, etc.)1645. Document runbooks for deployment, rollback, and incident response1656. Test disaster recovery procedures regularly166167## Red Flags168169- **Infrastructure changes without review**: Unreviewed changes cause outages — use PRs for infra code170- **No rollback strategy**: Every deployment needs a tested rollback plan before it runs171- **Secrets in configuration files**: Secrets in YAML/JSON get committed to version control172- **Missing monitoring and alerting**: Without monitoring, outages go undetected until users report them173- **No documentation for runbooks**: Without runbooks, on-call engineers waste time re-discovering procedures174175## Verification176177- [ ] Skill output matches expected behavior178179## Process1801811. Analyze the task requirements1822. Apply domain expertise1833. Verify output quality184185## Anti-Rationalization Table186187| Rationalization | Reality |188|---|---|189| "Manual deployments are fine" | Manual deployments are error-prone and不可 repeatable. Automate. |190| "We do not need monitoring" | Without monitoring, you are flying blind. Add observability from day one. |191| "Infrastructure as code is overkill" | IaC enables reproducibility, version control, and disaster recovery. |