我想使用istio资源EnvoyFilter
更改Sidecar配置以支持自定义max_request_bytes
,因为在将太大的文件上传到服务器时会遇到错误413。但是我对特使配置不熟悉。
有人可以给我有效的EnvoyFilter
配置吗?谢谢!
答案 0 :(得分:1)
在Istio 1.2和1.4上可以使用,但是API已更改,filters
已弃用:
对于网关(在与网关相同的名称空间中):
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: request-size-limit
spec:
filters:
- listenerMatch:
listenerType: GATEWAY
listenerProtocol: HTTP
filterName: envoy.buffer
filterType: HTTP
filterConfig:
maxRequestBytes: 26214400 # 25MB
此应该最多可以工作1.6(在1.4上进行测试)。未经修改,它将无法在1.7版中运行:
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: request-size-limit
namespace: istio-system
spec:
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
patch:
operation: INSERT_BEFORE
value:
name: envoy.buffer
config:
maxRequestBytes: 26214400 # 25MB
答案 1 :(得分:0)
对于1.7,此方法有效:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: request-size-limit
namespace: istio-system
spec:
workloadSelector:
labels:
istio: ingressgateway
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
patch:
operation: INSERT_BEFORE
value:
name: envoy.buffer
typed_config:
'@type': type.googleapis.com/udpa.type.v1.TypedStruct
value:
maxRequestBytes: 1048576 # 1 MB