Closed StetsonG closed 6 years ago
So I have found a few references to the fact that the default VIP routing is not supported on Windows Containers unless you are using the newly released Windows 10/Server 1709 and a preview version of Docker EE:
These networking improvements also unlock VIP-based service discovery when using overlay networks so that Windows users are not limited to DNS Round Robin.
https://blog.docker.com/2017/09/docker-windows-server-1709/
So with that knowledge I set my services to use DNS Round Robin by setting the endpoint_mode in the docker-compose file:
deploy:
endpoint_mode: dnsrr
And then communication between services works as expected.
I think then that this is mainly a documentation issue, as it was not very clear when looking at Microsoft's or Docker's documentation that this was a limitation of Windows Containers.
It would also make sense for docker to default to DNS Round Robin on platforms that do not support VIP networking.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
comment.
Stale issues will be closed after an additional 30d of inactivity.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale
/remove-lifecycle stale
@StetsonG The blog post indicates that virtual IP is now supported, however this still doesn't work on Windows Server 2019 a few years later.
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked
I think this is the correct repository for this issue (Docker Swarm on Windows Server 2016) but please let me know if there is a better place for it.
Expected behavior
An HTTP GET request succeeds against a swarm service's virtual IP or hostname from another container on the same overlay network.
Actual behavior
An HTTP GET request succeeds against the real container IP address, but not against the service's virtual IP or hostname.
Information
Running in Windows Server 2016 version 1607
The swarm consists of three Windows Server 2016 hosts, but I can reproduce this issue when constraining all services/containers to a single node.
Note: I originally experienced this issue in a deployment with multiple asp net core apps in a stack deployment, but have reproduced this problem with a single manually deployed service and powershell container on the same overlay network.
Note: Calling services by their hostnames does work when using docker-compose up instead of docker service create. In this case there is no virtual IP so the hostname resolves directly to the container IP and the request succeeds.
Steps to reproduce the behavior
https://github.com/dotnet/dotnet-docker-samples/tree/master/aspnetapp
Create an overlay network:
> docker network create --driver overlay --attachable testoverlay
> docker service create --constraint 'node.hostname == ac-devcontnr-01' --network testoverlay --publish mode=host,target=80,published=80 --name aspnetapp aspnetapp
I can then go to http://[dockerhost]:80 and I can see the asp net core sample app.
Create a powershell container on the same overlay network to test service requests:
> docker run -it --network testoverlay microsoft/powershell:nanoserver
Test web request to the aspnetapp container ip: Succeeds
Additional Information
This works using docker-compose instead of docker service create