是否为Kubernetes入口保留客户端源IP? [英] Preserve client source IP for Kubernetes ingress?

查看:113
本文介绍了是否为Kubernetes入口保留客户端源IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此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.

推荐答案

有关保留Ingress源IP的信息,请参见以下步骤:

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屋!

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