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 "normal situation" 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.
Using Nginx Ingress you can use snippet and achieve the same.