title: Kubernetes -- connect to multiple Endpoints on same NodePort
body: <p>Is there  a way for me to set up &gt;1 pods, each listening on their TargetPort, with a single Service for all pods that serves on a specified NodePort (e.g. 30000), and connect to both endpoints of pods on the same NodePort?</p>
  <p>I am testing on docker-desktop with 2 pods serving data. I can connect to the first pod on localholdt:30000 (NodePort on Service is 30000), but when I try to connect a second client, it hangs. I thought the Service would automatically connect the second client to the second pod's endpoint, but that doesn't seem to be the case.</p>
  <p>My Service <code>describe</code> is:</p>
  <pre><code>Name:                     replica1-gsewz
  Namespace:                default
  Labels:                   app=cnpquery
                            app.group.com/partitionreplica=replica1
                            app.group.com/serviceMetatag=podselector1
  Annotations:              &lt;none&gt;
  Selector:                 app.group.com/serviceMetatag=podselector1
  Type:                     NodePort
  IP:                       10.98.212.171
  LoadBalancer Ingress:     localhost
  Port:                     http  5000/TCP
  TargetPort:               5000/TCP
  NodePort:                 http  30000/TCP
  Endpoints:                10.1.0.92:5000,10.1.0.93:5000
  Session Affinity:         None
  External Traffic Policy:  Cluster
  Events:                   &lt;none&gt;
  </code></pre>
  <p>Edit:</p>
  <p>The setup is as follows:</p>
  <ul>
  <li>pods are deployed with a server application on them. The server app listens on the pod's port 5000.</li>
  <li>The Service, afaik, forwards any and all requests on the node's port 30000 to the pod's port 5000</li>
  <li>I am on docker desktop, so I use docker's proxy to connect to port 30000 on my local machine, i.e. at http://localhost:30000</li>
  <li>On my local machine, I have a client machine that sends things to port 30000, and gets respones back from the pod's server.</li>
  <li>This setup works with a single pod (i.e I can send and receive messages on the node:30000--5000:port connection</li>
  <li>But when I spin up a second pod and try to connect to it on localhost:30000, it hangs</li>
  </ul>