jittering / traefik-kop

A dynamic docker->redis->traefik discovery agent
MIT License
179 stars 13 forks source link

TCP rules not being published #35

Closed heyfordy closed 2 months ago

heyfordy commented 4 months ago

Hi,

I'm trying to create a TCP router alongside my http router for a container. It looks like the http rule gets published, but the tcp one does not:

time="2024-05-03T05:30:46Z" level=info msg="publishing http://192.168.22.10:9001" service=mqtt@docker service-type=http

Here's the config from the container's compose.yml:

    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.mqtt.rule=Host(`mqtt.local`)"
      - "traefik.http.services.mqtt.loadbalancer.server.port=9001"
      # MQTT routing
      - "traefik.tcp.routers.mqtt.rule=HostSNI(`*`)"
      - "traefik.tcp.routers.mqtt.entrypoints=mqtt"
      - "traefik.tcp.routers.mqtt.service=service-broker-mqtt"
      - "traefik.tcp.services.mqtt.loadbalancer.server.port=1883"

Is this expected or is there some configuration I am missing?

Cheers

chetan commented 3 months ago

It should work and I have a test using gitea here. It's possible you may find some useful info if you enable debug logging but I'll see if tcp is still working as I haven't tested it specifically in a while.

Looks like your config is very similar but can you post the rest of the service config so I can test as well? Probably just need to know which image here.

chetan commented 2 months ago

Finally got around to testing this and it looks like TCP (and UDP) ports being published correctly, there just wasn't a log message added for them. Fixed now.