<p>I have two pods(A, B) on two separate nodes running same application. This application will receive data through tcp and save that to a remote storage. I would like to implement leader/follower pattern for these pods but i'm not sure how that can be achieved in k8s. For example, I would like pod A to receive all the traffic in the &quot;normal situation&quot; but when pod A fails, I want pod B to receive all the traffic. For my specific use case, the application MUST receive data in the same pod rather than load balancing the traffic.</p>

pandawithcat
<p>Using Nginx Ingress you can use snippet and achieve the same.</p>
<p>Refer <a href="https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-snippets/" rel="nofollow noreferrer">https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/advanced-configuration-with-snippets/</a></p>
<p><a href="https://serverfault.com/a/480273/283777">https://serverfault.com/a/480273/283777</a></p>
