是否为Kubernetes入口保留客户端源IP? [英] Preserve client source IP for Kubernetes ingress?
问题描述
我正在使用此Ingress,它类似于Nginx: https: //cloud.ibm.com/docs/containers?topic=containers-ingress_annotation#general
I am using this Ingress it is similar to Nginx: https://cloud.ibm.com/docs/containers?topic=containers-ingress_annotation#general
当我这样做时:
request -> LoadBalancer Service -> client source public IP returned
request -> Ingress -> LoadBalancer Service -> some private IP returned
我想保留客户端源公共IP.在我的服务中,我设置ExternalTrafficPolicy: Local
,它在直接击中LoadBalancer时有效,但是我不知道在通过Ingress时需要什么设置.
I would like to preserve the client source public IP. In my Service I am setting ExternalTrafficPolicy: Local
, and it works when hitting the LoadBalancer directly, but I do not know what setting I require when going through the Ingress.
推荐答案
For preserving Ingress source IP, see these steps: https://cloud.ibm.com/docs/containers?topic=containers-ingress#preserve_source_ip
除了编辑现有的alb服务之外,您基本上执行与上述相同的操作.
Essentially you do the same thing that you've described, except that you edit the existing alb service.
这篇关于是否为Kubernetes入口保留客户端源IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!