我正在尝试使 envoyFilter 在 istio-sidecar 中工作。
看起来 :
- 发生注射。由于我的过滤器存在于集群的资源中,并且每当我更新过滤器时,istiod 都会推送到我的边车。(而且我的 pod 和我的过滤器在同一个命名空间中)
- 我用来选择的标签出现在 pod 上。
但是我的脚本完全被忽略了。请问,我错过了什么?
PS:我从特使的 ref 那里得到了 lua:
- https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/lua_filter.html?highlight=request_handle#configuration
- https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/lua_filter#respond
piVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: authent-filter
namespace: sma-app-integration
spec:
workloadSelector:
labels:
com.effia.smartaccess/secured: enabled
configPatches:
- applyTo: HTTP_FILTER
match:
context: SIDECAR_INBOUND
listener:
portNumber: 8080
filterChain:
filter:
name: "envoy.http_connection_manager"
subFilter:
name: "envoy.router"
patch:
operation: INSERT_FIRST
value:
name: envoy.filters.http.lua
typed_config:
"@type": "type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua"
inlineCode: |
function envoy_on_request(request_handle)
request_handle:respond({[":status"] = "100"},"nope")
end
编辑:好吧,我们无法让它工作并切换到 Nginx。最近的一项功能可以完成工作。