<p>I am trying to add an header to all my requests being answered by my service, I am using Lua EnvoyFilter to do so. But the filter is not being applied to the sidecar-proxy, when I try to do configDump I dont find my filter nor the header in the resonses which I had added. I have manually labelled the pod &amp; the deployment with app=gateway &amp; the below is the filter I used, I can’t seem to find anything helpful in Istio doc nor in the envoy filter docs. Can anyone please help if I have missed something over here?</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: response-interceptor
  namespace: gateway
spec:
  workloadSelector:
    labels:
      app: gateway
  configPatches:
    - applyTo: HTTP_FILTER
      match:
        context: SIDECAR_INBOUND
        listener:
          filterChain:
            filter:
              name: envoy.http_connection_manager
              subFilter:
                name: envoy.router
      patch:
        operation: INSERT_BEFORE
        value:
          name: envoy.lua
          typed_config:
            &quot;@type&quot;: &quot;type.googleapis.com/envoy.config.filter.http.lua.v2.Lua&quot;
            inlineCode: |
              function envoy_on_response(response_handle)
                response_handle:headers():add(&quot;X-Custom-Namespace&quot;, &quot;worked&quot;);
              end
</code></pre>
<p>Gateway over here is my service-name &amp; is not the istio-ingress gateway.</p>

<p>Seems like an occasional error with EnvoyFilters on Minikube, after deleting &amp; re-applying it magically started to work.
<a href="https://github.com/istio/istio/issues/8261" rel="nofollow noreferrer">https://github.com/istio/istio/issues/8261</a>
<a href="https://github.com/istio/istio/issues/8616" rel="nofollow noreferrer">https://github.com/istio/istio/issues/8616</a></p>
