<p>I want to load-balance 2 stateful applications running on 2 pods. This application cannot have 2 replicas as it is stateful.  </p>

<p>I tried giving the same service names to both the pods but it looks like Kubernetes get confused and nothing is served.</p>

<p>I am using on-premies Kubernetes cluster with metallb as a load-balancer.</p>

<p>Currently, these pods are exposed over public IP with service TYPE as a load-balancer and added A record to both the pods. But it cannot do a health check with DNS.</p>

<p>I only think of having Nginx pod and do mod-proxy to it. Is there any better solution other than this?</p>

<p>The selector on a service can be anything, and can match pods from multiple statefulsets (or deployments). So make a label on your pods and use that in the selector of a new service to target both.</p>
