每个节点上的入口网关

Ingress gateway on each node

每个节点运行都一样pods并且所有节点都做同样的事情。我将 Istio 入口网关与 NodePort 一起使用。我需要将进入 NodePort 的流量路由到 pods 而不是离开节点。 我无法在每个节点上 运行 istio-ingressgateway 来做到这一点。每个节点是否可以路由自己的流量?

裸机,k8s 1.19.4,Istio 1.8

问题

正如@Jonas 在评论中提到的那样

The problem is that there is just one istio-ingressgateway pod on node1 and all the traffic from node2 have to come to node1

解决方案

您可以使用 kubectl scale 来扩展您的入口网关副本。下面的命令将创建 3 个入口网关 pods 而不是一个。

kubectl scale --replicas=3 deployment/istio-ingressgateway -n istio-system

此外,您可以使用 istio operator replicaCount 值进行设置。

请注意,如果您使用 cloud,istio 可能会 hpa configured and it might immediately scales back up the pods. There is github issue about that. You can also set hpa min and max replicas