-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
#504 Initial support for Docker 1.12 Swarm Mode #602
Conversation
Thanks @diegofernandes for this contribution. Swarm mode is something we definitely want in Traefik ! (Related to #504) |
@@ -7,7 +7,7 @@ env: | |||
- CODENAME: reblochon | |||
matrix: | |||
- DOCKER_VERSION=1.9.1 | |||
- DOCKER_VERSION=1.10.1 | |||
- DOCKER_VERSION=1.12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://get.docker.com/builds/Linux/x86_64/docker-${DOCKER_VERSION}
replies 404 when applied with 1.12 and circle-ci fail on that error :-(
Could you:
- add a
.tgz
after `docker-${DOCKER_VERSION}`` - set
DOCKER_VERSION
to1.12.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a new docker version instead of replacing 1.10 one.
I think I handle the tar.gz
thing in the docker file (but I might be wrong and could be in anothe project but…)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap, for sure.
I will do that.
Both Swarm and Docker providers code and respective templates are very similar. Did you check if it was possible to make Swarm inheriting from Docker to avoid code duplication ? I am aware that types are different ( |
My first thought was to do in the same provide, but |
@diegofernandes I do agree. Maybe we could put some code in common between the two (probably do a refactor and have a
We should also add a |
@vdemeester I think for now we should only accept |
@diegofernandes thanks a lot for your contribution. |
In kubernetes we route to the pod (container) ips. However I think we have better guarantees about how the network should behave so sticking with the vip is fine for first release. |
DUPLICATED to here because it is more appropriate as a general PR comment. Edited @diegofernandes I recently built an image using your master branch and tried the following in my docker 1.12 swarm cluster.
but it doesn't seem to work yet because I am not getting the output from the whoami service. The I tried the same traefik image on a single node docker server using the docker-compose config at https://docs.traefik.io/#docker and it worked so I know that the image was correctly built. Let me know and I will be happy to test the new solutions. Thanks |
@timchunght instead of docker provider use swarm provider(this will change).
|
To clarify, is this PR ready to be reviewed and merged ? |
@diegofernandes I tested the two commands you posted and
is still |
@emilevauge I'm doing a refactory on my code to merge Docker Provider and Swarm Provider. So It is not ready. |
@timchunght How many nodes do you have in the cluster? |
@vdemeester,@samber, @errm , @emilevauge , @timchunght I think this is ready for review. |
Is there a time plan on when the next release of Traefik with this swarm mode support will be published on docker hub? |
I've also been trying to get this to work without much luck but it's probably my lack of Docker experience. I'm trying to find it via
traefik-docker is Traefik master with @diegofernandes's branch merged into it. It's then packaged with a simple Dockerfile:
But on startup I get various messages along the line of:
Has anyone got this running yet & could give me some guidance on what I'm missing. If I can get this nailed I'll happily get writing some documentation for #656. |
@LTheobald You probably didn't mount the docker daemon:
|
@mvdstam Thanks a lot - You're spot on. Right, let's see if I can get this going then. |
Just to confirm I've got @diegofernandes's branch working. I do get a 500 error when I attempt to access the web backend though & nothing is logged that I can see. |
Is this ready to be merged and released? Can't wait to try this out with Docker Swarm 1.12... 😄 |
From my testing, I'm getting very mixed results. I've not touched Træfik before though & my Docker knowledge is still novice. Running the following commands:
For some reason I only get a 200 response for I'd love to hear if anyone else has had any luck with this so I know it's not just me! And sorry if this seems like I'm complaining/moaning etc. - I'm really not & really appreciate what @diegofernandes has done. |
@LTheobald thanks for testing. in that case, you shouldn't use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @diegofernandes !
Still needs a rebase before merging ;)
Hi, traefik v1.1 developments will be frozen this week, on Thursday 29th. If you want your PR to be part of this release, please update your PR as soon as possible :) |
+1 for getting this in the 1.1, I know for a fact that a lot of people are waiting for a solution like this to be swarm compatible. |
@emilevauge I will try to do a rebase, but all that I had done It was merging :( |
@diegofernandes OK, once rebased, I will merge it right away :) While rebasing, it would also be great to squash some of your commits in order to keep a clean history. Thanks! |
c611d82
to
e8d8b51
Compare
@diegofernandes hum the first line of the commit should be a little more descriptive than |
e8d8b51
to
99c8bff
Compare
Thanks @diegofernandes for this great PR :) |
Thanks @emilevauge for merge this PR. I'm very happy to be part of this great project. |
Can't wait for this. |
Very awesome! But what about docs and examples? |
@ralphtheninja will be done before the release 😉 |
@vdemeester Let me know if you need some testing! |
+1 |
@gajus Are you saying this really stable with 1.12.1 (1.12+) ? Hope so :) |
Would love to see the documentation updated for this. |
I'm trying to run traefik runs as swarm service and on a different host as the whoami service. Is this supposed to work? For me it works only, if Since this makes little sense, I assume that this cannot be the final solution and I missed something essential. I guess that the Thanks for any help!
|
@christoph-hipp there is no docker events for swarm mode yet 😓 (meaning, there is no event emitted on the Note that Træfik must talk to a manager socket for now (no other way to get swarm mode api for now, but this might evolve).
I think you mean A little bit more info would be cool too, like the docker version, how did you create the cluster — where does it run (virtualbox, …), with which flag (mainly @christoph-hipp I also think creating an issue with your comment would be better than commenting on the PR :stuck_out_tongue_closed_eyes: (easier to follow, easier to fix maybe, …). |
Yes @vdemeester Question: Do I start traefik correct? If yes: Are there any other prerequisites to consider. If no: What is wrong? Finally: If this feature is currently really working for my case, it would be really cool, if somebody posts a consistent and simple sample. An HowTo for this rather simple and common use-case is more useful than writing comments and/or opening new issues. @vdemeester I assume from what you are writing that you have a working sample. Would be cool, if you could share it! |
@christoph-hipp there is https://github.com/containous/traefik/blob/v1.1/docs/user-guide/swarm-mode.md (I didn't realize it was still not published as 1.1 is not yet released — we're at rc2 I think). I have another one that does almost the same thing on digital ocean (I'll share it a little later, not on my laptop right now 😅 ). I didn't notice the first time, you should use |
On the docker hub I see Cheers! |
@pascalandy : for bleeding-edge Docker images for Traefik, see containous/traefik on Docker Hub |
This new provide just work with one network and
traefik.port
label.I include a provide swarm it`s quite similar with docker provider but this swarm provide watch for services data.