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

fix: Rancher documentation. #4818

Merged
merged 1 commit into from
Apr 26, 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
6 changes: 4 additions & 2 deletions docs/content/providers/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,12 @@ _Optional, Default=Host(`{{ normalize .Name }}`)_
For a given container if no routing rule was defined by a label, it is defined by this defaultRule instead.
It must be a valid [Go template](https://golang.org/pkg/text/template/),
augmented with the [sprig template functions](http://masterminds.github.io/sprig/).
The container service name can be accessed as the Name identifier,
The container service name can be accessed as the `Name` identifier,
and the template has access to all the labels defined on this container.

``defaultRule = "Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"``
```toml
defaultRule = "Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"
```

### `swarmMode`

Expand Down
26 changes: 15 additions & 11 deletions docs/content/providers/rancher.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Attach labels to your services and let Traefik do the rest!

## Configuration Examples

??? example "Configuring Docker & Deploying / Exposing Services"
??? example "Configuring Rancher & Deploying / Exposing Services"

Enabling the rancher provider

Expand All @@ -34,22 +34,16 @@ Attach labels to your services and let Traefik do the rest!
# Rancher Provider
################################################################

# Enable Docker Provider.
# Enable Rancher Provider.
[rancher]

# The default host rule for all services.
#
# Optionnal
#
DefaultRule = "unix:///var/run/docker.sock"

# Expose Rancher services by default in Traefik.
#
# Optional
#
ExposedByDefault = "docker.localhost"
ExposedByDefault = "true"

# Enable watch docker changes.
# Enable watch Rancher changes.
#
# Optional
#
Expand Down Expand Up @@ -89,10 +83,20 @@ If set to false, services that don't have a `traefik.enable=true` label will be

### `DefaultRule`

_Optional_
_Optional, Default=Host(`{{ normalize .Name }}`)_

The default host rule for all services.

For a given container if no routing rule was defined by a label, it is defined by this defaultRule instead.
It must be a valid [Go template](https://golang.org/pkg/text/template/),
augmented with the [sprig template functions](http://masterminds.github.io/sprig/).
The service name can be accessed as the `Name` identifier,
and the template has access to all the labels defined on this container.

```toml
defaultRule = "Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"
```

This option can be overridden on a container basis with the `traefik.http.routers.Router1.rule` label.

### `EnableServiceHealthFilter`
Expand Down