I would like to be able to create a pod in Kubernetes and expose a port and be able to reach the exposed port using a domain name (myservice.example.com)
I saw that this is possible using a Load Balancer but in that case every network communication has to go through the Load Balancer and it seems to be a network bottleneck. It is possible using Kubernetes to access directly the node using a domain name (dynamically created for each pod) ?
Thanks.
If accessing the service through a high port (default range: 30000-32767) is not an issue you can setup your service to use type NodePort and access it through myservice.example.com:30080
.
If that is not acceptable, your other option is to setup an Ingress controller and route to different services based on domain name. You can then scale out the Ingress as needed.
Having dynamic exposed domain names to each pod doesn't make much sense because ideally you want to expose services, not individual pods (which have unpredictable lifetimes).
Maybe u should try the NodePort service