-
Notifications
You must be signed in to change notification settings - Fork 209
Description
In cloud-based Kubernetes environments, it is common to have multiple availability zones within the same cluster.
Starting from Kubernetes 1.31, kube-proxy implements a type of load balancing that prioritizes keeping traffic within the same availability zone. This ensures better latencies and significant cost savings, as traffic crossing availability zones can be expensive.
https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution
Since the HAProxy Ingress Controller doesn't use Kubernetes services but directly updates the backends with the pod IPs, I have the following question:
Would it be possible to have an option for HAProxy to route traffic only to the pods within the same availability zone?
This could be achieved by detecting the availability zone where the controller is running at startup, and then registering the SRVs from the same AZ as normal and the others as backups.
What do you think?
This would allow us to save considerable costs and improve latencies.
In our specific case, we use HAProxy both for traffic coming from the internet and for traffic between services.
I am willing to collaborate on the solution if assistance is provided.
Best regards.