dataplaneapi
dataplaneapi copied to clipboard
Use Consul Healthcheck with Consul service discovery ?
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.
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.
Hi @tzarky, we've started working on this feature and it will be merged soon.
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?