<p>So we have a SQL server deployment with replica=2 in K8s which I need to make load balanced. I'm using Haproxy ingress controller to achieve this goal but I'm stuck in configuring Haproxy. I'm trying to configure the Haproxy based on <a href="https://www.haproxy.com/blog/dissecting-the-haproxy-kubernetes-ingress-controller/" rel="nofollow noreferrer">this link</a> and I don't know how to present my two pods to the ingress!</p>

<p>There is this part of the link says:</p>

<pre><code>---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: web-ingress
  namespace: default
spec:
  rules:
  - host: foo.bar
    http:
      paths:
      - path: /
        backend:
          serviceName: app
          servicePort: 80
</code></pre>

<p>The issue is that in "spec.rules.host" section, I don't have any domain rather I have two IPs belong to my SQL pods! How am I supposed to represent my pods to the ingress? Am I doing right? 
I've looked it up alot, but no luck!</p>

<p>P.S: What is the best practice for Load Balancing SQL server?</p>

Mohammad K.
<p>A DNS system translates hostname to IPs.With a domain registered with DNS system you can add a mapping of hostname to IP in the <code>/etc/hosts</code> file of the system from where you want to access the hostname. </p>
