haproxytech / kubernetes-ingress

HAProxy Kubernetes Ingress Controller
https://www.haproxy.com/documentation/kubernetes/
Apache License 2.0
725 stars 204 forks source link

Set persistent IDs for servers when using consistent hashing #574

Open ezhan-codaio opened 1 year ago

ezhan-codaio commented 1 year ago

Currently, when consistent hashing is used for load balancing, the server picked by different HAProxy instances can be different, making consistent hashing ineffective.

There should be a way to set a unique id to server when consistent hashing is enabled (http://docs.haproxy.org/2.8/configuration.html#5.2-id). The id can be based on a stable property of the pod (e.g. name, IP, or UID). Using the IPv4 address is probably the easiest, otherwise can hash the value and truncate it to 32 bits.

ivanmatmati commented 1 year ago

Hi @ezhan-codaio, We'll have a look at your request and possibly decide to integrate this feature in our roadmap. Thanks for sharing this idea.

ivanmatmati commented 1 year ago

Hi @ezhan-codaio , we'll have to investigate further on this idea as it has many technical implications to check.