我很难让Traefik看到我添加到Rancher 1.6的服务。我可以加载UI很好,它只说0个前端0个后端。
尝试了带有以下标签但没有运气的新服务:
traefik.enable=true
traefik.backend=foo
traefik.domain=bar
这是我的toml:
[traefikLog]
filePath = "/etc/traefik/logs/traefik.log"
format = "json"
[accessLog]
filePath = "/etc/traefik/logs/access.log"
format = "json"
# Entrypoints definition
#
# Default:
# [entryPoints]
# [entryPoints.http]
# address = ":80"
#
#[entryPoints]
# [entryPoints.http]
# address = ":80"
# API definition
[api]
# Name of the related entry point
#
# Optional
# Default: "traefik"
#
entryPoint = "traefik"
# Enabled Dashboard
#
# Optional
# Default: true
#
dashboard = true
# Enable debug mode.
# This will install HTTP handlers to expose Go expvars under
/debug/vars and
# pprof profiling data under /debug/pprof/.
# Additionally, the log level will be set to DEBUG.
#
# Optional
# Default: false
#
debug = true
################################################################
# Rancher Provider
################################################################
# Enable Rancher Provider.
[rancher]
# Default domain used.
# Can be overridden by setting the "traefik.domain" label on an
service.
#
# Required
#
domain = "rancher.localhost"
# Enable watch Rancher changes.
#
# Optional
# Default: true
#
watch = true
# Polling interval (in seconds).
#
# Optional
# Default: 15
#
refreshSeconds = 15
# Expose Rancher services by default in Traefik.
#
# Optional
# Default: true
#
#exposedByDefault = false
# Filter services with unhealthy states and inactive states.
#
# Optional
# Default: false
#
enableServiceHealthFilter = true
# Override default configuration template.
# For advanced users :)
#
# Optional
#
# filename = "rancher.tmpl"
# Override template version
# For advanced users :)
#
# Optional
# - "1": previous template version (must be used only with older
custom templates, see "filename")
# - "2": current template version (must be used to force template
version when "filename" is used)
#
templateVersion = 2
# Enable Rancher metadata service provider instead of the API
# provider.
#
# 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"
任何指导将不胜感激。谢谢! 也作为教育的补充说明。使用元数据和api相比有好处吗?我应该选择一个而不是另一个吗?再次感谢!