title: Kubernetes traffic forwarding between services
body: <p>I have 1 master and 2 worker nodes. There is 1 service running on 1 node and a similar service is running on the other node. Both of them are of NodePort type. How do I forward http requests coming to the pod of first service to a pod of second service?</p>
  
  <p>I have tried using these iptable rules on the first worker node:</p>
  
  <p><code>iptables -t nat -A PREROUTING -i eth0 -p tcp --dport &lt;nodeport-of-service1&gt; -j DNAT --to &lt;public IP of worker2&gt;:&lt;nodeport-of-service2&gt;
  iptables -t nat -A POSTROUTING -p tcp -d &lt;public IP of worker2&gt; --dport &lt;nodeport of service2&gt; -j MASQUERADE</code></p>
  
  <p>but it doesn't seem to work. <code>eth0</code> is the WAN interface on the worker-1. </p>
  
  <p>Any idea how this can be done?</p>