dataplaneapi icon indicating copy to clipboard operation
dataplaneapi copied to clipboard

Use Consul Healthcheck with Consul service discovery ?

Open tzarky opened this issue 3 years ago • 1 comments

Hello,

We have tried to implement the consul discovery service of the dataplane API, everything works fine.

We found it a pity that HAProxy doesn't take advantage of it to rely on the healthcheck of consul to define if a service is usable or not.

Do you know if this feature is in your roadmap? If not, we are interested in implementing it if you find it interesting.

tzarky avatar Nov 03 '21 08:11 tzarky

Hi @matthisholleville we didn't start working on improving our current consul service discovery feature, but we are always open to community contributions. If you think that is useful for you please submit your proposal or MR, so we can discuss it further.

mjuraga avatar Nov 04 '21 12:11 mjuraga

Hi @tzarky, we've started working on this feature and it will be merged soon.

mjuraga avatar May 02 '23 15:05 mjuraga

We've implemented this with the following commit: https://github.com/haproxytech/dataplaneapi/commit/e5709f95cf81b0a1205347333177fd77feb13392

We introduced a health_check_policy parameter to consul service discovery, so you can set the policy to [none, all, any, min]. Default is none which is the previous behaviour, for all all health checks configured must be passing, for any only one health check must be passing to consider the instance, while min allows you specify health_check_policy_min where you can state the minimum number of health checks passing in order to consider that service instance. Does this fit your needs?

mjuraga avatar May 05 '23 09:05 mjuraga