Remove Rancher v1 provider
This commit is contained in:
parent
7129f03dc9
commit
2ad1fd725a
66 changed files with 10 additions and 3316 deletions
|
@ -142,7 +142,6 @@ Below is the list of the currently supported providers in Traefik.
|
|||
| [Nomad](./nomad.md) | Orchestrator | Label | `nomad` |
|
||||
| [ECS](./ecs.md) | Orchestrator | Label | `ecs` |
|
||||
| [Marathon](./marathon.md) | Orchestrator | Label | `marathon` |
|
||||
| [Rancher](./rancher.md) | Orchestrator | Label | `rancher` |
|
||||
| [File](./file.md) | Manual | YAML/TOML format | `file` |
|
||||
| [Consul](./consul.md) | KV | KV | `consul` |
|
||||
| [Etcd](./etcd.md) | KV | KV | `etcd` |
|
||||
|
@ -216,7 +215,6 @@ List of providers that support these features:
|
|||
- [ECS](./ecs.md#exposedbydefault)
|
||||
- [Consul Catalog](./consul-catalog.md#exposedbydefault)
|
||||
- [Nomad](./nomad.md#exposedbydefault)
|
||||
- [Rancher](./rancher.md#exposedbydefault)
|
||||
- [Marathon](./marathon.md#exposedbydefault)
|
||||
|
||||
### Constraints
|
||||
|
@ -227,7 +225,6 @@ List of providers that support constraints:
|
|||
- [ECS](./ecs.md#constraints)
|
||||
- [Consul Catalog](./consul-catalog.md#constraints)
|
||||
- [Nomad](./nomad.md#constraints)
|
||||
- [Rancher](./rancher.md#constraints)
|
||||
- [Marathon](./marathon.md#constraints)
|
||||
- [Kubernetes CRD](./kubernetes-crd.md#labelselector)
|
||||
- [Kubernetes Ingress](./kubernetes-ingress.md#labelselector)
|
||||
|
|
|
@ -1,286 +0,0 @@
|
|||
---
|
||||
title: ""Traefik Configuration Discovery: Rancher""
|
||||
description: "Read the official Traefik documentation to learn how to expose Rancher services by default in Traefik Proxy."
|
||||
---
|
||||
|
||||
# Traefik & Rancher
|
||||
|
||||
A Story of Labels, Services & Containers
|
||||
{: .subtitle }
|
||||
|
||||

|
||||
|
||||
Attach labels to your services and let Traefik do the rest!
|
||||
|
||||
!!! important "This provider is specific to Rancher 1.x."
|
||||
|
||||
Rancher 2.x requires Kubernetes and does not have a metadata endpoint of its own for Traefik to query.
|
||||
As such, Rancher 2.x users should utilize the [Kubernetes CRD provider](./kubernetes-crd.md) directly.
|
||||
|
||||
## Configuration Examples
|
||||
|
||||
??? example "Configuring Rancher & Deploying / Exposing Services"
|
||||
|
||||
Enabling the Rancher provider
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher: {}
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher=true
|
||||
```
|
||||
|
||||
Attaching labels to services
|
||||
|
||||
```yaml
|
||||
labels:
|
||||
- traefik.http.services.my-service.rule=Host(`example.com`)
|
||||
```
|
||||
|
||||
## Routing Configuration
|
||||
|
||||
See the dedicated section in [routing](../routing/providers/rancher.md).
|
||||
|
||||
## Provider Configuration
|
||||
|
||||
??? tip "Browse the Reference"
|
||||
|
||||
For an overview of all the options that can be set with the Rancher provider, see the following snippets:
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
--8<-- "content/providers/rancher.yml"
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
--8<-- "content/providers/rancher.toml"
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--8<-- "content/providers/rancher.txt"
|
||||
```
|
||||
|
||||
### `exposedByDefault`
|
||||
|
||||
_Optional, Default=true_
|
||||
|
||||
Expose Rancher services by default in Traefik.
|
||||
If set to `false`, services that do not have a `traefik.enable=true` label are ignored from the resulting routing configuration.
|
||||
|
||||
For additional information, refer to [Restrict the Scope of Service Discovery](./overview.md#restrict-the-scope-of-service-discovery).
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
exposedByDefault: false
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
exposedByDefault = false
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.exposedByDefault=false
|
||||
# ...
|
||||
```
|
||||
|
||||
### `defaultRule`
|
||||
|
||||
_Optional, Default=```Host(`{{ normalize .Name }}`)```_
|
||||
|
||||
The default host rule for all services.
|
||||
|
||||
The `defaultRule` option defines what routing rule to apply to a container if no rule is defined by a label.
|
||||
|
||||
It must be a valid [Go template](https://pkg.go.dev/text/template/), and can use
|
||||
[sprig template functions](https://masterminds.github.io/sprig/).
|
||||
The service name can be accessed with the `Name` identifier,
|
||||
and the template has access to all the labels defined on this container.
|
||||
|
||||
This option can be overridden on a container basis with the `traefik.http.routers.Router1.rule` label.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
defaultRule: "Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
defaultRule = "Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)"
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.defaultRule=Host(`{{ .Name }}.{{ index .Labels \"customLabel\"}}`)
|
||||
# ...
|
||||
```
|
||||
|
||||
### `enableServiceHealthFilter`
|
||||
|
||||
_Optional, Default=true_
|
||||
|
||||
Filter out services with unhealthy states and inactive states.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
enableServiceHealthFilter: false
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
enableServiceHealthFilter = false
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.enableServiceHealthFilter=false
|
||||
# ...
|
||||
```
|
||||
|
||||
### `refreshSeconds`
|
||||
|
||||
_Optional, Default=15_
|
||||
|
||||
Defines the polling interval (in seconds).
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
refreshSeconds: 30
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
refreshSeconds = 30
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.refreshSeconds=30
|
||||
# ...
|
||||
```
|
||||
|
||||
### `intervalPoll`
|
||||
|
||||
_Optional, Default=false_
|
||||
|
||||
Poll the Rancher metadata service for changes every `rancher.refreshSeconds`,
|
||||
which is less accurate than the default long polling technique which provides near instantaneous updates to Traefik.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
intervalPoll: true
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
intervalPoll = true
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.intervalPoll=true
|
||||
# ...
|
||||
```
|
||||
|
||||
### `prefix`
|
||||
|
||||
_Optional, Default="/latest"_
|
||||
|
||||
Prefix used for accessing the Rancher metadata service.
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
prefix: "/test"
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
prefix = "/test"
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.prefix=/test
|
||||
# ...
|
||||
```
|
||||
|
||||
### `constraints`
|
||||
|
||||
_Optional, Default=""_
|
||||
|
||||
The `constraints` option can be set to an expression that Traefik matches against the container labels to determine whether
|
||||
to create any route for that container. If none of the container tags match the expression, no route for that container is
|
||||
created. If the expression is empty, all detected containers are included.
|
||||
|
||||
The expression syntax is based on the `Label("key", "value")`, and `LabelRegex("key", "value")` functions, as well as
|
||||
the usual boolean logic, as shown in examples below.
|
||||
|
||||
??? example "Constraints Expression Examples"
|
||||
|
||||
```toml
|
||||
# Includes only containers having a label with key `a.label.name` and value `foo`
|
||||
constraints = "Label(`a.label.name`, `foo`)"
|
||||
```
|
||||
|
||||
```toml
|
||||
# Excludes containers having any label with key `a.label.name` and value `foo`
|
||||
constraints = "!Label(`a.label.name`, `value`)"
|
||||
```
|
||||
|
||||
```toml
|
||||
# With logical AND.
|
||||
constraints = "Label(`a.label.name`, `valueA`) && Label(`another.label.name`, `valueB`)"
|
||||
```
|
||||
|
||||
```toml
|
||||
# With logical OR.
|
||||
constraints = "Label(`a.label.name`, `valueA`) || Label(`another.label.name`, `valueB`)"
|
||||
```
|
||||
|
||||
```toml
|
||||
# With logical AND and OR, with precedence set by parentheses.
|
||||
constraints = "Label(`a.label.name`, `valueA`) && (Label(`another.label.name`, `valueB`) || Label(`yet.another.label.name`, `valueC`))"
|
||||
```
|
||||
|
||||
```toml
|
||||
# Includes only containers having a label with key `a.label.name` and a value matching the `a.+` regular expression.
|
||||
constraints = "LabelRegex(`a.label.name`, `a.+`)"
|
||||
```
|
||||
|
||||
For additional information, refer to [Restrict the Scope of Service Discovery](./overview.md#restrict-the-scope-of-service-discovery).
|
||||
|
||||
```yaml tab="File (YAML)"
|
||||
providers:
|
||||
rancher:
|
||||
constraints: "Label(`a.label.name`,`foo`)"
|
||||
# ...
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[providers.rancher]
|
||||
constraints = "Label(`a.label.name`,`foo`)"
|
||||
# ...
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--providers.rancher.constraints=Label(`a.label.name`,`foo`)
|
||||
# ...
|
||||
```
|
|
@ -1,20 +0,0 @@
|
|||
# Enable Rancher Provider.
|
||||
[providers.rancher]
|
||||
|
||||
# Expose Rancher services by default in Traefik.
|
||||
exposedByDefault = true
|
||||
|
||||
# Enable watch Rancher changes.
|
||||
watch = true
|
||||
|
||||
# Filter services with unhealthy states and inactive states.
|
||||
enableServiceHealthFilter = true
|
||||
|
||||
# Defines the polling interval (in seconds).
|
||||
refreshSeconds = 15
|
||||
|
||||
# Poll the Rancher metadata service for changes every `rancher.refreshSeconds`, which is less accurate
|
||||
intervalPoll = false
|
||||
|
||||
# Prefix used for accessing the Rancher metadata service
|
||||
prefix = "/latest"
|
|
@ -1,20 +0,0 @@
|
|||
# Enable Rancher Provider.
|
||||
--providers.rancher=true
|
||||
|
||||
# Expose Rancher services by default in Traefik.
|
||||
--providers.rancher.exposedByDefault=true
|
||||
|
||||
# Enable watch Rancher changes.
|
||||
--providers.rancher.watch=true
|
||||
|
||||
# Filter services with unhealthy states and inactive states.
|
||||
--providers.rancher.enableServiceHealthFilter=true
|
||||
|
||||
# Defines the polling interval (in seconds).
|
||||
--providers.rancher.refreshSeconds=15
|
||||
|
||||
# Poll the Rancher metadata service for changes every `rancher.refreshSeconds`, which is less accurate
|
||||
--providers.rancher.intervalPoll=false
|
||||
|
||||
# Prefix used for accessing the Rancher metadata service
|
||||
--providers.rancher.prefix=/latest
|
|
@ -1,21 +0,0 @@
|
|||
# Enable Rancher Provider.
|
||||
providers:
|
||||
rancher:
|
||||
|
||||
# Expose Rancher services by default in Traefik.
|
||||
exposedByDefault: true
|
||||
|
||||
# Enable watch Rancher changes.
|
||||
watch: true
|
||||
|
||||
# Filter services with unhealthy states and inactive states.
|
||||
enableServiceHealthFilter: true
|
||||
|
||||
# Defines the polling interval (in seconds).
|
||||
refreshSeconds: 15
|
||||
|
||||
# Poll the Rancher metadata service for changes every `rancher.refreshSeconds`, which is less accurate
|
||||
intervalPoll: false
|
||||
|
||||
# Prefix used for accessing the Rancher metadata service
|
||||
prefix: /latest
|
Loading…
Add table
Add a link
Reference in a new issue