【发布时间】:2019-11-12 16:57:49
【问题描述】:
我正在尝试让一个 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
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
【问题讨论】:
-
您是否使用“kubectl get EnvoyFilter”命令进行交叉检查?
标签: istio envoyproxy