haproxytech / dataplaneapi

HAProxy Data Plane API
https://www.haproxy.com/documentation/dataplaneapi/
Apache License 2.0
326 stars 76 forks source link

Need custom server line incase of consul service discovery enabled dataplane #328

Open dhruvjain99 opened 6 months ago

dhruvjain99 commented 6 months ago

As per consul.md, the generated server line will be of the format: server SRV_<rand_id> <node-ip>:<node-port> weight 128. We need to configure some more params for our backend servers like check, port 8888, on-marked-down, send-proxy, etc. As per the official blog, if I use the default-server configuration line then the dataplane api issues the reload command instead of updating the haproxy using runtime api. We use backend balancing mode as leastconn and the problem with reloading is that when new backend servers are added, the haproxy gets reloaded due to which the new process does not inherit the connections count resulting in equal distribution of connections while our requirement is to distribute more connections to the servers which are recently added.

There is no way we can define our own custom format of server line when using consul service discovery enabled dataplane.

dhruvjain99 commented 6 months ago

@hdurand0710 @mjuraga could you please confirm if this is true? Maybe I can work on this enhancement and contribute. In the past I have also contributed to the HAProxy by fixing the support of stick tables for MQTT 3.

illmatik0ne commented 5 months ago

Related, I am currently experiencing an issue with consul service discovery when the backend server is expecting SSL. A nomad container is expecting SSL traffic for a web interface over port 8443. When the Data Plane API registers the service, it does not include an ssl argument in the backend server configuration and attempts to connect using http instead of https.

Consul does not seem to have a way to inform that SSL is expected in the service definition. Is there a way to use consul service tags to add more parameters to our backend servers?