首页 > 解决方案 > 在 YAML 中为 Istio EnvoyFilter 设置请求缓冲区

问题描述

你能帮我指定 YAML Istio EnvoyFilter 来拥有请求缓冲区,类似于 Nginx 请求缓冲区。我试过了

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: connection
  namespace: my-test
spec:
  workloadSelector:
    labels:
      role: backend
  configPatches:
  - applyTo: LISTENER
    match:
      context: SIDECAR_INBOUND
    patch:
      operation: MERGE
      value:
        per_connection_buffer_limit_bytes: 21000000.0 #21MB

这已成功应用于集群,但未按预期工作

谢谢

UPD 这有效(对于 istio 1.5)

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: connection
  namespace: my-test
spec:
  filters:
    - filterName: envoy.buffer
      filterType: HTTP
      filterConfig:
        maxRequestBytes: 21000000.0 #21MB

UPD 2 这有效(对于 istio 1.8)

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: filter-buffersize-limit
  namespace: istio-system
spec:
  workloadSelector:
    labels:
      istio: ingressgateway
  configPatches:
    - applyTo: HTTP_FILTER
      match:
        context: GATEWAY
        listener:
          filterChain:
            filter:
              name: "envoy.filters.network.http_connection_manager"
              subFilter:
                name: "envoy.filters.http.router"
      patch:
        operation: INSERT_BEFORE
        value:
          name: envoy.filters.http.buffer
          typed_config:
            "@type": type.googleapis.com/envoy.extensions.filters.http.buffer.v3.Buffer
            max_request_bytes: 26214400 # 25 MB. 

标签: istioenvoyproxy

解决方案


推荐阅读