You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
✨ Allow #Exec containers to connect via a named service to #Start containers #2389
I want to enable use cases such as test runs to connect to a test database without requiring the user to know the IP of the running test database. They should be able to connect to it as a named service, such as test-db.
Why is this important to you?
It will ease the use of sidecar or other similar use cases.
Just a note, for services that can be connected to over unix sockets, there is a hacky-but-functional workaround to use a shared cache mount. Any unix socket created there by the service will be usable by clients w/ the same cache mount.
For use cases where this communication has to happen over the network, there is already support for overriding /etc/hosts in a container (ExtraHosts). This gives us a way to provide name->ip mappings.
I guess right now this would have to work by creating the service with core.#Start, retrieving the IP address of that container (multiple possible ways), then adding that ip address to ExtraHosts for the client container. I can't currently think of why this wouldn't work, but would need to be tried out to see how it goes.
Given the current state of core.#Start since all containers shares the same network, users can momentarily use localhost. Eventually, we'll have to move to sandbox network mode (issue to be created) where this issue along with #1258 will become relevant. We shouldn't let this stall that much since once core.#Start is released in the wild, users will complain about not having this for sure.
Activity
sipsma commentedon May 2, 2022
Just a note, for services that can be connected to over unix sockets, there is a hacky-but-functional workaround to use a shared cache mount. Any unix socket created there by the service will be usable by clients w/ the same cache mount.
For use cases where this communication has to happen over the network, there is already support for overriding /etc/hosts in a container (
ExtraHosts). This gives us a way to provide name->ip mappings.I guess right now this would have to work by creating the service with
core.#Start, retrieving the IP address of that container (multiple possible ways), then adding that ip address toExtraHostsfor the client container. I can't currently think of why this wouldn't work, but would need to be tried out to see how it goes.marcosnils commentedon May 4, 2022
Given the current state of
core.#Startsince all containers shares the same network, users can momentarily uselocalhost. Eventually, we'll have to move tosandboxnetwork mode (issue to be created) where this issue along with #1258 will become relevant. We shouldn't let this stall that much since oncecore.#Startis released in the wild, users will complain about not having this for sure.cc @shykes
sipsma commentedon May 4, 2022
Notes in this comment are also relevant: #1258 (comment)
(maybe we need an epic for tracking the overall networking issues that involve multiple issues?)