I am using Traefik v2 on a kubernetes cluster which is working absolutely fine.
Now, I am trying to create a TCP router so that pg.cli-api.fun can load balance between the backend external (outside Kubernetes) application on tcp port 80
I have created this in my config file which seems to be working fine
yeah, you are right. I am just trying to see how TCP routing works with Traefik. To test things out, I have installed a postgres service now at port 5432 and have updated my config to this.
[tcp]
[tcp.routers]
[tcp.routers.pg-ha-cluster]
rule = "HostSNI(`pg.cli-api.fun`)"
service = "pg-service"
# will route TLS requests (and ignore non tls requests)
#[tcp.routers.pg-ha-cluster.tls]
# passthrough = true
[tcp.services]
[tcp.services.pg-service.loadBalancer]
[[tcp.services.pg-service.loadBalancer.servers]]
address = "192.168.0.75:5432"
I am not sure if this should be the correct config and maybe I need to add another entry point for just this TCP router? As of now, I have below entry points.
Oops, I picked up the wrong thing to test TCP out.
Hmm. What hostname will I use to connect to the service in this case?
Is there any example, I can follow to have a working TCP router? I have Googled and looked at the Traefik docs but could not find any.