<p>I need to be able to log the source IP address trying accessing to my application.
Problem is that I have the current setup:</p>

<pre><code>service load balancer--&gt;kong--&gt;myy application
</code></pre>

<p>Kong is very good and automatically adds an "X-Forwarded-for" header to requests coming to my application so that I don't get Kong's IP...but this header only contains the load balancer IP!</p>

<p>What should happen is that in that header there should be the client's IP...is that possible?</p>

Phate
<p>You need to set <code>externalTrafficPolicy: Local</code> in the service definition, this will preserve clients ip.</p>

<p>Reading <a href="https://www.asykim.com/blog/deep-dive-into-kubernetes-external-traffic-policies" rel="nofollow noreferrer">here</a> and <a href="https://github.com/Azure/AKS/issues/607" rel="nofollow noreferrer">here</a> </p>
