Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadBalancing doesn't work in single node Swarm-mode #815

Closed
valentin2105 opened this issue Nov 7, 2016 · 2 comments
Closed

LoadBalancing doesn't work in single node Swarm-mode #815

valentin2105 opened this issue Nov 7, 2016 · 2 comments

Comments

@valentin2105
Copy link

valentin2105 commented Nov 7, 2016

Hi,

I'm trying Traefik in a single node Docker 1.12.3 in Swarm-Mode.
I've using traefik v1.1.0-rc1 and v1.1.0-rc3, both problem.

The load-balancing when scalling up a service doesn't work (only in a single node-mode).

Here is my traefik.toml :

################################################################
# Web configuration backend
################################################################
[web]
address = ":8080"
################################################################
# Docker configuration backend
################################################################
[docker]
domain = "docker.localhost"
endpoint = "unix:///var/run/docker.sock"
watch = true
swarmmode = true

Here is my traefik's service creation :

docker network create --driver=overlay traefik-net

docker service create \
 --name traefik \
 --publish 80:80 --publish 443:443 --publish 8080:8080 \
 --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
 --mount type=bind,source=/srv/traefik/traefik.toml,target=/etc/traefik/traefik.toml \
 --network traefik-net \
 --mode global \
 traefik:v1.1.0-rc3 \
 --docker \
 --docker.swarmmode \
 --docker.domain=docker.localhost \
 --docker.watch \
 --logLevel=DEBUG \
 --web

Here is my Whoami0 test :

docker service create     --name whoami0     --label traefik.port=80 --network traefik-net     emilevauge/whoami
docker service scale whoami0=2

Docker ps:

CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS              PORTS               NAMES
58f53a2d8fbf        emilevauge/whoami:latest   "/whoamI"                7 minutes ago       Up 7 minutes        80/tcp              whoami0.2.9303q9iqgof0fqkielgmfjq9e
42536b24dea6        emilevauge/whoami:latest   "/whoamI"                8 minutes ago       Up 8 minutes        80/tcp              whoami0.1.bgcog5iq2strgvpyu7c30jkcj

Curl "whoami0.docker.locahost" :
return : Hostname: 58f53a2d8fbf always

If I publish the port of whoami0 and curl on it, Swarm load-balance resquests.

Any ideas ?

Thanks for Traefik, it's awesome.

@emilevauge
Copy link
Member

@valentin2105 this is due to keep alive.
Duplicate of #727, closing this one :)

@valentin2105
Copy link
Author

@emilevauge Thanks, sorry for duplicate.

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants