I am trying to get a lua envoy filter to work with istio gateway, but I added to the cluster and it is working as if the filter does not exists.
I have configured my istio cluster on GKE using this guide https://istio.io/docs/setup/kubernetes/install/kubernetes/.
Have anyone had the same problem?
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: edge-lua-filter
spec:
workloadLabels:
app: httpbin-gateway
filters:
- listenerMatch:
listenerType: GATEWAY
filterName: envoy.lua
filterType: HTTP
filterConfig:
inlineCode: |
-- Called on the request path.
function envoy_on_request(request_handle)
request_handle:headers():add("foo", "bar")
end
-- Called on the response path.
function envoy_on_response(response_handle)
body_size = response_handle:body():length()
response_handle:headers():add("response-body-size", tostring(body_size))
end
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
namespace: foo
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin
namespace: foo
spec:
hosts:
- "*"
gateways:
- httpbin-gateway
http:
- route:
- destination:
port:
number: 8000
host: httpbin.foo.svc.cluster.local