<p>I have to get the real ip from the request in my business.actually I got the <code>10.2.100.1</code> every time at my test environment. any way to do this ?</p>

<p>This is the same question as <a href="https://stackoverflow.com/questions/32723675/gce-k8s-accessing-referral-ip-address">GCE + K8S - Accessing referral IP address</a> and <a href="https://stackoverflow.com/questions/32112922/how-to-read-client-ip-addresses-from-http-requests-behind-kubernetes-services">How to read client IP addresses from HTTP requests behind Kubernetes services?</a>.</p>

<p>The answer, copied from them, is that this isn't yet possible in the released versions of Kubernetes.</p>

<p>Services go through kube_proxy, which answers the client connection and proxies through to the backend (your web server). The address that you'd see would be the IP of whichever kube-proxy the connection went through.</p>

<p><a href="https://github.com/kubernetes/kubernetes/pull/9210" rel="nofollow noreferrer">Work</a> is being actively done on a <a href="https://github.com/kubernetes/kubernetes/issues/3760" rel="nofollow noreferrer">solution</a> that uses iptables as the proxy, which will cause your server to see the real client IP.</p>
