doc: add k8s basic auth.

This commit is contained in:
Fernandez Ludovic 2017-05-02 15:08:18 +02:00
parent 89da3b15a4
commit 420a6db3b4
2 changed files with 29 additions and 12 deletions

View file

@ -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). - `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 ## Consul backend
Træfik can be configured to use Consul as a backend configuration: Træfik can be configured to use Consul as a backend configuration:
@ -1719,7 +1735,6 @@ RefreshSeconds = 15
Items in the `dynamodb` table must have three attributes: Items in the `dynamodb` table must have three attributes:
- `id` : string - `id` : string
- The id is the primary key. - The id is the primary key.
- `name` : string - `name` : string

View file

@ -505,19 +505,22 @@ You should now be able to visit the websites in your browser.
* [cheeses.local/wensleydale](http://cheeses.local/wensleydale/) * [cheeses.local/wensleydale](http://cheeses.local/wensleydale/)
## Disable passing the Host header ## 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 By default Træfik will pass the incoming Host header on to the upstream resource.
is of the ExternalName type. 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 ### Disable entirely
Add the following to your toml config: Add the following to your toml config:
```toml ```toml
disablePassHostHeaders = true disablePassHostHeaders = true
``` ```
### Disable per ingress ### 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: Here is an example ingress definition:
```yaml ```yaml
@ -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 static.otherdomain.com/static and static.otherdomain.com would receive the
request with the Host header being static.otherdomain.com. request with the Host header being static.otherdomain.com.
Note: The per ingress annotation overides whatever the global value is set to. So you Note: The per ingress annotation overides whatever the global value is set to.
could set `disablePassHostHeaders` to true in your toml file and then enable passing So you could set `disablePassHostHeaders` to `true` in your toml file and then enable passing
the host header per ingress if you wanted. the host header per ingress if you wanted.
## Excluding an ingress from Træfik ## Excluding an ingress from Træfik
You can control which ingress Træfik cares about by using the `kubernetes.io/ingress.class` You can control which ingress Træfik cares about by using the `kubernetes.io/ingress.class` annotation.
annotation. By default if the annotation is not set at all Træfik will include the By default if the annotation is not set at all Træfik will include the ingress.
ingress. If the annotation is set to anything other than traefik or a blank string If the annotation is set to anything other than traefik or a blank string Træfik will ignore it.
Træfik will ignore it.
![](http://i.giphy.com/ujUdrdpX7Ok5W.gif) ![](http://i.giphy.com/ujUdrdpX7Ok5W.gif)