<p>Lets say that I have two deployments which contain two instances of a backend application. (Instead of having one deployment with multiple replicas, as they need to be configured differently).</p>

<p>How would you guys go about load balancing between the two? The classic approach would be to set up HAProxy with the two backends. Does this sound right in the context of Kubernetes? Is there a better way to expose two deployments on a single Ingress Controller resource?</p>

<p>You can define a <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a> that will be determined by <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors" rel="nofollow noreferrer">labels selectors</a>. The requests to the service will be spread across the deployments (as the same with ingress)</p>

<p>Example:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  labels:
    app: my-deployments
spec:
  ports:
  - port: 80
  selector:
    app: my-deployments
</code></pre>
