这是我在docker swarm中运行的traefik集群的配置。我可以通过portainer看到一切都在运行,但是在http://docker-swarm-manager.blablabla:80或:8080或:8081或:8082看不到任何东西。
我想检查Web UI以确定一切是否正常,但是我对这些主题的了解有限,而且调试起来很困难。
配置:
traefik.dev.yml
version: '3.6'
networks:
traefik:
driver: overlay
configs:
traefik:
file: ./config.dev.toml
volumes:
consul-data:
driver: local
services:
traefik_init:
image: traefik:v1.6
entrypoint:
- '/traefik'
- 'storeconfig'
- '--configfile=/traefik.toml'
configs:
- source: traefik
target: /traefik.toml
deploy:
placement:
constraints:
- node.role == manager
restart_policy:
condition: on-failure
depends_on:
- consul
networks:
- traefik
traefik:
image: traefik:1.6
depends_on:
- traefik_init
- consul
command:
- '--consul'
- '--consul.endpoint=traefik_consul:8500'
- '--consul.prefix=traefik'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- traefik
ports:
- target: 80
published: 80
mode: host
- target: 443
published: 443
mode: host
- target: 8080
published: 8080
mode: host
- target: 8081
published: 8081
mode: host
- target: 8082
published: 8082
mode: host
deploy:
mode: global
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
consul:
image: consul
command: agent -server -bootstrap-expect=1
volumes:
- consul-data:/consul/data
environment:
- CONSUL_LOCAL_CONFIG={"datacenter":"us_east2","server":true}
- CONSUL_BIND_INTERFACE=eth0
- CONSUL_CLIENT_INTERFACE=eth0
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
restart_policy:
condition: on-failure
networks:
- traefik
config.dev.toml
defaultEntryPoints = ["http"]
[entryPoints]
[entryPoints.http]
address = ":80"
compress = true
[entryPoints.api]
address = ":8081"
[entryPoints.ping]
address = ":8082"
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "traefik"
swarmmode = true
watch = true
[api]
entryPoint = "api"
dashboard = true
[ping]
entryPoint = "ping"
[retry]
logLevel = "INFO"
[accessLog]
format = "json"
[consul]
endpoint = "traefik_consul:8500"
prefix = "traefik"
[tracing]
backend = "zipkin"
serviceName = "traefik"
[tracing.zipkin]
httpEndpoint = "http://zipkin:9411/api/v1/spans"