title: Preserving remote client IP with Ingress
body: <p>My goal is to make my web application (deployed on Kubernetes 1.4 cluster) see the IP of the client that originally made the HTTP request. As I'm planning to run the application on a bare-metal cluster, GCE and the <code>service.alpha.kubernetes.io/external-traffic: OnlyLocal</code> service annotation introduced in 1.4 is not applicable for me.</p>
  
  <p>Looking for alternatives, I've found <a href="https://stackoverflow.com/questions/32112922/how-to-read-client-ip-addresses-from-http-requests-behind-kubernetes-services">this question</a> which is proposing to set up an Ingress to achieve my goal. So, I've set up the Ingress and <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/nginx" rel="noreferrer">the NginX Ingress Controller</a>. The deployment went smoothly and I was able to connect to my web app via the Ingress Address and port 80. However in the logs I still see cluster-internal IP (from 172.16.0.0/16) range - and that means that the external client IPs are not being properly passed via the Ingress. Could you please tell me what do I need to configure in addition to the above to make it work?</p>
  
  <p>My Ingress' config:</p>
  
  <pre><code>apiVersion: extensions/v1beta1   
  kind: Ingress
  metadata:
    name: myWebApp
  spec:
    backend:
      serviceName: myWebApp
      servicePort: 8080
  </code></pre>