I have a task (system job) running in nomad that is responsible for spinning up ephemeral subprocesses, which are short-lived and expose a websocket port as an event/data stream.
The subprocess picks an available port, and advertises it as the port a client can use to monitor it. Unfortunately the mechanism does not seem to work when running it within nomad. I can assign it a port range to draw from, but I cannot find a way to tell nomad that a task has a port range, rather than a set of statically defined ports, so when the process spins up it fails to find an available port.
Is this possible within nomad? Or is there some other mechanism I need to use? Or a custom driver or something?
Thanks.