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.
[entryPoints]
[entryPoints.web]
address = ":80"
#compress = true
[entryPoints.websecure]
address = ":443"
[entryPoints.websecure.forwardedHeaders]
insecure = true
[entryPoints.ping]
address = ":8082"
[entryPoints.metrics]
address = ":8083"
My end goal is to be able to connect at pg.cli-api.fun with something like below, not sure which port will work here.
PGPASSWORD=docker psql -h pg.cli-api.fun -p <some_port> -U postgres -w