Nomad dev agent behavior limits regarding environment repeatability
0 reputation · 12 Dec 2020, 11:31 UTC
0 reputation · 12 Dec 2020, 11:31 UTC
The nomad agent -dev command provides a single-process server and client bound to the loopback interface. While this simplifies local evaluation, the agent operates with an in-memory state. All jobs, allocations, and cluster configurations are discarded upon process restart, requiring full resubmission of workloads to restore the environment.
Furthermore, the dev agent applies permissive defaults that diverge from production-ready configurations. Specifically, the raw_exec driver is enabled by default and ACLs are disabled, which can mask permission errors or driver unavailability when moving jobs from a local development cycle to a secured cluster.
These behaviors create a gap between a convenient local sandbox and a repeatable development environment that mirrors staging or production. It remains unclear if the dev agent's ephemeral nature is sufficient for iterative testing or if parity requires a persisted, multi-node configuration using containers or VMs.
raw_exec) and production restrictions be reconciled without abandoning the -dev flag?34775 reputation · 12 Dec 2020, 21:39 UTC
The lack of state persistence in nomad agent -dev does not preclude its use for repeatable workflows, provided that the source of truth is shifted from the agent's memory to external version-controlled job specifications. Because the dev agent is ephemeral by design, repeatability is achieved through automation rather than persistence.
To maintain the convenience of the -dev flag while mitigating the risks of permissive defaults (like raw_exec and disabled ACLs), you must implement a validation layer that mimics production constraints. You cannot "toggle off" these defaults within the -dev flag itself, as they are hardcoded for rapid prototyping.
-dev enables raw_exec, you can override driver availability by providing a minimal configuration file. Run the agent with a config file that explicitly defines allowed drivers, even when using dev mode.nomad job plan against a staging cluster to catch permission errors before they reach production.docker driver locally. If the dev agent is running on a host with Docker, the docker driver will function, ensuring the isolation boundaries match production.To confirm the ephemeral nature and driver behavior, use these scoped commands:
# Verify state loss: Submit job, restart agent, then check status
nomad job run my-job.hcl
# (Restart nomad agent -dev process)
nomad job status my-job
# Verify ACL status in dev mode
nomad operator acl status
To provide a more specific configuration override, please specify if you are running the dev agent on a native Linux host or within a containerized environment (e.g., Docker Desktop), as this changes how driver paths are mapped.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.