Overview
Nomad provides several built-in mechanisms to isolate workloads across infrastructure. This article compares the use of datacenter
, namespace
, and node_pool
to help you choose the most appropriate isolation strategy for your environment.
Use Case
You want to:
- Separate workloads by region, environment, or geography
- Provide logical isolation for different teams or services
- Assign specific workloads to targeted hardware (e.g., GPU, high-memory nodes)
Solution
Nomad supports three primary isolation mechanisms:
1. datacenter
— Cluster-wide / Physical Isolation
- Scope: Cluster-wide
-
Use case: Geographic or environment-based separation (e.g.,
us-west
vs.europe
, orprod
vs.dev
) -
Behavior: Jobs with
datacenters = ["dc1"]
will only be scheduled on Nomad clients indc1
- Enforced by: Gossip protocol and client configuration
-
Example:
job "api-service" { datacenters = ["dc1"] }
- Best for: Region-based deployments, HA setups across zones, or strict networking boundaries
Nomad: Multi-Datacenter Deployment
2. namespace
— Logical / Multi-Tenancy Isolation
- Scope: Within a single Nomad cluster
- Use case: Multi-team environments, secure tenancy boundaries
- Behavior: ACLs restrict access by namespace; jobs, variables, and secrets are logically segmented
- Enforced by: ACL policies
-
Example:
Namespace for different teams:
payments
infra
sre
- Best for: Shared infrastructure with strong logical access boundaries between teams or services
3. node_pool
— Enterprise Feature / Scheduling Isolation
- Scope: Group-level scheduling isolation
- Use case: Target workloads to nodes with specific capabilities (e.g., GPU, SSD storage, high-memory)
-
Behavior: Nodes are grouped into pools like
gpu-pool
orgeneral-pool
; jobs declare anode_pool
- Enforced by: Scheduler and optional ACLs
-
Example:
job "ml-inference" { node_pool = "gpu-pool" }
- Best for: Ensuring only compatible workloads are run on specialized hardware
🔗 Nomad Enterprise: Node Pools
Summary
Isolation Mechanism | Scope | Use Case | Enforcement | Enterprise Feature |
---|---|---|---|---|
datacenter |
Cluster-wide | Region/environment separation | Gossip protocol | ❌ |
namespace |
Logical | Multi-team, ACL-restricted tenancy | ACL policies | ❌ |
node_pool |
Node grouping | Hardware/workload scheduling | Scheduler & ACLs | ✅ |
Enhancements from Allocation Placement Documentation
The Allocation Placement documentation provides additional nuance on how datacenter
and node_pool
behave in relation to Nomad's scheduler. Below are some enhancements based on that guidance:
datacenter
— Use It to Reflect Physical Location, Not Workload Purpose
While datacenter
can be used for fault tolerance and geo-segmentation, it should not be used to segment infrastructure based on application or workload type. According to Nomad documentation:
“Use datacenters to represent where a node resides rather than its intended use.”
Instead, use node_pool
if you're attempting to isolate by environment, team, or workload.
node_pool
— First-Class Isolation for Environments, Teams, or Workloads
node_pool
is a first-class scheduling feature in Nomad Enterprise that supports flexible node grouping and metadata. Unlike datacenter
, it doesn’t imply geographic or physical location. It can be used to segment:
- Functional areas (e.g., databases, web apps)
- Environments (e.g., staging, production)
- Departments (e.g., finance, marketing)
- Specialized nodes (e.g., GPU, SSD, high-memory)
Additionally, node pools can:
- Contain extra metadata
- Be associated with
namespace
for ACL and scheduling alignment - Hold specific scheduler configuration options