title: How Kubernetes NodePort Type Service load balance to pod
body: <p>I still have a question about Kubernetes NodePort service.</p>
  
  <p>NodePort: Exposes the service on <strong>each</strong> Node’s IP at a static port (the NodePort). A ClusterIP service, to which the NodePort service will route, is automatically created. You’ll be able to contact the NodePort service, from outside the cluster, by requesting :.</p>
  
  <p>If I have two Node: nodeA and nodeB, and if I deploy an app only on nodeA then create a NodePort service, then can I use both nodeA and nodeB ips to access this service?</p>
  
  <p>I had some tests, the result is no....</p>
  
  <p>I did two kinds of tests:</p>
  
  <p><strong>Test1:</strong></p>
  
  <p>I deployed a deployment with two pods, one is on NodeA, another is on NodeB. then create a NodePort service to access it.
  I can access the service by using both NodeA and NodeB ips. then I delete pod on NodeA, then try again. I found that I cannot access the service by using NodeA ip, but can access by using NodeB ip. After the pod is startup on NodeA, then I can access by using NodeA ip</p>
  
  <p><strong>Test2:</strong></p>
  
  <p>I deployed a deployment with only one pod, it is on NodeA. then create a NodePort service to access it.
  I can only access the service by using NodeA ip but cannot by NodeB ip.</p>
  
  <p>So my question is:</p>
  
  <p>For the NodePort type, it can only be used that the pod/pods are on the same Node? If I use NodeA ip, service won't load balance the request to the pod on NodeB?</p>
  
  <p>Thanks a lot! :)</p>