diff --git a/docs/toml.md b/docs/toml.md index 917a1336e..cede939ff 100644 --- a/docs/toml.md +++ b/docs/toml.md @@ -1681,33 +1681,68 @@ RefreshSeconds = 15 # ExposedByDefault = false -# Filter services with unhealthy states and health states +# Filter services with unhealthy states and inactive states # # Optional # Default: false # -EnableServiceHealthFilter = false - -# Endpoint to use when connecting to Rancher -# -# Required -# Endpoint = "http://rancherserver.example.com/v1" - -# AccessKey to use when connecting to Rancher -# -# Required -# AccessKey = "XXXXXXXXXXXXXXXXXXXX" - -# SecretKey to use when connecting to Rancher -# -# Required -# SecretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - +EnableServiceHealthFilter = true ``` -As traefik needs access to the rancher API, you need to set the `endpoint`, `accesskey` and `secretkey` parameters. +```toml +# Enable Rancher metadata service configuration backend instead of the API +# configuration backend +# +# Optional +# Default: false +# +[rancher.metadata] -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. +# Poll the Rancher metadata service for changes every `rancher.RefreshSeconds` +# NOTE: this is less accurate than the default long polling technique which +# will provide near instantaneous updates to Traefik +# +# Optional +# Default: false +# +IntervalPoll = true + +# Prefix used for accessing the Rancher metadata service +# +# Optional +# Default: "/latest" +# +Prefix = "/2016-07-29" +``` + +```toml +# Enable Rancher API configuration backend +# +# Optional +# Default: true +# +[rancher.api] + +# Endpoint to use when connecting to the Rancher API +# +# Required +Endpoint = "http://rancherserver.example.com/v1" + +# AccessKey to use when connecting to the Rancher API +# +# Required +AccessKey = "XXXXXXXXXXXXXXXXXXXX" + +# SecretKey to use when connecting to the Rancher API +# +# Required +SecretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +``` + +If Traefik needs access to the Rancher API, you need to set the `endpoint`, `accesskey` and `secretkey` parameters. + +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. Labels can be used on task containers to override default behaviour: diff --git a/provider/rancher/rancher.go b/provider/rancher/rancher.go index e7c5c9f7a..0134c0703 100644 --- a/provider/rancher/rancher.go +++ b/provider/rancher/rancher.go @@ -126,7 +126,7 @@ func (p *Provider) getBackend(service rancherData) string { return provider.Normalize(service.Name) } -// Generall Application Stuff +// General Application Stuff func (p *Provider) getPort(service rancherData) string { if label, err := getServiceLabel(service, "traefik.port"); err == nil { return label diff --git a/traefik.sample.toml b/traefik.sample.toml index 1275b9ce7..c86f82aec 100644 --- a/traefik.sample.toml +++ b/traefik.sample.toml @@ -1105,6 +1105,30 @@ # # EnableServiceHealthFilter = true +# Enable Rancher metadata service configuration backend instead of the API +# configuration backend +# +# Optional +# Default: false +# +# [rancher.metadata] + +# Poll the Rancher metadata service for changes every `rancher.RefreshSeconds` +# NOTE: this is less accurate than the default long polling technique which +# will provide near instantaneous updates to Traefik +# +# Optional +# Default: false +# +# IntervalPoll = true + +# Prefix used for accessing the Rancher metadata service +# +# Optional +# Default: "/latest" +# +# Prefix = "/2016-07-29" + # Enable Rancher API configuration backend # # Optional @@ -1127,37 +1151,6 @@ # Required # SecretKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -# Enable Rancher metadata service configuration backend instead of the API -# configuration backend -# -# Optional -# Default: false -# -# [rancher.metadataservice] - -# Poll the Rancher metadata service for changes every `rancher.RefreshSeconds` -# NOTE: this is less accurate than the default long polling technique which -# will provide near instantaneous updates to Traefik -# -# Optional -# Default: false -# -# IntervalPoll = true - -# Prefix used for accessing the Rancher metadata service -# -# Optional -# Default: "/latest" -# -# Prefix = "/2016-07-29" - -# Constraints -# -# Optional -# -# constraints = ["tag==api", "tag==chee*e"] -# Matching with containers having this tag: "traefik.tags=cheese,wine" - ################################################################ # DynamoDB configuration backend ################################################################