istio.io/content/zh/boilerplates/cve-2020-007-configmap.md

1.3 KiB

  1. 通过下载 custom-bootstrap-runtime.yaml 创建一个 ConfigMap。根据您的部署中每个网关实例所需要的并存连接数来更新 ConfigMap 中 global_downstream_max_connections 参数。

    {{< text bash >}} $ kubectl -n istio-system apply -f custom-bootstrap-runtime.yaml {{< /text >}}

  2. Patch 以上的配置到 Ingress 网关的部署中。下载 gateway-patch.yaml 并通过以下的命令应用。

    {{< text bash >}} kubectl --namespace istio-system patch deployment istio-ingressgateway --patch "(cat gateway-patch.yaml)" {{< /text >}}

  3. 确认新的上限已经存在于配置中。

    {{< text bash >}} ISTIO_INGRESS_PODNAME=(kubectl get pods -l app=istio-ingressgateway -n istio-system -o jsonpath="{.items[0].metadata.name}") kubectl --namespace istio-system exec -i -t "{ISTIO_INGRESS_PODNAME}" -c istio-proxy -- curl -sS http://localhost:15000/runtime

    { "entries": { "overload.global_downstream_max_connections": { "layer_values": [ "", "250000", "" ], "final_value": "250000" } }, "layers": [ "static_layer_0", "admin" ] } {{< /text >}}