<p>I deployment a kubernetes cluster with 5 nodes: matser worker1 worker2 worker3 worker4.</p>

<p>And I create a deployment with 1 replica, it was arranged on worker4, expose port 7777</p>

<p>create a service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: service-test
spec:
  type: NodePort
  selector:
    app: app
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 7777
      nodePort: 31000
</code></pre>

<p>After create service, I send a request to worker4:31000/test ,it responses immediately.</p>

<p>But when I request other nodes on 31000, such as master:31100/test , worker1:31100/test. It has no response, and sometime it will response, but it cost such a long time.</p>

<p><strong>when I use lsof to show port usage, it different</strong></p>

<pre><code>[root@worker4 ~]# lsof -i:31000
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
wrapper 5251 root    5u  IPv4  33957      0t0  TCP localhost:32000-&gt;localhost:31000 (ESTABLISHED)
java    5355 root   13u  IPv6  35851      0t0  TCP localhost:31000-&gt;localhost:32000 (ESTABLISHED)
</code></pre>

<pre><code>COMMAND    PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
kube-prox 9679 root   13u  IPv6 3746350      0t0  TCP *:31000 (LISTEN)
</code></pre>

<p>so how can I visit nodePort service on other nodes.</p>

zzx
<p>Nodeport goes through extra network hop and uses IP table load balancing at L4 layer provided by kube proxy.So it's expected to be slow particularly if you access a pod from a a node where it's not scheduled. Also kube proxy need to be running in nodes from where you want to access a pod via nodeport service.</p>

<p>I would suggest to use a reverse proxy such as nginx as ingress or L7 load balancer for faster performance.</p>
