I just set up the same solution we are running on some other data centers without any issues.
However, all the services just return "Bad Gateway" in the browser.
This is a docker swarm network, and Traefik is running on the swarm manager.
We are running Traefik v2.0.4
Docker is running version 19.03.4
Traefik is launched through a stack with the following configuration:
version: '3.7'
services:
traefik:
image: traefik:v2.0.2
command:
- "--api=true"
- "--api.insecure=true"
- "--api.dashboard=true"
- "--ping"
- "--providers.docker=true"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.network=traefik-public"
- "--providers.docker.swarmMode=true"
- "--entrypoints.web.address=:80"
- "--accesslog=true"
- "--accesslog.bufferingsize=100"
- "--accesslog.filepath=/var/log/traefik.log"
- "--metrics.prometheus=true"
- "--entryPoints.metrics.address=:8082"
- "--metrics.prometheus.entryPoint=metrics"
- "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
- "--tracing.jaeger=true"
- "--tracing.jaeger.samplingServerURL=http://localhost:5778/sampling"
- "--tracing.jaeger.samplingType=const"
- "--tracing.jaeger.samplingParam=1.0"
- "--tracing.jaeger.localAgentHostPort=127.0.0.1:6831"
- "--tracing.jaeger.propagation=jaeger"
- "--tracing.jaeger.traceContextHeaderName=uber-trace-id"
ports:
- 80:80
- 8081:8080
- 8082:8082
networks:
- monitor-net
- traefik-public
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/log/traefik.log:/var/log/traefik.log
deploy:
placement:
constraints:
- node.role == manager
labels:
- "traefik.docker.network=traefik-public"
networks:
monitor-net:
traefik-public:
driver: overlay
external: true
And then a service is added through another stack with the following configuration. This is running on a docker node in the swarm:
version: '3.7'
services:
backend:
image: enevodocker/enevoleadsbe:production
ports:
- 5000
environment:
- SERVICE_PORTS=5000
- ASPNETCORE_ENVIRONMENT=Production
deploy:
labels:
- "traefik.http.routers.byndlebackendrouter.rule=Host(`api.byndle.no`)"
- "traefik.http.services.byndlebackendservice.loadbalancer.server.port=5000"
- "traefik.http.services.byndlebackendservice.loadbalancer.sticky=true"
- "traefik.http.services.byndlebackendservice.loadbalancer.sticky.cookie.httponly=false"
- "traefik.http.services.byndlebackendservice.loadbalancer.sticky.cookie.name=bndlstickyroute"
- "traefik.http.services.byndlebackendservice.loadbalancer.sticky.cookie.secure=false"
replicas: 6
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 2
window: 60s
placement:
constraints: [node.role != manager]
networks:
- web
- traefik-public
volumes:
- type: volume
source: leads
target: /leads
volume:
nocopy: true
frontend:
image: enevodocker/enevoleadsfe:production
ports:
- 80
environment:
- SERVICE_PORTS=80
deploy:
labels:
- "traefik.http.routers.portalproxy.rule=Host(`portal.byndle.no`)"
- "traefik.http.services.portalservice.loadbalancer.server.port=80"
- "traefik.docker.network=traefik-public"
replicas: 4
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
max_attempts: 2
window: 60s
placement:
constraints: [node.role != manager]
networks:
- web
- traefik-public
labels:
- "traefik.docker.network=traefik-public"
volumes:
leads:
driver: nfs
driver_opts:
share: 10.47.2.20:/diskstation/byndle
redis-data:
solrdata:
driver: nfs
driver_opts:
share: 10.47.2.20:/diskstation/byndle/solr
networks:
web:
driver: overlay
external: false
traefik-public:
driver: overlay
external: true
When I inspect the traefik container, as well ad the frontend container, both are connected to the traefik-public networks.
Now, if I visit http://myportal.no it just returns "bad gateway".
I am now stuck in debugging this, and can't find anything to go further with.
I have tried deleting the network, adding it again, deleting the stacks and adding them again and so on.
Anyone with any further suggestions?