Hi everyone,
We've discussed Docker sidecars a little bit (they can be provisioned as members of a task group), but we haven't really discussed the networking and addressability of them.
In particular I'd like to ensure that we can employ the Ambassador pattern. In this pattern, a containerized application that needs to communicate with the outside world does so through proxy containers which share the same network stack as the primary's. The proxy containers decouple service discovery, secret injection, sharding, etc. from the application. The application just talks to "db" or "cache" or "api", which are set to 127.0.0.1 in the application container's /etc/hosts file.
With Docker, this means we need to configure a few custom runtime options when launching the tasks with "docker run":
- the application task needs "--add-host=PROXY_CONTAINER_NAME:127.0.0.1" arguments for each proxy container
- the proxy tasks need the "--net=container:DEPENDENT_CONTAINER_NAME" argument
To make this work properly, the application task must be started first; otherwise the container networking can't be properly set up. So there's a dependency that needs to be established and enforced.
Are we going to be able to attain this with Nomad? If not, which issues should I file for tracking?
Thanks,
--Michael