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

How to configure which network to use when starting traefik binary? #694

Closed
gajus opened this issue Sep 22, 2016 · 4 comments
Closed

How to configure which network to use when starting traefik binary? #694

gajus opened this issue Sep 22, 2016 · 4 comments

Comments

@gajus
Copy link

gajus commented Sep 22, 2016

I am facing an issue using traefik binary when docker containers are on a different network.

This issue is described in detail here, #602 (comment).

To sum up the issue:

./dist/traefik --debug --docker.swarmmode

docker network create --driver overlay web
docker service create --network web --name whoami1 --label "traefik.frontend.rule=Host:whoami.anuary.com" --label "traefik.port=80" emilevauge/whoami

and then trying to access the started service:

$ curl -H 'Host: whoami.anuary.com' -v http://46.105.104.77
* Rebuilt URL to: http://46.105.104.77/
*   Trying 46.105.104.77...
* Connected to 46.105.104.77 (46.105.104.77) port 80 (#0)
> GET / HTTP/1.1
> Host: whoami.anuary.com
> User-Agent: curl/7.50.1
> Accept: */*
>
< HTTP/1.1 504 Gateway Timeout
< Date: Wed, 21 Sep 2016 19:35:06 GMT
< Content-Length: 15
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host 46.105.104.77 left intact
Gateway Timeout%

which produces the following logs:

DEBU[2016-09-21T21:34:41+02:00] Error loading load balancer method '<nil>' for backend backend-whoami1: Invalid method, using default. Using default wrr.
DEBU[2016-09-21T21:34:41+02:00] Configuration received from provider docker: {"backends":{"backend-whoami1":{"servers":{"server-whoami1":{"url":"http://10.0.0.2:80","weight":1}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-whoami-anuary-com":{"entryPoints":["http"],"backend":"backend-whoami1","routes":{"route-frontend-Host-whoami-anuary-com":{"rule":"Host:whoami.anuary.com"}},"passHostHeader":true,"priority":0}}}
INFO[2016-09-21T21:34:41+02:00] Skipping same configuration for provider docker
DEBU[2016-09-21T21:34:56+02:00] Error loading load balancer method '<nil>' for backend backend-whoami1: Invalid method, using default. Using default wrr.
DEBU[2016-09-21T21:34:56+02:00] Configuration received from provider docker: {"backends":{"backend-whoami1":{"servers":{"server-whoami1":{"url":"http://10.0.0.2:80","weight":1}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-whoami-anuary-com":{"entryPoints":["http"],"backend":"backend-whoami1","routes":{"route-frontend-Host-whoami-anuary-com":{"rule":"Host:whoami.anuary.com"}},"passHostHeader":true,"priority":0}}}
INFO[2016-09-21T21:34:56+02:00] Skipping same configuration for provider docker
WARN[2016-09-21T21:35:06+02:00] Error forwarding to http://10.0.0.2:80, err: dial tcp 10.0.0.2:80: i/o timeout
DEBU[2016-09-21T21:35:11+02:00] Error loading load balancer method '<nil>' for backend backend-whoami1: Invalid method, using default. Using default wrr.
DEBU[2016-09-21T21:35:11+02:00] Configuration received from provider docker: {"backends":{"backend-whoami1":{"servers":{"server-whoami1":{"url":"http://10.0.0.2:80","weight":1}},"loadBalancer":{"method":"wrr"}}},"frontends":{"frontend-Host-whoami-anuary-com":{"entryPoints":["http"],"backend":"backend-whoami1","routes":{"route-frontend-Host-whoami-anuary-com":{"rule":"Host:whoami.anuary.com"}},"passHostHeader":true,"priority":0}}}
INFO[2016-09-21T21:35:11+02:00] Skipping same configuration for provider docker
@emilevauge
Copy link
Member

As said here this has nothing to do with traefik, you have to run traefik on the same network.

@gajus
Copy link
Author

gajus commented Sep 22, 2016

@emilevauge Thats what I am asking – is there is a way to configure traefik binary on which network to run?

@gajus
Copy link
Author

gajus commented Sep 22, 2016

Looking at the ./dist/traefik --help output, it doesn't look like there is an option for this. However, this would be a useful feature, if this is technically possible.

@emilevauge
Copy link
Member

You have to run traefik in Docker, and use the docker command to attach traefik to your network. This is how it is supposed to work.

@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