I'm running a Kubernetes cluster in a public cloud (Azure/AWS/Google Cloud), and I have some non-HTTP services I'd like to expose for users.
For HTTP services, I'd typically use an Ingress resource to expose that service publicly through an addressable DNS entry.
For non-HTTP, TCP-based services (e.g, a database such as PostgreSQL) how should I expose these for public consumption?
I considered using NodePort services, but this requires the nodes themselves to be publicly accessible (relying on kube-proxy to route to the appropriate node). I'd prefer to avoid this if possible.
LoadBalancer services seem like another option, though I don't want to create a dedicated cloud load balancer for each TCP service I want to expose.
I'm aware that the NGINX Ingress controller supports exposing TCP and UDP services, but that seems to require a static definition of the services you'd like to expose. For my use case, these services are being dynamically created and destroyed, so it's not possible to define these service mappings upfront in a static ConfigMap.