Tuesday, March 29, 2016

Access external client IP from behind Google Compute Engine network load balancer

Leave a Comment

I am running a Ruby on Rails app (using Passenger in Nginx mode) on Google Container Engine. These pods are sitting behind a GCE network load balancer. My question is how to access the external client IP from inside the Rails app.

The Github issue here seems to present a solution, but I ran the suggested:

for node in $(kubectl get nodes -o name | cut -f2 -d/); do   kubectl annotate node $node \     net.beta.kubernetes.io/proxy-mode=iptables;   gcloud compute ssh --zone=us-central1-b $node \     --command="sudo /etc/init.d/kube-proxy restart"; done 

but I am still getting a REMOTE_ADDR header of 10.140.0.1.

On ideas on how I could get access to the real client IP (for geolocation purposes)?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment