GCE + K8S-访问引荐IP地址 [英] GCE + K8S - Accessing referral IP address

查看:88
本文介绍了GCE + K8S-访问引荐IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google Container Engine上进行标准Kubernetes部署后,要包括使用创建网络负载平衡器的Kubernetes负载平衡器设置配置的服务,是否可以在应用程序中访问用户(或引用)的IP地址?对于PHP,检查$ _SERVER超全局变量中的公共标头只会导致服务器和内部网络地址可用.

With a standard Kubernetes deployment on Google Container Engine, to include services configured with the Kubernetes load balancer settings which creates network load balancers, is it possible to access the user's (or referring) IP address in an application? In the case of PHP, checking common headers in the $_SERVER superglobal only results in the server and internal network addresses being available.

推荐答案

还没有.服务通过kube_proxy进行响应,该响应会答复客户端连接并代理到后端(您的PHP服务器).您将看到的地址将是该连接通过的任何kube-proxy的IP.

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

工作已完成,并且跟踪

Work has been done, and a tracking issue is still open to switch over to an iptables-only proxy. That would allow your PHP server to get the actual client IP.

这篇关于GCE + K8S-访问引荐IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆