1
traefik如何使用文件发现服务02
source link: http://yongqing.is-programmer.com/posts/216620.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
traefik如何使用文件发现服务02
traefik如何使用配置文件发现服务?
使用docker启动traefik, traefik使用配置文件, 并且服务也使用配置文件
通过docker-compose.yaml引用traefik.yml, config.yml
docker-compose.yaml
version: "3" services: reverse-proxy: #image: traefik:v2. 10 image: traefik:latest ports: - "80:80" - "8080:8080" volumes: - ./traefik.yml:/etc/traefik/traefik.yml - ./config.yml:/etc/traefik/config.yml whoami: image: containous/whoami ports: - "5000:80" |
traefik配置文件traefik.yml
api: insecure: true ... providers: file: filename: /etc/traefik/config.yml |
服务发现配置config.yml
http: routers: my-router: rule: "Path(`/whoami/`)" service: whoami services: whoami: loadBalancer: servers: - url: "http://xxxx:5000/" |
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK