Chuyển tới nội dung chính

Cấu hình Proxy Protocol cho Istio Ingress

Nếu bạn truy cập ứng dụng qua Istio gateway trên Managed - FPT Kubernetes Engine và cần public IP thật của end user, cấu hình Proxy Protocol như sau.

Bật Proxy Protocol​

  1. Thêm annotation loadbalancer.fptcloud.com/proxy-protocol: "true" vào cấu hình service istio-ingressgateway.

  2. Apply 1 EnvoyFilter trong namespace istio-system:

    apiVersion: networking.istio.io/v1alpha3
    kind: EnvoyFilter
    metadata:
    name: proxy-protocol
    namespace: istio-system
    spec:
    configPatches:
    - applyTo: LISTENER
    patch:
    operation: MERGE
    value:
    listener_filters:
    - name: envoy.filters.listener.proxy_protocol
    typed_config:
    '@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
    workloadSelector:
    labels:
    istio: [lable-istio-gateway]

Với cấu hình này, log của pod istio-ingressgateway sẽ hiển thị đúng public IP nguồn của end user truy cập ứng dụng qua gateway.

ghi chú

Hướng dẫn này áp dụng cho Istio open source phiên bản 1.22 trở về trước.