最近更新时间:2021-12-20 17:28:03
步骤1:kubectl edit svc ingress-nginx-controller -n kube-system,把externalTrafficPolicy改成Local;
步骤2:修改名为ingress-nginx-controller的configmap的配置:
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/version: 0.41.2
helm.sh/chart: ingress-nginx-3.10.1
name: ingress-nginx-controller
namespace: kube-system
data:
compute-full-forwarded-for: "true"
forwarded-for-header: "X-Forwarded-For"
use-forwarded-headers: "true"
纯净模式