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
When deploying two instances of the same stack with same network, dns queries to services inside the stack a resolving to IPs on both stacks.
This behaviour is not the same as it says on "Service discovery and links" docs, so I think this may be a bug:
If the container making the query is part of a stack, and there is a local match on the same stack, the local match takes precedence over the service or container that is outside the stack.
I think this is the same issue that's effecting me too, however not only deploying the same stack again, even deploying a completely separate stack that just so happens to have a service with the same name.
I create two completely different stacks, but have them default to same network.
I exec into service one_web-one and ping web-two. I will always connect to one_web-two.
I exec into service one_web-two and ping web-one. I will sometimes connect to one_web-one but sometimes get two_web-one.
I would have expected that if I haven't referenced another stack, it would always default to the service inside of my stack.
The images below use Alpine links. You can install dig by running apk update && apk install bind-tools
I think the problem in both your setups is that both stacks are connected to the same external network. If you define the network to be created when the stack is deployed, each stack will have its own network named stackname_networkname.
Change:
networks:
testnet:
external: true
To:
networks:
testnet:
driver: overlay
Question is still if services in other stacks should be discovered without the adding the stack namespace as prefix. I just filed a related issue which might clarify that. #40213
Description
When deploying two instances of the same stack with same network, dns queries to services inside the stack a resolving to IPs on both stacks.
This behaviour is not the same as it says on "Service discovery and links" docs, so I think this may be a bug:
Steps to reproduce the issue:
Describe the results you received:
Resolving app1 from app2 in stack1 returns IPs for app1 in both stacks
Describe the results you expected:
Resolving app1 from app2 in stack1 should return only the IP for app1 in stack1
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Physical
The text was updated successfully, but these errors were encountered: