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,4 scaling, federation. Use when working with nomad scheduler.5domain: devops6author: oyi777license: Apache-2.08subdomain: devops9tags:10- ci-cd11- devops12- infrastructure13- nomad14- scheduler15version: 1.0.016category: devops17metadata:18 source: https://skillmd.com/skills/oyi77/nomad-scheduler19---20212223## Overview2425Nomad is a flexible workload orchestrator for deploying containers, VMs, and standalone applications. Supports multiple task drivers, bin packing, and multi-region federation.2627## Capabilities2829- Multi-driver task scheduling (Docker, exec, Java, QEMU)30- Job specification in HCL31- Rolling updates and canary deployments32- Multi-region federation33- Autoscaling with external metrics34- Integration with Consul and Vault3536## When to Use3738**Trigger phrases:**39- "nomad scheduler"40- "Mixed workloads (containers + non-containerized)"41- "Simple alternative to Kubernetes"42- "Multi-region deployments"434445- Mixed workloads (containers + non-containerized)46- Simple alternative to Kubernetes47- Multi-region deployments48- Batch job scheduling49- Integration with HashiCorp stack (Consul, Vault)5051## When NOT to Use5253- Task is outside your authorization scope54- You need to implement controls (use implementing-* skills)55- Task is about analysis, not action (use analyzing-* skills)56- You don't have access to target systems57- Task requires compliance expertise (consult professionals)58- Task is about defense, not offense (use defensive skills)596061## Pseudo Code6263The nomad-scheduler workflow follows a standard pipeline pattern.6465Core flow:66```67# nomad-scheduler primary flow68input = prepare(raw_data)69result = process(input, config={allocations, drivers, federation, hashicorp, nomad})70validate(result)71deliver(result)72```7374Error handling:75```76on error:77 log(error_details)78 retry_with_backoff(max=3)79 if still_failing: alert_and_escalate()80```818283### Job Specification84```hcl85# web.nomad86job "web" {87 datacenters = ["dc1"]88 type = "service"8990 group "app" {91 count = 39293 network {94 port "http" { to = 8080 }95 }9697 service {98 name = "web"99 port = "http"100 provider = "consul"101102 check {103 type = "http"104 path = "/health"105 interval = "10s"106 }107 }108109 task "server" {110 driver = "docker"111112 config {113 image = "nginx:alpine"114 ports = ["http"]115 }116117 resources {118 cpu = 256119 memory = 256120 }121122 template {123 data = "{{ key \"config/nginx.conf\" }}"124 destination = "local/nginx.conf"125 }126127 vault {128 policies = ["web-policy"]129 }130 }131 }132133 update {134 max_parallel = 1135 canary = 1136 auto_revert = true137 }138}139```140141### Commands142```bash143# Run job144nomad job run web.nomad145146# Status147nomad job status web148nomad alloc status <alloc-id>149150# Scale151nomad job scale web app 5152153# Stop154nomad job stop web155156# Plan (dry run)157nomad job plan web.nomad158159# Regions160nomad server members161nomad job run -region=eu web.nomad162```163164## Common Patterns165166- **Periodic jobs**: `cron` schedule for batch work167- **Parameterized jobs**: trigger with meta payload168- **Canary deploys**: `canary = 1` for safe rollouts169- **Spread**: distribute across datacenters170- **Affinity/Constraints**: pin to specific nodes171172## How to Use1731741. Define infrastructure as code (Terraform, CloudFormation, Pulumi)1752. Review changes through PR process before applying1763. Configure monitoring and alerting for critical paths1774. Set up secrets management (Vault, AWS Secrets Manager, etc.)1785. Document runbooks for deployment, rollback, and incident response1796. Test disaster recovery procedures regularly180181## Red Flags182183- **Infrastructure changes without review**: Unreviewed changes cause outages — use PRs for infra code184- **No rollback strategy**: Every deployment needs a tested rollback plan before it runs185- **Secrets in configuration files**: Secrets in YAML/JSON get committed to version control186- **Missing monitoring and alerting**: Without monitoring, outages go undetected until users report them187- **No documentation for runbooks**: Without runbooks, on-call engineers waste time re-discovering procedures188189## Verification190191- [ ] Skill output matches expected behavior192193## Process1941951. Analyze the task requirements1962. Apply domain expertise1973. Verify output quality198199## Anti-Rationalization Table200201| Rationalization | Reality |202|---|---|203| "Manual deployments are fine" | Manual deployments are error-prone and不可 repeatable. Automate. |204| "We do not need monitoring" | Without monitoring, you are flying blind. Add observability from day one. |205| "Infrastructure as code is overkill" | IaC enables reproducibility, version control, and disaster recovery. |