Skip to content

Commit

Permalink
doc: add k8s basic auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed May 3, 2017
1 parent 89da3b1 commit 420a6db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
17 changes: 16 additions & 1 deletion docs/toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,22 @@ Additionally, an annotation can be used on Kubernetes services to set the [circu
- `traefik.backend.circuitbreaker: <expression>`: set the circuit breaker expression for the backend (Default: nil).
### Authentication
Is possible to add additional authentication annotations in the Ingress rule.
The source of the authentication is a secret that contains usernames and passwords inside the the key auth.
- `ingress.kubernetes.io/auth-type`: `basic`
- `ingress.kubernetes.io/auth-secret`: contains the usernames and passwords with access to the paths defined in the Ingress Rule.
The secret must be created in the same namespace as the Ingress rule.
Limitations:
- Basic authentication only.
- Realm not configurable; only `traefik` default.
- Secret must contain only single file.
## Consul backend
Træfik can be configured to use Consul as a backend configuration:
Expand Down Expand Up @@ -1719,7 +1735,6 @@ RefreshSeconds = 15

Items in the `dynamodb` table must have three attributes:


- `id` : string
- The id is the primary key.
- `name` : string
Expand Down
24 changes: 13 additions & 11 deletions docs/user-guide/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,19 +505,22 @@ You should now be able to visit the websites in your browser.
* [cheeses.local/wensleydale](http://cheeses.local/wensleydale/)

## Disable passing the Host header
By default Træfik will pass the incoming Host header on to the upstream resource. There
are times however where you may not want this to be the case. For example if your service
is of the ExternalName type.

By default Træfik will pass the incoming Host header on to the upstream resource.
There are times however where you may not want this to be the case.
For example if your service is of the ExternalName type.

### Disable entirely

Add the following to your toml config:
```toml
disablePassHostHeaders = true
```

### Disable per ingress
To disable passing the Host header per ingress resource set the "traefik.frontend.passHostHeader"
annotation on your ingress to "false".

To disable passing the Host header per ingress resource set the `traefik.frontend.passHostHeader`
annotation on your ingress to `false`.

Here is an example ingress definition:
```yaml
Expand Down Expand Up @@ -557,16 +560,15 @@ If you were to visit example.com/static the request would then be passed onto
static.otherdomain.com/static and static.otherdomain.com would receive the
request with the Host header being static.otherdomain.com.

Note: The per ingress annotation overides whatever the global value is set to. So you
could set `disablePassHostHeaders` to true in your toml file and then enable passing
Note: The per ingress annotation overides whatever the global value is set to.
So you could set `disablePassHostHeaders` to `true` in your toml file and then enable passing
the host header per ingress if you wanted.

## Excluding an ingress from Træfik

You can control which ingress Træfik cares about by using the `kubernetes.io/ingress.class`
annotation. By default if the annotation is not set at all Træfik will include the
ingress. If the annotation is set to anything other than traefik or a blank string
Træfik will ignore it.
You can control which ingress Træfik cares about by using the `kubernetes.io/ingress.class` annotation.
By default if the annotation is not set at all Træfik will include the ingress.
If the annotation is set to anything other than traefik or a blank string Træfik will ignore it.


![](http://i.giphy.com/ujUdrdpX7Ok5W.gif)

0 comments on commit 420a6db

Please sign in to comment.