hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.8k stars 1.94k forks source link

Support for making Nomad listen on Unix Domain Socket #17574

Open nh2 opened 1 year ago

nh2 commented 1 year ago

Use-cases

For testing purposes I wish to start many Nomad servers in parallel.

To avoid port conflicts and running out of ports, I would like to make Nomad listen on Unix Domain Sockets instead of localhost ports.

consul apparently already has Unix Domain Socket support, see docs:

http, https and grpc all support binding to a Unix domain socket. A socket can be specified in the form unix:///path/to/socket. A new domain socket will be created at the given path. If the specified file path already exists, Consul will attempt to clear the file and create the domain socket in its place. The permissions of the socket file are tunable via the unix_sockets config construct.

I would like to do the same with Nomad.

It does not seem to have such support (docs).

Attempted Solutions

# nomad agent -dev -bind 'unix:///tmp/nomad-socket'
==> Failed to parse HTTP advertise address (, unix:///tmp/nomad-socket, 4646, true): Error resolving bind address "unix:///tmp/nomad-socket": lookup unix:///tmp/nomad-socket: no such host
jrasell commented 1 year ago

Hi @nh2 and thanks for raising this feature request. I believe this is something we would want to support and which some work has already been conducted for within https://github.com/hashicorp/nomad/pull/16872 and https://github.com/hashicorp/nomad/pull/16884.