Can we use internal load balancer with HAProxy?

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

1 Like

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  svc/cluster1-haproxy-replicas

2 Likes

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: “Internal”
serviceType: LoadBalancer

1 Like

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" .

1 Like