<p>I'm trying to understand some concepts behind kubernetes, so i have the following: </p>

<ol>
<li>A kubernetes cluster with 2 nodes</li>
<li>A deployment of nginx with 2 replicas, so i have 2 POD's. </li>
<li><p>A service exposing nginx on port 32134, so i can access each node with: </p>

<p><a href="http://node01:32134" rel="nofollow noreferrer">http://node01:32134</a> or <a href="http://node02:32134" rel="nofollow noreferrer">http://node02:32134</a></p></li>
</ol>

<p>So, let's go to my doubts:</p>

<ol>
<li><p>Doing a <code>kubectl describe pod nginx-001</code> i got this pod running under <strong>node01</strong>. Doing the same command to pod nginx-002 i got this pod running under <strong>node01</strong> also. So, if my pods are running under only one node how i can get HTTP 200 in both URL (node01 and node02) ? Node02 should not respond because don't have any nginx running, right ?</p></li>
<li><p>Looking at <code>kubctl logs -f nginx-001</code> i got all access requests log. The strange thing is: Don't matter if i hit <code>http://node01</code> or <code>http://node02</code> i always get logs in nginx-001 POD, the other pod (nginx-002) never get requests in log. Seems like <strong>ks8</strong> is redirecting all requests to nginx-001 always and forget the other pod. </p></li>
</ol>

<p><strong>Important note</strong>
I'm using Digital Ocean Kubernetes services</p>

<p>1) Thats where kube-proxy steps in. Kube-proxy is responsible to route your requests to the pods, irrespective of where the pod is deployed. You could have a 50 node cluster. You could have a 10 replica nginx deployed will all replicas deployed on only 1 node and it will be kube-proxy's job to route the requests to the service.</p>

<p>2) That basically depends on how much load you're encountering. You probably are the only one hitting the nginx service. So it persists on sending requests to one pod. Kubernetes service enables load balancing across a set of server pods, allowing client pods to operate independently and durably.</p>
