Docker Community Forums

Share and learn in the Docker community.

How to access swarm service via vip on external

swarm

(Cnlxh) #1

Hi All,

I have 3 node in a swarm service, But I cannot access vip on external network, how can I access it on my office network? My swarm VIP can be access container-only, How to access VIP via external?


(Cnlxh) #2

I’m created the Docker swarm via docker swarm init command , I can see the VIP when I try to run docker server inspect XXX, I want to access the VIP on my office network


(Rahulishu1993) #3

hi @cnlxh, Have you mentioned the port in docker-compose file to expose the app to external network (i.e. Host and container port mapping).
If you can show your docker-compose file , it can help to understand the problem.
This kind of problem also occurs when inbound traffic is not allowed on the host port number you mentioned in docker compose file…


(Cnlxh) #4

I have add external: to my file, Should I use haproxy above docker swarm for high available external access?


(Rahulishu1993) #5

hi @cnlxh, yes you need to run a haproxy container above your containers to balance the load between them and to made your application highly available.