配置 Traefik 以使用 Rancher 后端的正确方法是什么?

What is the correct way to configure Traefik to work with the Rancher backend?

我一直在尝试按照文档让 Traefik 与 Rancher 后端一起工作,但是在查看 Web 界面时,我总是看到一个完全空白的 Rancher 选项卡。

使用以下参数启动容器给我空白页:

--web.address=0.0.0.0:8080
--rancher 
--rancher.domain=subdomain.example.co.uk 
--rancher.endpoint=https://rancher.example.co.uk/v1
--rancher.accesskey=EXAMPLEKEY
--rancher.secretkey=EXAMPLESECRETKEY
--logLevel=DEBUG

同样,等效的配置文件给出相同的结果:

logLegel = "DEBUG"
defaultEntryPoints = ["http"]
[entryPoints]
  [entryPoints.http]
  address = ":80"

[web]
address = ":8080"

[rancher]
domain = "subdomain.example.co.uk"
  [rancher.api]
  endpoint = "https://rancher.example.co.uk/v1"
  accessKey = "EXAMPLEKEY"
  secretKey = "EXAMPLESECRETKEY"

日志包含它找到的每项服务的以下消息:

07/12/2017 15:21:33DEBU[2017-12-07T15:21:33Z] Filtering service service/stack-name without traefik.port label

Screenshot of blank Rancher tab

我已经在 1.4、1.5-rc1 和 1.5-rc2 版本上试过了。

Rancher 后端的说明没有提到必须设置 traefik.port 标签,我不想设置它。我只想在所有公开它的容器上使用端口 80。

看起来 traefik 可以正常连接到 Rancher。你们在Rancher的容器上设置了什么样的标签?阅读您的错误,Rancher 中的码头工人似乎需要这些标签:

traefik.port=12345

或者在 Rancher 的码头上添加一个映射端口。

虽然 Docker 后端按照请求的方式运行,但 Rancher 后端却没有。这没有记录,因为它不是它应该如何工作的。因此,开发人员建议我将其作为错误提出。可以在下面找到错误报告。

https://github.com/containous/traefik/issues/2541