Configure Proxy Protocol for Istio Ingress
If you access applications through an Istio gateway on Managed - FPT Kubernetes Engine and need the real public IP of end users, configure Proxy Protocol as follows.
Enable Proxy Protocol
-
Add the annotation
loadbalancer.fptcloud.com/proxy-protocol: "true"to the istio-ingressgateway service configuration. -
Apply an EnvoyFilter in the
istio-systemnamespace:apiVersion: networking.istio.io/v1alpha3kind: EnvoyFiltermetadata:name: proxy-protocolnamespace: istio-systemspec:configPatches:- applyTo: LISTENERpatch:operation: MERGEvalue:listener_filters:- name: envoy.filters.listener.proxy_protocoltyped_config:'@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocolworkloadSelector:labels:istio: [lable-istio-gateway]
With this configuration, the istio-ingressgateway pod logs show the real source public IP of end users accessing the application through the gateway.
note
This guide applies to Istio open source versions 1.22 and earlier.