<p>I have a statfulset application which has a server running on port 1000 and has 3 replicas.
Now, I want to expose the application so I have used <code>type: NodePort</code>.
But, I also want 2 replicas to communicate with each other at the same port.
When I do nslookup in case of NodePort type application it gives only one dns name <code>&lt;svc_name&gt;.&lt;namespace&gt;.svc.cluster.local</code> (individual pods don't get a dns) and the application is exposed.</p>

<p>When I do <code>clusterIP: None</code> I get node specific DNS <code>&lt;statfulset&gt;.&lt;svc_name&gt;.&lt;namespace&gt;.svc.cluster.local</code> but application is not exposed. But both do not work together.
How can I achieve both, expose the same port for inter replica communication and expose same port externally?</p>

<p><strong>LoadBalancer:</strong> Exposes the service externally using a cloud provider’s load balancer. NodePort and ClusterIP services, to which the external load balancer will route, are automatically created.</p>
