1

I want to make the High available service. However, I don't know how to make requests to cluster services with single ip or dns name from outside the cluster.

I tried --endpoint-mode dnsrr. But I think this is not for the outside request balancing. Must I use reverse proxy or external load balancer. Can I make with software and cheap. I wish help me. Thank you.

RAK
  • 11
  • 1
  • 1
    Ingress will be running on every node of the cluster. Each of these ingress will load balance the requests to all nodes. If you need to have a single entry point, you have to use a reverse proxy to pass it to the ingress endpoints. You can use haproxy, or nginx for the same. – Partha Oct 07 '19 at 05:08

2 Answers2

0

Use --publish-add argument of docker service update command in order to map port of docker swarm service to host VM port. Then access the service using the host ip and port.

You can also create the service with published port using --publish host_vm_port:service_port syntax. For example:

docker service create --name my_web --replicas 3 --publish 8080:80 nginx

would create docker swarm service nginx with 3 replicas with nginx port 80 mapped to host VM 8080 port. Then you software client can access the service using [vm_ip:80/service_url] url

rok
  • 9,403
  • 17
  • 70
  • 126
  • 1
    I understand. But My problem is VMs shared ip , VMs load balancing. Like this photo :https://docs.docker.com/engine/swarm/images/ingress-lb.png Can I run reverse proxy in docker. Or Can I fix with Domain name – RAK Oct 05 '19 at 15:17
0

I know this is an old question, but depending on your setup you might be able to use keepalived. It allows you to define a static, virtual IP that will always point to one of your machines as long as there is still one running.

jkemming
  • 722
  • 12
  • 19