Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker stack deploy: unable to set dnsrr as ports are exposed as ingress

Tags:

docker

ports

When launching services using stack deploy we get the following error:

"Error response from daemon: rpc error: code = 3 desc = EndpointSpec: port published with ingress mode can't be used with dnsrr mode"

Testing has led me to try: manually creating a network with ignress=false set, launching the stack deploy without exposing ports and joining the nodes to the network, then manually exposing ports.

docker service update --publish-add 5672:5672 service_name1

but still get the same error.

any thoughts?

like image 769
Muscothym Avatar asked Aug 23 '17 13:08

Muscothym


People also ask

What is Docker ingress?

When you initialize a swarm or join a Docker host to an existing swarm, two new networks are created on that Docker host: an overlay network called ingress , which handles the control and data traffic related to swarm services.

Which of the mode is used to bypass Swarm's routing mesh?

To bypass the routing mesh, you must use the long --publish service and set mode to host . If you omit the mode key or set it to ingress , the routing mesh is used.

What is ingress network swarm?

Ingress is an overlay network that handles the control and data traffic related to swarm services. When a user creates a swarm service without connecting it to a user-defined overlay network. It connects by default to the ingress network.

Does Docker swarm load balancer?

Yes, Docker Swarm does load balancing. Docker Swarm's load balancer runs on every node and is capable of balancing load requests across multiple containers and hosts.


1 Answers

For services with endpoint-mode set to dnsrr ports can't be published with the default mode which is 'ingress'. Changing the publish mode to host should work.

docker service update --publish-add published=80,target=80,protocol=tcp,mode=host service_name

In compose file it would be like,

ports:
  - target: 80
    published: 80
    protocol: tcp
    mode: host
like image 103
sriharip316 Avatar answered Oct 08 '22 09:10

sriharip316