I had couple of envoy filters with my old clusters (Istio 1.3.3). Recently we upgraded to 1.6.2 and none of those envoy filters works anymore.
I am not able to figure out whats going on. Those filters were basically on istio-ingressgateway to pass on custom header on every response that it sends out.
It is unfortunate that documents are non existent around this strong feature.
Really appreciate , if anyone can help or throw some pointers.
Are there log entries in istiod or in the istio sidecar or your pods that indicate that something may be wrong?
Is the filter in the correct namespace (either istio-system or your pod namespace)?
Here is an example that works for me with 1.6.2. I’m using labels to select workloads to apply it to, you might want to use something else, but perhaps you can use that to narrow down the cause.
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: httplogger
namespace: istio-system
spec:
workloadSelector:
labels:
httplogger: enabled
configPatches:
- applyTo: HTTP_FILTER
match:
context: ANY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
subFilter:
name: "envoy.router"
patch:
operation: INSERT_BEFORE
value:
name: envoy.lua
typed_config:
"@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua"
inlineCode: |
function envoy_on_request(handle)
-- do things
end
function envoy_on_response(handle)
-- do things
end