<p>I have bare metal Kubernetes cluster with haproxy ingress controller (daemon set) on external ip. Is it possible to restrict kube-proxy to route to local haproxy ingress pod?</p>

<p>To be more specific, I have 2 pods of haproxy ingress controller and use one external ip for them. As per my understanding, kube-proxy will be routing in round-robin to the pods. I didn't find any way to restrict this particular behaviour.</p>

<p>Set <code>externalTrafficPolicy: Local</code> in the NodePort Service.</p>

<p>This will make it so that traffic going to a node X will only go to the pod in node X. If there is no pod in node X the traffic will be dropped (but this should not be an issue since you're using a DaemonSet).</p>

<p>Another benefit is that this preserves the true source IP that haproxy sees. Without <code>externalTrafficPolicy</code>, it is possible that haproxy sees the source IP of another node instead of the original one, since nodes can proxy traffic.</p>

<p>More info <a href="https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip" rel="nofollow noreferrer">here</a></p>
