I can't find out customer real IP address when apache-php enviroment runs in google container. Without modifying anything, I get ip address from container address range, when using mod_remoteip, I can add
RemoteIPHeader X-Client-IP
RemoteIPInternalProxyList ournet/proxy-list
and add rows into "proxy-list"-file:
10.240.0.0/16 # google internal network
10.244.0.0/14 # Cluster aadress range
Only the row 10.244.0.0/14 gives any result. In this case I get the cluster node's ip as REMOTE_ADDR value from the 10.240.0.0/16 network.
It seems, that the node itself acts as forwarder, without adding needed headers to the request or I am looking it from totally wrong perspective?
Some traffic is masqueraded, but it is done at L3, rather than L7, so there's no way to add a header. :(
This will get better soon for in-cluster traffic, but we have to wait for cloud load-balancers to catch up before we can properly handle out-of-cluster traffic properly.