dataplaneapi icon indicating copy to clipboard operation
dataplaneapi copied to clipboard

"listen" sections missing in API?

Open domdom82 opened this issue 4 years ago • 3 comments

Hi, I would like to explore whether I can use dataplane api to dynamically add a "listen" section or otherwise modify it.

However, when I try to list them under /v2/services/haproxy/configuration/frontends it only lists actual frontends defined by the frontend keyword.

I know internally, HAproxy treats "listen" sections as a combination of frontend and backend. I personally use it to build a health check that returns 200 or 503 to my upstream loadbalancer to signal whether my HAproxy is able to receive traffic or not.

Is this feature missing or am I just using the API wrong?

Thanks!

domdom82 avatar Jan 13 '21 15:01 domdom82

hi @domdom82,

there is no support in API for listen section. It can exist in configuration, but it can't be changed though API itself.

As you said everything in listen section can be done with a combination of frontend + backend. And as you noticed, /frontends and also /backends returns only actual frontend and backend sections.

For supporting of listen section, we would need to duplicate behavior already available in those endpoints.

This is something that can be done if larger amount of community is interested in that feature, or if community contribution is made towards it.

oktalz avatar Jan 14 '21 11:01 oktalz

@oktalz thanks for the response. I see. I think the dataplane should be as feature complete as possible and cover all of haproxy configuration sections. So I think it would be a great addition. We are currently considering using the dataplane for our deployment. So if we choose to use it, we will probably contribute that PR since we have a requirement for it.

Thanks!

domdom82 avatar Jan 14 '21 13:01 domdom82

I would love to see the listen directive be added as well to be able to add easily stuff like this: https://github.com/haproxytech/haproxy-lua-acme

erik78se avatar Aug 10 '22 23:08 erik78se