<p>I have a simple ingress resource and two services: ess-index and ess-query. Services has been exposed with type <code>NodePort</code> with <code>--session-afinity=None</code>. Ingress resource has the following structure:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: ess-ingress
spec:
  backend:
    serviceName: ess-query
    servicePort: 2280
  rules:
   - http:
       paths:
       - path: /api/index
         backend:
          serviceName: ess-index
          servicePort: 2280
</code></pre>

<p>Created services will have proxy-mode iptables. When I expose these services as a <code>NodePort</code> kubernetes master will allocate a port from a flag-configured range, and each Node will proxy that port into the ess-index or ess-query service respectively. 
So, when I POST ingress with 
<code>kubectl create -f ingress.yaml</code> it will cause the following behaviour: will be automatically created GLBC controller, that manages the following GCE resource graph (Global Forwarding Rule -> TargetHttpProxy -> Url Map -> Backend Service -> Instance Group). It should appear as a pod, according to the documentation, but i can't see it in the following command output:<code>kubectl get pods --namespace=kube-system</code>. Here's the <a href="https://i.stack.imgur.com/W4Y9K.png" rel="nofollow noreferrer">sample output</a> My question is: what is the default load balancing algorithm for this loadbalancer? What happens when traffic routes to the appropriate backend? Is my understand correct that default algorithm is not round robin and, according to the <code>Service</code> docs, is random distributed (maybe based on some hash of source/destination IP, etc.)? This is important because in my case all traffic goes from small number of machines with fixed IP, so i can see the nonuniform traffic distribution on my backend instances. If so, what is the proper way to get the round robin behaviour? As far as i understand i can choose from two variants:</p>

<ol>
<li>Custom ingress controller. Pros: it can automatically detects pod restarts/etc., cons: can't support advanced l7 features that i may need in the future (like session persistence)</li>
<li>Delete ingress and use build it yourself solution like mentioned here: <a href="https://www.nginx.com/blog/load-balancing-kubernetes-services-nginx-plus/" rel="nofollow noreferrer">https://www.nginx.com/blog/load-balancing-kubernetes-services-nginx-plus/</a>
Pros: fully customisable, cons: you should take care if pods restarts, etc. by yourself. </li>
</ol>

<p>Incorporating kubeproxy and cloud lb algorithms so they cooperate toward a common goal is still a work in progress. Right now, it will end up spraying, over time you get roughly equal distribution but it will not be strictly rr.  </p>

<p>If you really want fine grain control over the algorithm, you can deploy the <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx" rel="nofollow noreferrer">nginx ingress controller</a> and expose it as a Service of Type=lb (or even stick a GCE l7 in front of it). This will give you Ingress semantics, but allows an escape hatch for areas that cloudproviders aren't fully integrated with Kube just yet, like algorithm control. The escape hatch is exposed as <a href="https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/configuration.md#annotations" rel="nofollow noreferrer">annotations</a> or a full <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx/examples/custom-configuration" rel="nofollow noreferrer">config map</a> for the template. </p>
