Forward HTTPS Client Client from Google Container Engine

I run the nginx service in a docker container with the Google Container Engine, which forwards certain domain names to other services such as APIs, Frontend, etc. I have a simple cluster for configured services. Nginx service is a load balancer.

The environment variable REMOTE_ADDR always contains the internal address in the Kubernetes cluster. I searched for HTTP_X_FORWARDED_FOR, but it is not in the request headers. Is it possible to configure a service to save an external ip client in requests?

+6
source share
1 answer

With the current implementation of L3 balancing (as in Kubernetes 1.4), it is not possible to get the source IP address to connect to your service.

It looks like your use case can be used well with an Ingress object (or by manually creating an HTTP / S Load Balancer ) that will put the original IP address in the X-Forwarded-For HTTP header to easily retrieve your backends.

+3
source

Source: https://habr.com/ru/post/1011825/


All Articles