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

Split Web into API/Dashboard, ping, metric and Rest Provider #2335

Merged
merged 16 commits into from
Nov 9, 2017

Conversation

juliens
Copy link
Member

@juliens juliens commented Oct 26, 2017

This PR changes the Web Provider implementation.

Now we can find all this "internal" routes separately

  • The API / Dashboard
  • The Ping
  • The Metrics
  • Rest Provider

Moreover, all this part, are configured on a entry point.
By doing it like this, we can use auth, whitelister etc.. for all internal routes.
We can attach those internal routes to the same entry point as the reverse proxy entry point

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juliens 😍 👏 👏

Only few suggestions.

| `/health` | `GET` | json health metrics |
| `/api` | `GET` | Configuration for all providers |
| `/api/providers` | `GET` | Providers |
| `/api/providers/{provider}` | `GET` | Get or update provider |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not we use PUT method to update provider?


!!!warning
For compatibility reason, when you activate the rest provider, you can use `web` or `rest` for `provider` value.
But be careful, in the configuration for all provider the key is still `web`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all providers

| `/api/providers/{provider}/frontends/{frontend}/routes/{route}` | `GET` | Get a route in a frontend |

!!!warning
For compatibility reason, when you activate the rest provider, you can use `web` or `rest` for `provider` value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for provider value => as provider value ?

| `/api/providers/rest` | `PUT` | update provider |

!!!warning
For compatibility reason, when you activate the rest provider, you can use `web` or `rest` for `provider` value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for provider value => as provider value ?



!!!warning
Even if you have authentication configure on entrypoint, the `/ping` path of the api is excluded from authentication.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configured

"github.com/containous/traefik/integration/try"
"github.com/go-check/check"
checker "github.com/vdemeester/shakers"
"os"
"strings"
"syscall"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort imports 😉

@@ -4,9 +4,13 @@ import (
"context"
"net/url"

"net/http"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort imports 😉

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New comments

log.Warn("web provider configuration is deprecated, you should use --api for api, --rest for rest provider, --ping for ping and --metrics for metrics")

if gc.API != nil || gc.Metrics != nil || gc.Ping != nil || gc.Rest != nil {
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe should we add a Warn message to inform user that the web configuration is not used if API or Metrics or Ping or Rest configuration exists

)

// Provider is a provider.Provider implementation that provides the UI
type Provider struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the comment because the provider does not provides UI yet, isn't it?

@ldez ldez self-requested a review November 4, 2017 21:12
@traefiker traefiker removed the request for review from ldez November 4, 2017 21:13
@ldez ldez changed the title Web provider refacto Split Web into API/Dashboard, ping, metric and Rest Provider Nov 5, 2017
@shadycuz
Copy link
Contributor

shadycuz commented Nov 8, 2017

Does this mean I can leave my /metrics exposed for Prometheus while still providing auth for dashboard? I was going to open a feature request for that.

@juliens
Copy link
Member Author

juliens commented Nov 8, 2017

@shadycuz yes but on different entrypoints (not the same port)

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very proud to be the first one to LGTM this amazing PR 👏 👏 😍

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👏

@tcoupin
Copy link
Contributor

tcoupin commented Jan 8, 2018

No more path option like in #1233 ?

@juliens
Copy link
Member Author

juliens commented Jan 11, 2018

@tcoupin the path option disappear but you can do it like this http://v1-5.archive.docs.traefik.io/configuration/backends/web/#path

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

Successfully merging this pull request may close these issues.

7 participants