for-win icon indicating copy to clipboard operation
for-win copied to clipboard

ocker Service endpoints is not accessible in Windows Server 2016 container swarm mode

Open rajeshanayaka opened this issue 9 years ago • 2 comments

I am deploying docker stack on Windows server 2016 containers swarm mode with below mentioned stack.yml. Its getting deployed properly, however (1) service endpoint stack_web is not accessible as @published uri http://hostcomputer:80 and (2) both db & web service endpoint ips are not reachable on stack_net network

version: "3"
services:
    db:
        image: mongo
        networks:
                net:
                    aliases:
                        -  mymongodb
    web:
        image: microsoft/iis
        ports: 
            - 80:80
        networks:
            - net
networks:
    net:

Deploying command used : PS > docker stack up -c mongoiis.yml app1stack Creating network app1stack_net Creating service app1stack_db Creating service app1stack_web

PS > docker stack services app1stack ID NAME MODE REPLICAS IMAGE PORTS c0bdvuccpde9 app1stack_db replicated 1/1 mongo:latest ngv38tj5mpof app1stack_web replicated 1/1 microsoft/iis:latest *:80->80/tcp

PS > docker stack ps app1stack ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS xylm7wgweyjl app1stack_db.1 mongo:latest democonsul Running Running 4 minutes ago qpmtx7knk6m5 app1stack_web.1 microsoft/iis:latest democonsul Running Running 7 minutes ago

PS > docker stack services app1stack ID NAME MODE REPLICAS IMAGE PORTS c0bdvuccpde9 app1stack_db replicated 1/1 mongo:latest
ngv38tj5mpof app1stack_web replicated 1/1 microsoft/iis:latest *:80->80/tcp

PS > ping app1stack_web Ping request could not find host app1stack_web. Please check the name and try again.

PS > iwr http://localhost -UseBasicParsing iwr : Unable to connect to the remote server At line:1 char:1

  • iwr http://localhost -UseBasicParsing
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    
    

PS > docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b50429f850cc mongo:latest "mongod" 10 minutes ago Up 9 minutes 27017/tcp app1stack_db.1.xylm7wgweyjlv5vwgl3ukxv7q b5edbc4fc432 microsoft/iis:latest "C:\ServiceMonitor..." 12 minutes ago Up 12 minutes 80/tcp app1stack_web.1.qpmtx7knk6m5n9msgo9jex8jv 8dfd1e2d1455 docker/ucp-agent-win:2.2.3 "/bin/ucp-agent.ex..." 33 hours ago Up 2 hours 0.0.0.0:12376->2376/tcp ucp-proxy

PS > docker exec b5edbc4fc432 ping app1stack_db

Pinging app1stack_db [10.0.0.2] with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out.

Ping statistics for 10.0.0.2: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

PS > docker exec b5edbc4fc432 ping b50429f850cc

Pinging b50429f850cc [10.0.0.3] with 32 bytes of data: Reply from 10.0.0.3: bytes=32 time<1ms TTL=128 Reply from 10.0.0.3: bytes=32 time<1ms TTL=128 Reply from 10.0.0.3: bytes=32 time<1ms TTL=128 Reply from 10.0.0.3: bytes=32 time<1ms TTL=128

Ping statistics for 10.0.0.3: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms

PS > docker service inspect app1stack_web

[ { "ID": "ngv38tj5mpofy9tcwwlqlqdtn", "Version": { "Index": 805 }, "CreatedAt": "2017-10-09T13:37:50.2881996Z", "UpdatedAt": "2017-10-09T13:39:04.6215664Z", "Spec": { "Name": "app1stack_web", "Labels": { "com.docker.stack.image": "microsoft/iis", "com.docker.stack.namespace": "app1stack" }, "TaskTemplate": { "ContainerSpec": { "Image": "microsoft/iis:latest@sha256:868bca7e89e1743792e15f78edb5a73070ef44eae6807dc3f05f9b94c23943d5", "Labels": { "com.docker.stack.namespace": "app1stack" }, "Privileges": { "CredentialSpec": null, "SELinuxContext": null }, "StopGracePeriod": 10000000000, "DNSConfig": {} }, "Resources": {}, "RestartPolicy": { "Condition": "any", "Delay": 5000000000, "MaxAttempts": 0 }, "Placement": { "Platforms": [ { "Architecture": "amd64", "OS": "windows" } ] }, "Networks": [ { "Target": "053w1jawq9ic5apxwcqy1rl2b", "Aliases": [ "web" ] } ], "ForceUpdate": 0, "Runtime": "container" }, "Mode": { "Replicated": { "Replicas": 1 } }, "UpdateConfig": { "Parallelism": 1, "FailureAction": "pause", "Monitor": 5000000000, "MaxFailureRatio": 0, "Order": "stop-first" }, "RollbackConfig": { "Parallelism": 1, "FailureAction": "pause", "Monitor": 5000000000, "MaxFailureRatio": 0, "Order": "stop-first" }, "EndpointSpec": { "Mode": "vip", "Ports": [ { "Protocol": "tcp", "TargetPort": 80, "PublishedPort": 80, "PublishMode": "ingress" } ] } }, "Endpoint": { "Spec": { "Mode": "vip", "Ports": [ { "Protocol": "tcp", "TargetPort": 80, "PublishedPort": 80, "PublishMode": "ingress" } ] }, "Ports": [ { "Protocol": "tcp", "TargetPort": 80, "PublishedPort": 80, "PublishMode": "ingress" } ], "VirtualIPs": [ { "NetworkID": "pytj7xgaf7zig7ugx0f7qqly3", "Addr": "10.255.0.4/16" }, { "NetworkID": "053w1jawq9ic5apxwcqy1rl2b", "Addr": "10.0.0.4/24" } ] } } ]

PS > docker service inspect app1stack_db [ { "ID": "c0bdvuccpde9dmmjxv0b2iaqb", "Version": { "Index": 805 }, "CreatedAt": "2017-10-09T13:37:47.6728508Z", "UpdatedAt": "2017-10-09T13:39:04.6215664Z", "Spec": { "Name": "app1stack_db", "Labels": { "com.docker.stack.image": "mongo", "com.docker.stack.namespace": "app1stack" }, "TaskTemplate": { "ContainerSpec": { "Image": "mongo:latest@sha256:bb962ca3964c70069e652e814f7a495db19643ecb5bb62d799f621a68f4da90c", "Labels": { "com.docker.stack.namespace": "app1stack" }, "Privileges": { "CredentialSpec": null, "SELinuxContext": null }, "StopGracePeriod": 10000000000, "DNSConfig": {} }, "Resources": {}, "RestartPolicy": { "Condition": "any", "Delay": 5000000000, "MaxAttempts": 0 }, "Placement": { "Platforms": [ { "Architecture": "amd64", "OS": "linux" }, { "Architecture": "amd64", "OS": "windows" } ] }, "Networks": [ { "Target": "053w1jawq9ic5apxwcqy1rl2b", "Aliases": [ "mymongodb", "db" ] } ], "ForceUpdate": 0, "Runtime": "container" }, "Mode": { "Replicated": { "Replicas": 1 } }, "UpdateConfig": { "Parallelism": 1, "FailureAction": "pause", "Monitor": 5000000000, "MaxFailureRatio": 0, "Order": "stop-first" }, "RollbackConfig": { "Parallelism": 1, "FailureAction": "pause", "Monitor": 5000000000, "MaxFailureRatio": 0, "Order": "stop-first" }, "EndpointSpec": { "Mode": "vip" } }, "Endpoint": { "Spec": { "Mode": "vip" }, "VirtualIPs": [ { "NetworkID": "053w1jawq9ic5apxwcqy1rl2b", "Addr": "10.0.0.2/24" } ] } } ]

PS >

rajeshanayaka avatar Oct 17 '17 12:10 rajeshanayaka

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

docker-robott avatar Mar 27 '18 10:03 docker-robott

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

docker-robott avatar Jun 24 '20 03:06 docker-robott