doc(constraints): Added in ConsulCatalog backend + new 'Constraint' section
This commit is contained in:
parent
ac087921d8
commit
cd2100ed84
1 changed files with 52 additions and 0 deletions
52
docs/toml.md
52
docs/toml.md
|
@ -195,6 +195,51 @@ entryPoint = "https"
|
|||
main = "local4.com"
|
||||
```
|
||||
|
||||
## Constraints
|
||||
|
||||
In a micro-service architecture, with a central service discovery, setting constraints limits Træfɪk scope to a smaller number of routes.
|
||||
|
||||
Træfɪk filters services according to service attributes/tags set in your configuration backends.
|
||||
|
||||
Supported backends:
|
||||
|
||||
- Consul Catalog
|
||||
|
||||
Supported filters:
|
||||
|
||||
- ```tag```
|
||||
|
||||
```
|
||||
# Constraints definition
|
||||
|
||||
#
|
||||
# Optional
|
||||
#
|
||||
|
||||
# Simple matching constraint
|
||||
# constraints = ["tag==api"]
|
||||
|
||||
# Simple mismatching constraint
|
||||
# constraints = ["tag!=api"]
|
||||
|
||||
# Globbing
|
||||
# constraints = ["tag==us-*"]
|
||||
|
||||
# Backend-specific constraint
|
||||
# [consulCatalog]
|
||||
# endpoint = 127.0.0.1:8500
|
||||
# constraints = ["tag==api"]
|
||||
|
||||
# Multiple constraints
|
||||
# - "tag==" must match with at least one tag
|
||||
# - "tag!=" must match with none of tags
|
||||
# constraints = ["tag!=us-*", "tag!=asia-*"]
|
||||
# [consulCatalog]
|
||||
# endpoint = 127.0.0.1:8500
|
||||
# constraints = ["tag==api", "tag!=v*-beta"]
|
||||
```
|
||||
|
||||
|
||||
# Configuration backends
|
||||
|
||||
## File backend
|
||||
|
@ -741,6 +786,13 @@ domain = "consul.localhost"
|
|||
# Optional
|
||||
#
|
||||
prefix = "traefik"
|
||||
|
||||
# Constraint on Consul catalog tags
|
||||
#
|
||||
# Optional
|
||||
#
|
||||
constraints = ["tag==api", "tag==he*ld"]
|
||||
# Matching with containers having this tag: "traefik.tags=api,helloworld"
|
||||
```
|
||||
|
||||
This backend will create routes matching on hostname based on the service name
|
||||
|
|
Loading…
Reference in a new issue