<p>Each node runs the same pods and all the nodes do the same. I am using Istio ingress gateway with the NodePort. I need traffic that enters NodePort to be routed to pods not leaving the node.
I am unable to run <code>istio-ingressgateway</code> on each node to do that. Is it possible for each node to route its own traffic?</p>
<p>Bare-metal, k8s 1.19.4, Istio 1.8</p>

Jonas
<h2>Issue</h2>
<p>As @Jonas mentioned in comments</p>
<blockquote>
<p>The problem is that there is just one istio-ingressgateway pod on node1 and all the traffic from node2 have to come to node1</p>
</blockquote>
<h2>Solution</h2>
<p>You can use <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#scaling-resources" rel="nofollow noreferrer">kubectl scale</a> to scale your ingress gateway replicas. Below command will create 3 ingress gateway pods instead of just one.</p>
<pre><code>kubectl scale --replicas=3 deployment/istio-ingressgateway -n istio-system
</code></pre>
<hr />
<p>Additionally you can set this up with <a href="https://istio.io/latest/docs/reference/config/istio.operator.v1alpha1/#KubernetesResourcesSpec" rel="nofollow noreferrer">istio operator</a> replicaCount value.</p>
<p>Note that if you use <strong>cloud</strong> there might be <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/" rel="nofollow noreferrer">hpa</a> configured and it might immediately scales back up the pods. There is github <a href="https://github.com/istio/istio/issues/13588" rel="nofollow noreferrer">issue</a> about that. You can also set hpa min and max <a href="https://istio.io/latest/docs/reference/config/istio.operator.v1alpha1/#HorizontalPodAutoscalerSpec" rel="nofollow noreferrer">replicas</a> with istio.</p>
