Hi, I need to retrieve remote IP in istio 1.2.
I found L7LB + EnvoyFilter seems a good solution and I succeeded to retrieve remote IP in istio 1.5.
The envoyFilter is like:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: xff-config-envoyfilter
namespace: istio-system
spec:
workloadSelector:
label:
app: istio-ingressgateway
configPatches:
- applyTo: NETWORK_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
portNumber: 443
patch:
operation: MERGE
value:
typed_config:
"@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
use_remote_address: true
xff_num_trusted_hops: 2
ref: https://github.com/soichisumi-sandbox/gprc-with-istio-and-ingress
The solution works only in istio 1.3 or above, but due to the circumstances of our environment(istio 1.2 is already running), this solution cannot be used.
I’ve already tried the old notation using filterConfig and it didn’t work (probably because 1.2 doesn’t support merging Configs).
The example old envoyFilter is:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: xff-envoy-envoyfilter
namespace: istio-system
spec:
workloadSelector:
label:
app: istio-ingressgateway
filters:
- listenerMatch:
listenerType: GATEWAY
listenerProtocol: HTTP
filterName: "envoy.http_connection_manager"
filterType: NETWORK
filterConfig:
use_remote_address: false
xff_num_trusted_hops: 2
How do I set it up to work with istio 1.2?