Skip to content

✨ Allow #Exec containers to connect via a named service to #Start containers #2389

Closed

Description

@jlongtine

What are you trying to do?

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.

How are you currently working around this?

No response

Activity

  1. sipsma commented on May 2, 2022

    @sipsma
    Contributor

    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.

  2. marcosnils commented on May 4, 2022

    @marcosnils
    Contributor

    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.

    cc @shykes

  3. sipsma commented on May 4, 2022

    @sipsma
    Contributor

    Notes in this comment are also relevant: #1258 (comment)

    (maybe we need an epic for tracking the overall networking issues that involve multiple issues?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions