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

Add plugin support #1865

Closed
wants to merge 3 commits into from
Closed

Add plugin support #1865

wants to merge 3 commits into from

Conversation

emilevauge
Copy link
Member

@emilevauge emilevauge commented Jul 17, 2017

Description

Like a phoenix, this PR supersedes #1370 and adds basic plugin support.

fenix

From #1370 (comment):

We can't load an external plugin if Traefik is built with CGO_ENABLED=0, and we really need this to build a statically linked golang executable to run in a Docker container.
golang/go#19569 and there are no plan on this golang/go#19569 (comment)

We will enable CGO for the Alpine based image. We then need to compile the binary in an Alpine based image with musl.

If you compile traefik binary on your laptop, and a plugin in docker on your laptop, it does not work either: Error loading plugin: error opening plugin: plugin.Open: plugin was built with a different version of package github.com/containous/traefik/plugin

At each release, we will also now publish the Docker image used to compile Traefik binary (build.Dockerfile). This image will be needed to compile each plugin.

  • The integration tests can't use a CGO Alpine based binary, therefore I need to generate a CGO binary during integration tests. The tests are a bit slow (1m) due to this compile. There may be a better solution.
  • We need to generate 1 statically linked binary (as usual) and 1 CGO Alpine based binary. Scripts need to be updated.

Any comment/suggestion is welcome :)

Fixes #1336
Fixes #1048
Part of #30

Signed-off-by: Emile Vauge <emile@vauge.com>
Signed-off-by: Emile Vauge <emile@vauge.com>
Signed-off-by: Emile Vauge <emile@vauge.com>
@alexellis
Copy link

I'd like to try a proof of concept of re-creating the API Gateway from FaaS but as a Traefik plugin. https://github.com/alexellis/faas

The core functions are:

  • UI for invoking functions
  • Deploying / Listing / Removing functions (Docker services)
  • Proxying via a routing pattern to containers that conform to a label
  • Monitoring usage metrics through Prometheus and altering replica count

Does that fit within your proposed change @emilevauge for a plugin?

@joejulian
Copy link

This is some excellent stuff. Can't wait to put it in production. 👍

@aantono
Copy link
Contributor

aantono commented Aug 21, 2017

This is an interesting approach to doing plugins in Go - https://github.com/hashicorp/go-plugin
Would this be something of interest to consider to use for Traefik?

@emilevauge
Copy link
Member Author

@alexellis sorry for the lag (holidays, you know ;) ).
I think it may be simpler to discuss on Slack. Could you join our Traefik channel ?

@zenix
Copy link

zenix commented Aug 31, 2017

When this is expected to hit production?

@porkchop
Copy link

Aside from resolving merge conflicts and semaphoreci what else needs to happen to get this useful feature merged?

@ldez ldez added the kind/enhancement a new or improved feature. label Oct 26, 2017
@matisojka
Copy link

Any progress here? The ability to extend Traefik is a must for my projects. Currently, I'm forced to use Nginx, since it allows to use Lua to extend its functionality.

@alexellis
Copy link

@emilevauge you're welcome to join our community, I can extend an invite.. you have lots of fans there already.

@skny5
Copy link

skny5 commented Nov 7, 2017

Curious has this PR been abandoned? It would extremely useful to have this type of functionality to be able to introduce custom integration points and header modifications.

@emilevauge
Copy link
Member Author

emilevauge commented Nov 7, 2017

FYI, this feature is not abandoned, but we are still not satisfied with the current official Go plugins situation.
Other options are being tested (#2362).
More on this soon :)

@emilevauge
Copy link
Member Author

We are working on another solution to implement plugins in Traefik.
Closing this one for now.

@emilevauge emilevauge closed this Jan 11, 2018
@joejulian
Copy link

Is there a tracking issue for the other implementation so I can have something to watch and know when it's ready? Perhaps it should be referenced here (and in #2362).

@emilevauge
Copy link
Member Author

@joejulian indeed, you can follow #1336 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants