Name based virtual hosting for TCP and UDP traffic

Is it possible to do something similar to name based virtual hosting, but with TCP and UDP traffic, instead of HTTP?

So that it is possible to direct a FQDN to a specific TDP/UDP service or pod inside the cluster.

I can’t currently see this in the Gateway API or Ingress documentation.

It works for HTTP because “hostname” is (optionally) part of the L7 protocol. The server listening on port 80 can look at the “hostname” field or the SNI and route traffic.

Arbitrary TCP and UDP do not have a defined L7 protocol that can be examined.

So the short answer is “not in the same way”. You either need an FQDN+IP for each service (where ach one can use whatever port(s) they want, Service type=LoadBalancer does this) or you can share a pool of IPs (could be 1 or more) and give each Service a different port (coordinating across services).

1 Like

I was afraid that was the case. Thanks for the clear answer!

Note that there ARE some implementation of load-balancers that do TCP-over-TLS and could support SNI based routing.