<p>I'm trying to understand a good way to handle Kubernetes cluster where there are several nodes and a master.
I host the cluster within the cloud of my company, plain Ubuntu boxes (so no Google Cloud or AWS).</p>

<p>Each pod contains the webapp (which is stateless) and I run any number of pods via replication controllers.</p>

<p>I see that with Services, I can declare PublicIPs however this is confusing because after adding ip addresses of 
my minion nodes, each ip only exposes the pod that it runs and it doesn't do any sort of load balancing. Due to this,
 if a node doesn't have any active pod running (as created pods are random allocated among nodes), it simply timeouts and I end up some IP addresses that don't response. Am I understanding this wrong?</p>

<p>How can I truly do a proper external load balancing for my web app? Should I do load balancing on Pod level instead of using Service?
If so, pods are considered mortal and they may dynamically die and born, how I do track of this?  </p>

<p>The PublicIP thing is changing lately and I don't know exactly where it landed.  But, services are <em>the</em> ip address and port that you reference in your applications. In other words, if I create a database, I create it as a pod (with or without a replication controller).  I don't connect to the pod, however, from another application.  I connect to a service which knows about the pod (via a label selector).  This is important for a number of reasons.</p>

<ol>
<li>If the database fails and is recreated on a different host, the application accessing it still references the (stationary) service ip address, and the kubernetes proxies take care of getting the request to the correct pod.</li>
<li>The service address is known by all Kubernetes nodes.  Any node can proxy the request appropriately.</li>
</ol>

<p>I think a variation of the theme applies to your problem.  You might consider creating an external load balancer which forwards traffic to all of your nodes for the specific (web) service.  You still need to take the node out of the balancer's targets if the node goes down, but, I think that any node will forward the traffic for any service whether or not that service is on that node.</p>

<p>All that said, I haven't had direct experience with external (public) ip addresses load balancing to the cluster, so there are probably better techniques. The main point I was trying to make is the node will proxy the  request to the appropriate pod whether or not that node has a pod.</p>

<p>-g</p>
