On Mar 7, 2016 6:41 PM, "Patrick Mahoney" <[email protected]> wrote: > > On 2016-03-07 7:41 pm, Buck Evan wrote: > >> How do services become aware of each others' port numbers? >> > > Not sure if this would be simpler than IP-per-playground, but you > could look into Linux's network namespaces [1] to assign > netns-per-playground. Within the netns, you can use statically known > ports, and you can use `ip netns exec $namespace command...` to run > arbitrary commands within the namespace. There's a fair amount of > config to properly create the loopback address within each netns, and > possibly allow routing through the primary netns (the one attached to > the LAN) if that's needed. > I was thinking something similar but instead of using a network namespace instead simply binding against a subdomain of a wildcard dns record. As long as your naming scheme was reasonably stable ($svc.$playgroundname.$wildcarddomain), a service that restarted would be able to bind to it's well-known port, only within the context of that particular subdomain.
I think that might be less work than setting up individual network namespaces, depending on your access to change internal dns. Cheers!
