I'm right now using GKE with kubernetes and an nginx container to proxy different services. My goal is to block some countries. I'm used to do that with nginx and it's useful geoip module, but as of now, kubernetes doesn't forward the real customer ip to the containers, so I can't use it.

What would be the simplest/cheapest solution to filter out countries until kubernetes actually forward the real IP?

  • External service?
  • Simple google server with only nginx, filtering countries, forwarding to kubernetes (not great in terms of price and reliability)?
  • Modify the kube-proxy (as I've seen here and there, but it seems a bit odd)?
  • Frontend geoip filtering (hmm, worse idea by far)
  • ?

thank you!


This answer says you can use a Google Cloud Platform load balancer via an Ingress object, and then find the client's IP address in the X-Forwarded-For header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.