kubernetes 透传客户端真实IP

1、条件:服务(Service)--->nginx-ingress-lb ---> 外部流量策略:Local

2、编辑 configmap nginx-configuration:

kubectl edit cm nginx-configuration -n kube-system

apiVersion: v1
data:
....
forwarded-for-header: X-Forwarded-For
use-forwarded-headers: "true"
....