/serverless-compute-skills:hashicorp-nomad-scheduling-and-configurationfrom serverless-compute-skills
Helps write HashiCorp Nomad job specs, choose scheduler types (service/batch/system), configure cluster topology, and set up canary/rolling deployments as a lighter-weight alternative to Kubernetes for mixed containerized and non-containerized workloads.
Ships in serverless-compute-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Nomad is a single-binary, general-purpose scheduler that runs containers, standalone binaries, Java applications, and VMs under one job specification format, with a notably simpler operational model than Kubernetes — one binary for both server and client roles, no separate etcd cluster to operate, and a smaller set of core concepts (jobs, task groups, tasks, scheduler types). It is not a Kubernetes replacement in every case: Kubernetes' ecosystem (CRDs, service mesh integrations, the broader operator pattern) is deeper, and most organizations already standardized on Kubernetes won't switch wholesale. Nomad earns its place where the operational simplicity, mixed containerized/non-containerized workload support, or lower resource/operational overhead is the deciding factor — this skill covers writing job specs, choosing scheduler types, and the cluster topology decisions specific to Nomad.
docker,
exec, raw_exec, java, qemu) — raw_exec in particular is
disabled by default and, when enabled, allows a task to run as an
arbitrary unsandboxed process on the client host, so enable it only
where that trust level is genuinely intended.service stanza; Vault (optional)
for dynamic secrets injected into tasks via the template stanza.nomad CLI matching (or compatible with) the cluster's server
version.Choose the scheduler type per job based on the workload's actual
lifecycle, not defaulting to service for everything:
service — long-running processes that should be restarted on
failure and kept at a target count (the Nomad analog of a
Kubernetes Deployment).batch — run-to-completion workloads (the Nomad analog of a
Kubernetes Job), optionally on a periodic schedule (the analog
of a CronJob).system — one instance per eligible client node (the Nomad analog
of a Kubernetes DaemonSet), for node-level agents like log
shippers or monitoring exporters.sysbatch — batch semantics but run once per eligible node,
combining system's node-scoping with batch's run-to-completion
semantics.Write the job spec with explicit resource requests and a matching scheduler type:
job "checkout-api" {
datacenters = ["dc1"]
type = "service"
group "api" {
count = 3
network {
port "http" { to = 8080 }
}
service {
name = "checkout-api"
port = "http"
check {
type = "http"
path = "/healthz"
interval = "10s"
timeout = "2s"
}
}
task "api" {
driver = "docker"
config {
image = "registry.example.com/checkout-api:2.3.0"
ports = ["http"]
}
resources {
cpu = 500
memory = 512
}
}
}
}
The service stanza's check block registers a Consul health check
(if Consul is integrated) so downstream service discovery only
routes to instances passing it — the Nomad equivalent of a
Kubernetes readiness probe gating Service endpoint membership.
Configure an update strategy for rolling deploys, rather than accepting the scheduler's default all-at-once replacement:
group "api" {
count = 6
update {
max_parallel = 2
min_healthy_time = "30s"
healthy_deadline = "5m"
auto_revert = true
canary = 1
}
# ... network/service/task as above
}
canary = 1 deploys one canary allocation running the new version
alongside the existing ones; auto_revert = true automatically rolls
back to the last stable version if the new allocations don't reach
healthy status within healthy_deadline — the same intent as a
Kubernetes Deployment's maxSurge/maxUnavailable combined with a
readiness-gated rollout, expressed in Nomad's own vocabulary.
Use constraint and affinity stanzas to place workloads
deliberately, not leave every allocation schedulable anywhere:
constraint {
attribute = "${node.class}"
value = "compute-optimized"
}
affinity {
attribute = "${meta.rack}"
value = "rack-2"
weight = 50
}
constraint is a hard requirement (the allocation won't schedule
anywhere that doesn't match); affinity is a soft preference scored
during placement — use constraint for genuine hardware/driver
requirements and affinity for preferences that shouldn't block
scheduling entirely if unmet.
Configure server/client topology and federation deliberately for multi-region deployments — each region runs its own Nomad server cluster (its own Raft quorum), federated together for cross-region visibility and job dispatch, rather than a single global server quorum spanning regions (which would suffer Raft consensus latency across the WAN):
# server config fragment
server {
enabled = true
bootstrap_expect = 3
}
Federation is established by joining servers across regions via
server_join / nomad server join, not by adding cross-region
nodes to the same Raft quorum.
Decide Nomad vs. Kubernetes per environment/workload class, not as an org-wide either/or: Nomad tends to fit environments needing a simpler operational model, mixed container/non-container workloads on the same scheduler, or edge/constrained-resource deployments where Kubernetes' control-plane footprint is disproportionate; Kubernetes tends to fit environments already invested in its ecosystem (CRDs, service mesh, a large operator library) where that depth outweighs Nomad's simplicity. Running both for different workload classes in the same organization is a legitimate outcome, not an inconsistency to eliminate.
resources { cpu, memory } on every task — an
under-specified task can be bin-packed onto a client node far more
aggressively than the workload can actually tolerate, the same risk
as an unset Kubernetes pod resource request.canary + auto_revert on any job whose failure is
user-visible, not just a plain rolling update with no health
validation gate before proceeding to the next batch.service and
template stanzas) rather than relying on network-level isolation
alone — a cluster with ACLs disabled trusts every client with a
network path to the API with full control-plane access.raw_exec disabled unless a specific, understood workload needs
unsandboxed process execution; prefer the docker or exec (chroot/
cgroup-isolated) drivers for anything that doesn't have that
requirement.nomad job plan (a dry-run diff)
before nomad job run, mirroring terraform plan/apply discipline.Symptom: A job update replaces all allocations at once, and a bad
release causes a full outage instead of a partial one.
Fix: No update stanza (or one with max_parallel set too high
relative to count) was configured; add max_parallel, canary,
and auto_revert so a bad release is caught on a small subset of
allocations before it reaches the full fleet.
Symptom: Nomad client nodes are running arbitrary unsandboxed
processes that shouldn't have host-level access.
Fix: The raw_exec driver was enabled without a specific need;
disable it on client nodes that don't require it, and restrict which
jobs/operators can target clients where it remains enabled.
Symptom: A multi-region Nomad deployment suffers slow leader
elections or degraded API responsiveness after adding servers in a
distant region to what was assumed to be a single cluster.
Fix: Servers across regions were joined into a single Raft quorum
instead of being federated as separate per-region server clusters;
reconfigure each region with its own bootstrap_expect-sized quorum
and federate them, rather than spanning one quorum across a
high-latency WAN link.
Symptom: An operator with only a network path to the Nomad API (no credentials) is able to submit or stop jobs. Fix: ACLs were never bootstrapped on the cluster (Nomad ACLs are opt-in); bootstrap the ACL system, issue scoped tokens per team/service, and require a valid token for all job-management operations going forward.
Symptom: A batch job scheduled with periodic runs multiple
overlapping instances when a run takes longer than the scheduled
interval.
Fix: The job's periodic stanza defaults (or an explicit
prohibit_overlap = false) allow overlapping runs; set
prohibit_overlap = true if concurrent runs of the same periodic job
would corrupt shared state or duplicate work.
Scenario: A batch data-processing job currently runs as a single
all-at-once Kubernetes CronJob but needs to move to a Nomad cluster
already running the organization's non-containerized legacy binaries,
with a scheduled hourly run that must never overlap with a still-running
previous execution.
job "hourly-report-batch" {
datacenters = ["dc1"]
type = "batch"
periodic {
cron = "0 * * * *"
prohibit_overlap = true
time_zone = "UTC"
}
group "report" {
count = 1
task "generate" {
driver = "docker"
config {
image = "registry.example.com/report-generator:1.2.0"
command = "/app/generate-report.sh"
}
resources {
cpu = 1000
memory = 1024
}
restart {
attempts = 2
interval = "10m"
delay = "30s"
mode = "fail"
}
}
}
}
prohibit_overlap = true guarantees a new hourly invocation won't start
while a prior run (delayed by unusually large input data, for example)
is still executing; restart with mode = "fail" gives the task two
retry attempts within a 10-minute window before the allocation is
marked failed rather than retried indefinitely. The job is applied with
a dry-run first:
nomad job plan hourly-report-batch.nomad.hcl
nomad job run hourly-report-batch.nomad.hcl
nomad job plan shows the diff against the currently running job
definition (or confirms it as a new job) before anything is actually
scheduled, the same review step terraform plan provides for
infrastructure changes.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
10 skills in this plugin
/aws-lambda-configuration-validationValidates an AWS Lambda function's configuration — reserved/provisioned concurrency budget, VPC networking config, environment variables, IAM execution role scope, and failure handling — before it deploys, catching problems that only otherwise surface as production throttling or an incident. Use when the user asks to "validate a Lambda function before deploy," "check Lambda reserved concurrency," "review a Lambda IAM role," "why is my Lambda throttling," or "add a pre-deploy check for Lambda config."
/aws-lambda-packaging-and-configurationPackages an AWS Lambda function as a zip deployment package or container image, tunes memory/timeout/ephemeral storage, mitigates cold starts, and scopes the function's IAM execution role to least privilege. Use when the user asks to "package a Lambda function," "build a container image for Lambda," "reduce Lambda cold start latency," "tune Lambda memory or timeout," "add a Lambda layer," or "scope down a Lambda execution role."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin serverless-compute-skillsOther plugins' skills for the same job