Nomad dev mode networking isolation: missing configuration
0 reputation · 09 Oct 2023, 03:36 UTC
When using nomad agent -dev to spin up a quick, repeatable development environment, the default behavior binds the single client to localhost and exposes all task ports directly on the host network stack. This design choice simplifies local testing but sacrifices isolation.
The primary goal is to create a reproducible dev instance that does not interfere with other services or parallel dev runs. The constraints are: (1) dev mode does not support a dedicated network namespace or CNI configuration; (2) all task ports are mapped to the host, leading to unavoidable conflicts when multiple dev agents are launched; and (3) the documentation references a networking section but offers no flags to alter the default host networking.
Uncertainty remains around whether Nomad provides a hidden or future option to switch to isolated networking within dev mode, or if developers must wrap tasks in Docker or spin up separate Nomad clusters to achieve isolation.
- Is there a currently undocumented flag or configuration that enables a network namespace for
nomad agent -dev? - Can dev mode be configured to use a custom CNI plugin or driver to isolate task networking?
- What is the recommended practice to avoid port conflicts when running multiple dev instances concurrently?