make docs more clear about how to work with the current api
This commit is contained in:
parent
521e295349
commit
a0c3d6a421
3 changed files with 19 additions and 23 deletions
17
docs/toml.md
17
docs/toml.md
|
@ -1583,25 +1583,24 @@ ExposedByDefault = false
|
||||||
|
|
||||||
# Endpoint to use when connecting to Rancher
|
# Endpoint to use when connecting to Rancher
|
||||||
#
|
#
|
||||||
# Optional
|
# Required
|
||||||
# Endpoint = "http://rancherserver.example.com"
|
# Endpoint = "http://rancherserver.example.com/v1"
|
||||||
|
|
||||||
# AccessKey to use when connecting to Rancher
|
# AccessKey to use when connecting to Rancher
|
||||||
#
|
#
|
||||||
# Optional
|
# Required
|
||||||
# AccessKey = "XXXXXXXXX"
|
# AccessKey = "XXXXXXXXXXXXXXXXXXXX"
|
||||||
|
|
||||||
# SecretKey to use when connecting to Rancher
|
# SecretKey to use when connecting to Rancher
|
||||||
#
|
#
|
||||||
# Optional
|
# Required
|
||||||
# SecretKey = "XXXXXXXXXXX"
|
# SecretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you're deploying traefik as a service within rancher, you can alternatively set these labels on the service to let it only fetch data of its current environment. The settings `endpoint`, `accesskey` and `secretkey` can be omitted then.
|
As traefik needs access to the rancher API, you need to set the `endpoint`, `accesskey` and `secretkey` parameters.
|
||||||
|
|
||||||
- `io.rancher.container.create_agent=true`
|
To enable traefik to fetch information about the Environment it's deployed in only, you need to create an `Environment API Key`. This can be found within the API Key advanced options.
|
||||||
- `io.rancher.container.agent.role=environment`
|
|
||||||
|
|
||||||
Labels can be used on task containers to override default behaviour:
|
Labels can be used on task containers to override default behaviour:
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
traefik:
|
traefik:
|
||||||
image: traefik
|
image: traefik
|
||||||
command: --web --rancher --rancher.domain=rancher.localhost --logLevel=DEBUG
|
command: --web --rancher --rancher.domain=rancher.localhost --rancher.endpoint=http://example.com --rancher.accesskey=XXXXXXX --rancher.secretkey=YYYYYY --logLevel=DEBUG
|
||||||
labels:
|
|
||||||
io.rancher.container.agent.role: environment
|
|
||||||
io.rancher.container.create_agent: 'true'
|
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
|
|
|
@ -1006,43 +1006,43 @@
|
||||||
#
|
#
|
||||||
# Optional
|
# Optional
|
||||||
#
|
#
|
||||||
#[rancher]
|
# [rancher]
|
||||||
|
|
||||||
# Default domain used.
|
# Default domain used.
|
||||||
# Can be overridden by setting the "traefik.domain" label on an service.
|
# Can be overridden by setting the "traefik.domain" label on an service.
|
||||||
#
|
#
|
||||||
# Required
|
# Required
|
||||||
#
|
#
|
||||||
#domain = "rancher.localhost"
|
# domain = "rancher.localhost"
|
||||||
|
|
||||||
# Enable watch Rancher changes
|
# Enable watch Rancher changes
|
||||||
#
|
#
|
||||||
# Optional
|
# Optional
|
||||||
# Default: true
|
# Default: true
|
||||||
#
|
#
|
||||||
#Watch = true
|
# Watch = true
|
||||||
|
|
||||||
# Expose Rancher services by default in traefik
|
# Expose Rancher services by default in traefik
|
||||||
#
|
#
|
||||||
# Optional
|
# Optional
|
||||||
# Default: true
|
# Default: true
|
||||||
#
|
#
|
||||||
#ExposedByDefault = false
|
# ExposedByDefault = false
|
||||||
|
|
||||||
# Endpoint to use when connecting to Rancher
|
# Endpoint to use when connecting to Rancher
|
||||||
#
|
#
|
||||||
# Optional
|
# Required
|
||||||
# Endpoint = "http://rancherserver.example.com"
|
# Endpoint = "http://rancherserver.example.com/v1"
|
||||||
|
|
||||||
# AccessKey to use when connecting to Rancher
|
# AccessKey to use when connecting to Rancher
|
||||||
#
|
#
|
||||||
# Optional
|
# Required
|
||||||
# AccessKey = "XXXXXXXXX"
|
# AccessKey = "XXXXXXXXXXXXXXXXXXXX"
|
||||||
|
|
||||||
# SecretKey to use when connecting to Rancher
|
# SecretKey to use when connecting to Rancher
|
||||||
#
|
#
|
||||||
# Optional
|
# Required
|
||||||
# SecretKey = "XXXXXXXXXXX"
|
# SecretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||||
|
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
|
|
Loading…
Reference in a new issue