<p>I'm exploring the nginx container as a load balancer. I'm using a Kubernetes Service in the upstream module.</p>
<p>Here is a snippet of my nginx.conf...</p>
<pre><code>upstream backend {
    hash $remote_addr consistent;
    server mgmt-1;        # &lt;-- these entries are Kubernetes Services
    server mgmt-2;
    server mgmt-3;
}
</code></pre>
<p>Right now each service maps to only ONE pod.  Which of course, is not ideal.</p>
<p>So, the <em>resolver</em> directive for nginx+ is said to consistently update the endpoint IP, in the event that the Service is changed/moved/deleted/ephemeralized, etc.</p>
<p>Question:  If I wanted to scale up my pods, resulting in multiple endpoints maintained by one Service, would the nginx resolver extract and load the entire set of endpoints?  Or will it not know what to do?  Thanks</p>

qwerty10110
<p>You can test this for yourself. It's quite fun. You spin up a pod running Ubuntu for example and then <code>kubectl exec -it podname /bin/sh</code> into the pod and from there you can run <code>nslookup mgmt-1</code> (if they're in the same namespace).</p>
<p>What you will find is that the service resolves to a single IP. This IP is unique to the service. When you actually send the service IP traffic on a port it is listening on it will make it to the endpoints.</p>
<p>To answer your question. I do not believe Nginx will be able to tell mgmt-1 has three endpoints (for example) while mgmt-2 has 1 endpoint (for example). Nginx will only see the service IP.</p>
<p>To see the service IP for yourself you can run <code>kubectl get svc/servicename -n namespacename</code></p>
