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

Loadbalance between 2 containers in Docker Swarm Mode #1095

Closed
pascalandy opened this issue Feb 1, 2017 · 2 comments
Closed

Loadbalance between 2 containers in Docker Swarm Mode #1095

pascalandy opened this issue Feb 1, 2017 · 2 comments

Comments

@pascalandy
Copy link
Contributor

pascalandy commented Feb 1, 2017

What version of Traefik are you using (traefik version)?

IMG_traefik="traefik:v1.1.2-alpine"

The key here is --replicas 2 and --label traefik.backend.loadbalancer.method=drr. I'm looking to get a basic Round Robin between these two container.

At the moment, when I refresh the page I always get:
This request was processed by host: a5c19563e3bd

Any idea how to accomplish this ?

CTN_iamfoo=iamfoo

docker service create \
--name "$CTN_iamfoo" \
--network "$NETW_static" \
--replicas 2 \
--restart-condition any \
--restart-max-attempts 10 \
--update-delay 7s \
--update-parallelism 2 \
--constraint node.labels.apps_accepted==yes \
--label traefik.enable=true \
--label traefik.frontend.rule=Path:/"$CTN_iamfoo" \
--label traefik.backend="$CTN_iamfoo" \
--label traefik.docker.network="$NETW_static" \
--label traefik.backend.loadbalancer.method=drr \
--label traefik.port=80 \
devmtl/golang-http-server_1.0:2016-12-06_12h12

docker service ls

ID            NAME        MODE        REPLICAS  IMAGE
n3m7sxkz91ws  traefik     global      1/1       traefik:v1.1.2-alpine
s1ngiork1sq7  iamfoo      replicated  2/2       devmtl/golang-http-server_1.0:2016-12-06_12h12
@pascalandy
Copy link
Contributor Author

Damm, just realized I open a similar issue a while back - #833

Let me know which issue should I close. Cheers!

@emilevauge
Copy link
Member

Let's close this one ;)

@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