Forward Traffic to a POD

Hi All,
I installed and configured 3 node K8S cluster. The worker nodes are windows nodes. We have one .Net application. We want to containerize this application. This application internally using Apache Ignite for distributed cache.

We build docker image for this application, wrote a deployment file and deployed it in K8S cluster. The deployment will also create a service of “LoadBalancer” type. Using this service we are connecting to the application from outside world. All is good so far.

Coming to the issue, as we are using Apache Ignite for distributed cache. One of the POD will be master. We want to always forward the traffic to the POD which is acting as leader in the Apache Ignite cluster. The apache ignite leader POD identification must be dynamic.

I had gone through the below link. Here the POD configuration is static. We want to dynamically identify the leader POD and forward the traffic. What we have to do at the service side.

Any help on how to forward the traffic to the POD is greatly appreciated.

Thanks and Regards,
–Satya Kada

You will likely need something externally to update the service or the pods to signify which one is the leader. e.g. run another pod that polls ignite to determine which one is the leader and label the pod as such. The service would be setup with a label selector strictly targeting the leader label.

It’d still be possible for traffic to route to a non-leader during parts of it, but it should be pretty minimal.