# Can we use internal load balancer with HAProxy?

**URL:** <https://forums.percona.com/t/can-we-use-internal-load-balancer-with-haproxy/7945>\
**Category:** Percona Operator for MySQL\
**Tags:** mysql, percona\
**Created:** [August 25, 2020, 3:50am UTC](https://forums.percona.com/t/can-we-use-internal-load-balancer-with-haproxy/7945 "2020-08-25T03:50:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saloni24](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@saloni24](https://forums.percona.com/u/saloni24)\
**Post date:** [August 25, 2020, 3:50am UTC](https://forums.percona.com/t/can-we-use-internal-load-balancer-with-haproxy/7945/1 "2020-08-25T03:50:58Z")

</div>

If yes,&nbsp;Can you tell me how to get the internal load balencer IP using haproxy

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [September 14, 2020, 9:12am UTC](https://forums.percona.com/t/can-we-use-internal-load-balancer-with-haproxy/7945/2 "2020-09-14T09:12:02Z")

</div>

Hi,  
Yes, you can. You need to use ‘{your-cluster-name}-haproxy-replicas’ service for these needs.   
How do you get info about needed service e.g. :  
kubectl get&nbsp; svc/cluster1-haproxy-replicas

---

<div class="post-metadata">

**Author:** ![saloni24](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@saloni24](https://forums.percona.com/u/saloni24)\
**Post date:** [July 21, 2021, 4:00pm UTC](https://forums.percona.com/t/can-we-use-internal-load-balancer-with-haproxy/7945/3 "2021-07-21T16:00:44Z")

</div>

Adding service annotation such as this to the haproxy since version 1.6.0/1.7.0 would also help, please correct me if I missed out:  
serviceAnnotations:  
[cloud.google.com/load-balancer-type:](http://cloud.google.com/load-balancer-type:) “Internal”  
serviceType: LoadBalancer

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [July 21, 2021, 5:04pm UTC](https://forums.percona.com/t/can-we-use-internal-load-balancer-with-haproxy/7945/4 "2021-07-21T17:04:50Z")

</div>

Hi @saloni24 ,  
If you need to get internal IP for load balancer yes, you are right but there is only one thing: for GKE versions 1.17 and later, you need to use the annotation `networking.gke.io/load-balancer-type: "Internal"` . For earlier versions, use the annotation `cloud.google.com/load-balancer-type: "Internal"`.  
In CR it will be `spec.haproxy.serviceAnnotations: networking.gke.io/load-balancer-type: "Internal"` .
