Traefik IngressRouteTcp expose K3s service bitnami/PostgreSQL-HA not working

Hello,
I've installed Traefik with HELM setting the new entry point "postgres"

ports:
  postgres:
    port: 5432
    expose: true
    exposedPort: 5432
    protocol: TCP

kubectl describe deployments.apps traefik | grep 5432

Ports:       9100/TCP, 5432/TCP, 9000/TCP, 8000/TCP, 8443/TCP
  --entrypoints.postgres.address=:5432/tcp

I can see that the deployment of traefik contains the 5432 port and that the new entry point has been added.

kubectl get endpoints | grep 5432

postgresql-postgresql-ha-pgpool 10.42.2.164:5432 2d3h
postgresql-postgresql-ha-postgresql 10.42.1.185:5432 2d3h
postgresql-postgresql-ha-postgresql-headless 10.42.1.185:5432 2d3h
traefik 10.42.1.235:5432,10.42.1.235:8000,10.42.1.235:8443 3h

I can see also that the services of Postgres have been created and that the port 5432 is configured in traefik.

I've created the following IngressRouteTcp


apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
  name: postgresqlss
  namespace: tandemblind
spec:
  entryPoints:
    - postgres
  routes:
   -  match: HostSNI(`*`)
      services:
        - name: postgresql-postgresql-ha-postgresql-headless
          port: 5432

looking the logs of the traefik pod I don't see any error related to this IngressRouteTCP.

I've tried also to use the other two services of Postgres postgresql-postgresql-ha-postgresql and the pool but the issue is the same. I cannot reach postgresql from outside.

from the traefik dashboard I can see that the router and service have been created and there aren't errors.

if I run sudo nmap -sS -p 5432 -v postgresql.tandemblind.com

I can see 5432/tcp filtered postgresql

Can someone tell me what I'm doing wrong? I've followed plenty of articles but I didn't manage to expose the db on internet(only for dev/test purpose).

Thanks in advance!

Hello @Angelo,

Thanks for your interest in Traefik!

Are they other routers attached to the postgres entryPoint?

Hello,
thanks for your reply, Finally I managed to fix the issue.

It was my bad, I hadn't realized that the port was blocked by the cloud provider.

I've opened the port and everything worked as expected (after 1 week finally I managed :S ) !

I hope that will save some time to some other people with the same issue.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.