我正在尝试让 lua envoy 过滤器与 istio 网关一起使用,但我添加到集群中,它的工作方式就好像过滤器不存在一样。
我已经使用本指南https://istio.io/docs/setup/kubernetes/install/kubernetes/在 GKE 上配置了我的 istio 集群。
有人遇到过同样的问题吗?
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
Run Code Online (Sandbox Code Playgroud)
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
namespace: foo
spec:
selector:
istio: ingressgateway # use Istio default gateway …Run Code Online (Sandbox Code Playgroud)