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

Merge current v2.0 branch into master #5464

Merged
merged 17 commits into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Pointing Traefik at your orchestrator should be the _only_ configuration step yo

---

:warning: Please be aware that the old configurations for Traefik v1.X are NOT compatible with the v2.X config as of now. If you're testing out v2, please ensure you are using a [v2 configuration](https://docs.traefik.io/v2.0/).
:warning: Please be aware that the old configurations for Traefik v1.X are NOT compatible with the v2.X config as of now. If you're running v2, please ensure you are using a [v2 configuration](https://docs.traefik.io/).

## Overview

Expand Down Expand Up @@ -69,18 +69,11 @@ _(But if you'd rather configure some of your routes manually, Traefik supports t

## Supported Backends

- [Docker](https://docs.traefik.io/configuration/backends/docker) / [Swarm mode](https://docs.traefik.io/configuration/backends/docker#docker-swarm-mode)
- [Kubernetes](https://docs.traefik.io/configuration/backends/kubernetes)
- [Mesos](https://docs.traefik.io/configuration/backends/mesos) / [Marathon](https://docs.traefik.io/configuration/backends/marathon)
- [Rancher](https://docs.traefik.io/configuration/backends/rancher) (API, Metadata)
- [Azure Service Fabric](https://docs.traefik.io/configuration/backends/servicefabric)
- [Consul Catalog](https://docs.traefik.io/configuration/backends/consulcatalog)
- [Consul](https://docs.traefik.io/configuration/backends/consul) / [Etcd](https://docs.traefik.io/configuration/backends/etcd) / [Zookeeper](https://docs.traefik.io/configuration/backends/zookeeper) / [BoltDB](https://docs.traefik.io/configuration/backends/boltdb)
- [Eureka](https://docs.traefik.io/configuration/backends/eureka)
- [Amazon ECS](https://docs.traefik.io/configuration/backends/ecs)
- [Amazon DynamoDB](https://docs.traefik.io/configuration/backends/dynamodb)
- [Docker](https://docs.traefik.io/providers/docker/) / [Swarm mode](https://docs.traefik.io/providers/docker/)
- [Kubernetes](https://docs.traefik.io/providers/kubernetes-crd/)
- [Marathon](https://docs.traefik.io/providers/marathon/)
- [Rancher](https://docs.traefik.io/providers/rancher/) (Metadata)
- [File](https://docs.traefik.io/configuration/backends/file)
- [Rest](https://docs.traefik.io/configuration/backends/rest)

## Quickstart

Expand All @@ -97,7 +90,7 @@ You can access the simple HTML frontend of Traefik.
You can find the complete documentation at [https://docs.traefik.io](https://docs.traefik.io).
A collection of contributions around Traefik can be found at [https://awesome.traefik.io](https://awesome.traefik.io).

:warning: If you're testing out v2, please ensure you are using the [v2 documentation](https://docs.traefik.io/v2.0/).
:warning: If you're testing out v2, please ensure you are using the [v2 documentation](https://docs.traefik.io/).

## Support

Expand Down Expand Up @@ -128,7 +121,7 @@ git clone https://github.com/containous/traefik

## Introductory Videos

:warning: Please be aware that these videos are for v1.X. The old configurations for Traefik v1.X are NOT compatible with Traefik v2. If you're testing out v2, please ensure you are using a [v2 configuration](https://docs.traefik.io/v2.0/).
:warning: Please be aware that these videos are for v1.X. The old configurations for Traefik v1.X are NOT compatible with Traefik v2. If you're running v2, please ensure you are using a [v2 configuration](https://docs.traefik.io/).

Here is a talk given by [Emile Vauge](https://github.com/emilevauge) at GopherCon 2017.
You will learn Traefik basics in less than 10 minutes.
Expand Down
87 changes: 42 additions & 45 deletions docs/content/contributing/data-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,54 +42,51 @@ Once a day (the first call begins 10 minutes after the start of Traefik), we col
- a hash of the configuration
- an **anonymized version** of the static configuration (token, user name, password, URL, IP, domain, email, etc, are removed).

!!! note
We do not collect the dynamic configuration information (routers & services).
We do not collect these data to run advertising programs.
We do not sell these data to third-parties.

### Example of Collected Data

??? example "Original configuration"

```toml
[entryPoints]
[entryPoints.web]
address = ":80"

[api]

[providers.docker]
endpoint = "tcp://10.10.10.10:2375"
exposedByDefault = true
swarmMode = true
!!! info

[providers.docker.TLS]
ca = "dockerCA"
cert = "dockerCert"
key = "dockerKey"
insecureSkipVerify = true
```
- We do not collect the dynamic configuration information (routers & services).
- We do not collect this data to run advertising programs.
- We do not sell this data to third-parties.

??? example "Resulting Obfuscated Configuration"
### Example of Collected Data

```toml
[entryPoints]
[entryPoints.web]
address = ":80"

[api]

[providers.docker]
endpoint = "xxxx"
exposedByDefault = true
swarmMode = true

[providers.docker.TLS]
ca = "xxxx"
cert = "xxxx"
key = "xxxx"
insecureSkipVerify = false
```
```toml tab="Original configuration"
[entryPoints]
[entryPoints.web]
address = ":80"

[api]

[providers.docker]
endpoint = "tcp://10.10.10.10:2375"
exposedByDefault = true
swarmMode = true

[providers.docker.TLS]
ca = "dockerCA"
cert = "dockerCert"
key = "dockerKey"
insecureSkipVerify = true
```

```toml tab="Resulting Obfuscated Configuration"
[entryPoints]
[entryPoints.web]
address = ":80"

[api]

[providers.docker]
endpoint = "xxxx"
exposedByDefault = true
swarmMode = true

[providers.docker.TLS]
ca = "xxxx"
cert = "xxxx"
key = "xxxx"
insecureSkipVerify = false
```

## The Code for Data Collection

Expand Down
4 changes: 2 additions & 2 deletions docs/content/getting-started/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ The opposite is true: when you remove a service from your infrastructure, the ro

You no longer need to create and synchronize configuration files cluttered with IP addresses or other rules.

!!! note "Many different rules"
!!! info "Many different rules"

In the example above, we used the request [path](../routing/routers/index.md#rule) to determine which service was in charge, but of course you can use many other different [rules](../routing/routers/index.md#rule).

!!! note "Updating the requests"
!!! info "Updating the requests"

In the [middleware](../middlewares/overview.md) section, you can learn about how to update the requests before forwarding them to the services.

Expand Down
18 changes: 10 additions & 8 deletions docs/content/getting-started/configuration-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@ This configuration can change and is seamlessly hot-reloaded, without any reques

## The Dynamic Configuration

Traefik gets its _dynamic configuration_ from [providers](../providers/overview.md): whether an orchestrator, a service registry, or a plain old configuration file. Since this configuration is specific to your infrastructure choices, we invite you to refer to the [dedicated section of this documentation](../providers/overview.md).
Traefik gets its _dynamic configuration_ from [providers](../providers/overview.md): whether an orchestrator, a service registry, or a plain old configuration file.

!!! Note
Since this configuration is specific to your infrastructure choices, we invite you to refer to the [dedicated section of this documentation](../routing/overview.md).

!!! info ""

In the [Quick Start example](../getting-started/quick-start.md), the dynamic configuration comes from docker in the form of labels attached to your containers.

!!! Note
!!! info "HTTPS Certificates also belong to the dynamic configuration."

HTTPS Certificates also belong to the dynamic configuration. You can add / update / remove them without restarting your Traefik instance.
You can add / update / remove them without restarting your Traefik instance.

## The Static Configuration

There are three different, mutually exclusive, ways to define static configuration options in Traefik:
There are three different, **mutually exclusive** (e.g. you can use only one at the same time), ways to define static configuration options in Traefik:

- In a configuration file
- In the command-line arguments
- As environment variables
1. In a configuration file
1. In the command-line arguments
1. As environment variables

These ways are evaluated in the order listed above.

Expand Down
8 changes: 4 additions & 4 deletions docs/content/getting-started/install-traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can install Traefik with the following flavors:

Choose one of the [official Docker images](https://hub.docker.com/_/traefik) and run it with the [sample configuration file](https://raw.githubusercontent.com/containous/traefik/v2.0/traefik.sample.toml):

```shell
```bash
docker run -d -p 8080:8080 -p 80:80 \
-v $PWD/traefik.toml:/etc/traefik/traefik.toml traefik:v2.0
```
Expand All @@ -21,14 +21,14 @@ For more details, go to the [Docker provider documentation](../providers/docker.

* Prefer a fixed version than the latest that could be an unexpected version.
ex: `traefik:v2.0.0`
* Docker images comes in 2 flavors: scratch based or alpine based.
* Docker images are based from the [Alpine Linux Official image](https://hub.docker.com/_/alpine).
* All the orchestrator using docker images could fetch the official Traefik docker image.

## Use the Binary Distribution

Grab the latest binary from the [releases](https://github.com/containous/traefik/releases) page.

??? tip "Check the integrity of the downloaded file"
??? info "Check the integrity of the downloaded file"

```bash tab="Linux"
# Compare this value to the one found in traefik-${traefik_version}_checksums.txt
Expand All @@ -45,7 +45,7 @@ Grab the latest binary from the [releases](https://github.com/containous/traefik
Get-FileHash ./traefik_${traefik_version}_windows_${arch}.zip -Algorithm SHA256
```

??? tip "Extract the downloaded archive"
??? info "Extract the downloaded archive"

```bash tab="Linux"
tar -zxvf traefik_${traefik_version}_linux_${arch}.tar.gz
Expand Down
18 changes: 11 additions & 7 deletions docs/content/https/acme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can configure Traefik to use an ACME provider (like Let's Encrypt) for autom
[certificatesResolvers.sample.acme]
email = "your-email@your-domain.org"
storage = "acme.json"
[acme.httpChallenge]
[certificatesResolvers.sample.acme.httpChallenge]
# used during the challenge
entryPoint = "web"
```
Expand Down Expand Up @@ -56,6 +56,8 @@ You can configure Traefik to use an ACME provider (like Let's Encrypt) for autom
--certificatesResolvers.sample.acme.httpChallenge.entryPoint=web
```

!!! important "Defining a certificates resolver does not result in all routers automatically using it. Each router that is supposed to use the resolver must [reference](../routing/routers/index.md#certresolver) it."

??? note "Configuration Reference"

There are many available options for ACME.
Expand All @@ -79,11 +81,13 @@ Traefik automatically tracks the expiry date of ACME certificates it generates.

If there are less than 30 days remaining before the certificate expires, Traefik will attempt to renew it automatically.

!!! note
!!! info ""
Certificates that are no longer used may still be renewed, as Traefik does not currently check if the certificate is being used before renewing.

## The Different ACME Challenges

!!! important "Defining a certificates resolver does not result in all routers automatically using it. Each router that is supposed to use the resolver must [reference](../routing/routers/index.md#certresolver) it."

### `tlsChallenge`

Use the `TLS-ALPN-01` challenge to generate and renew ACME certificates by provisioning a TLS certificate.
Expand Down Expand Up @@ -158,7 +162,7 @@ when using the `HTTP-01` challenge, `certificatesResolvers.sample.acme.httpChall
--certificatesResolvers.sample.acme.httpChallenge.entryPoint=web
```

!!! note
!!! info ""
Redirection is fully compatible with the `HTTP-01` challenge.

### `dnsChallenge`
Expand Down Expand Up @@ -274,7 +278,7 @@ For example, `CF_API_EMAIL_FILE=/run/secrets/traefik_cf-api-email` could be used
[^3]: [google/default.go](https://github.com/golang/oauth2/blob/36a7019397c4c86cf59eeab3bc0d188bac444277/google/default.go#L61-L76)
[^4]: `docker stack` remark: there is no way to support terminal attached to container when deploying with `docker stack`, so you might need to run container with `docker run -it` to generate certificates using `manual` provider.

!!! note "`delayBeforeCheck`"
!!! info "`delayBeforeCheck`"
By default, the `provider` verifies the TXT record _before_ letting ACME verify.
You can delay this operation by specifying a delay (in seconds) with `delayBeforeCheck` (value must be greater than zero).
This option is useful when internal networks block external DNS queries.
Expand All @@ -299,8 +303,8 @@ certificatesResolvers:
dnsChallenge:
# ...
resolvers:
- "1.1.1.1:53"
- "8.8.8.8:53"
- "1.1.1.1:53"
- "8.8.8.8:53"
```

```bash tab="CLI"
Expand Down Expand Up @@ -394,5 +398,5 @@ If Let's Encrypt is not reachable, the following certificates will apply:
1. Expired ACME certificates
1. Provided certificates

!!! note
!!! important
For new (sub)domains which need Let's Encrypt authentication, the default Traefik certificate will be used until Traefik is restarted.