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 examples of proxying ping #2102

Merged
merged 1 commit into from
Sep 13, 2017
Merged

Add examples of proxying ping #2102

merged 1 commit into from
Sep 13, 2017

Conversation

deitch
Copy link
Contributor

@deitch deitch commented Sep 11, 2017

via regular entrypoint and dedicated entrypoint.

Description

Add examples of how to expose /ping on one of:

  • a regular entrypoint
  • a dedicated port entrypoint

This is distinct from running it on the normal admin port (default to :8080) and allows you to expose /ping to other networks without exposing the admin port.

As requested by @ldez .

Closes #2094

@traefiker traefiker added this to the 1.4 milestone Sep 11, 2017
@ldez ldez changed the title Add examples of proxying ping via regular entrypoint and dedicated en… Add examples of proxying ping Sep 11, 2017
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.

Thanks 👍

@@ -296,3 +296,76 @@ defaultEntryPoints = ["http"]
IdleTimeout = "360s"
ProvidersThrottleDuration = "5s"
```

## Securing Ping Health Check
The `/ping` health-check URL is enabled together with the web admin panel, enabled with the command-line `--web` or config file option `[web]`. Thus, if you have a regular path for `/foo` and an entrypoint on `:80`, you would access them as follows:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could add an empty line between the before this line?
Could you put one sentence by line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, updating now. Out of curiosity, why? I have never seen markdown done with a CRLF between each sentence.

Copy link
Contributor

Choose a reason for hiding this comment

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

In Markdown, \n between two sentences is replaced by a simple (Expect in Github 😉 )

https://daringfireball.net/projects/markdown/syntax#p

* Admin panel: `http://hostname:8080/`
* Ping URL: `http://hostname:8080/ping`

However, for security reasons, you may want to be able to expose the `/ping` health-check URL to outside health-checkers, e.g. an Internet service or cloud load-balancer, _without_ exposing your admin panel's port. In many environments, the security staff may not _allow_ you to expose it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you put one sentence by line?

The above creates a new backend called `traefik`, lisenting on `http://localhost:8080`, i.e. the local admin port. We only expose the admin panel via the `frontend` named `traefikadmin`, and only expose the `/ping` Path.

## Enable ping health check on dedicated port
If you do not want to or cannot expose the health-check on a regular entrypoint - e.g. your security rules do not allow it, or you have a conflicting path - then you can enable health-check on its own entrypoint. Use the following config:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could add an empty line between the before this line?
Could you put one sentence by line?


Note the unique port for `/ping`.

In the above example, it is _very_ important that you create a named dedicated entrypoint, and do **not** include it in `defaultEntryPoints`. Otherwise, you are likely to expose _all_ services via that entrypoint.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you put one sentence by line?
And could you add empty line at the end of this file?

* Admin panel: `http://hostname:8080/`
* Ping URL: `http://hostname:8082/ping`

Note the unique port for `/ping`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you replace unique by dedicated

@deitch
Copy link
Contributor Author

deitch commented Sep 11, 2017

Updated. Back to you.

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.

The above creates a new backend called `traefik`, lisenting on `http://localhost:8080`, i.e. the local admin port.
We only expose the admin panel via the `frontend` named `traefikadmin`, and only expose the `/ping` Path.

## Enable ping health check on dedicated port
Copy link
Contributor

Choose a reason for hiding this comment

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

## -> ###

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@deitch
Copy link
Contributor Author

deitch commented Sep 11, 2017

Uh oh, needs rebase...

@deitch
Copy link
Contributor Author

deitch commented Sep 11, 2017

Rebased

@ldez ldez added the area/api label Sep 11, 2017
@deitch
Copy link
Contributor Author

deitch commented Sep 12, 2017

@ldez are there any outstanding changes requested? I think we got them all?

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.

@deitch Many thanks for your PR.
I have a few remarks/propositions/questions.

```

The above creates a new backend called `traefik`, lisenting on `http://localhost:8080`, i.e. the local admin port.
We only expose the admin panel via the `frontend` named `traefikadmin`, and only expose the `/ping` Path.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/lisenting/listening/

* Admin panel: `http://hostname:8080/`
* Ping URL: `http://hostname:8082/ping`

Note the dedicated port for `/ping`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe adding the port number in the note?


Note the dedicated port for `/ping`.

In the above example, it is _very_ important that you create a named dedicated entrypoint, and do **not** include it in `defaultEntryPoints`.
Copy link
Contributor

@nmengin nmengin Sep 12, 2017

Choose a reason for hiding this comment

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

s/that you create a named dedicated entrypoint/to create a dedicated entrypoint/ ?

and do not include it in defaultEntryPoints

I don't understand what cannot be included in the defaultEntryPoint. Can you develop?

Note the dedicated port for `/ping`.

In the above example, it is _very_ important that you create a named dedicated entrypoint, and do **not** include it in `defaultEntryPoints`.
Otherwise, you are likely to expose _all_ services via that entrypoint.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to say that if you don't specify a rule on the frontend (rule = "Path:/ping") you can expose all the web admin paths through the ping entrypoint?

@deitch
Copy link
Contributor Author

deitch commented Sep 12, 2017

Thanks @nmengin ; updating now.

@deitch
Copy link
Contributor Author

deitch commented Sep 12, 2017

Updated.

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

@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.

LGTM 📖 👏

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

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.

5 participants