How to redirect tcp traffic in k8s only when failure occurs

12/13/2020

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.

-- pandawithcat
kubernetes
networking

1 Answer

12/13/2020
-- Tummala Dhanvi
Source: StackOverflow