-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to automate the creation of the frontend #1
Comments
Hi @webmutation You can use the Data Plane API to create a frontend programmatically. There's an example here: https://www.haproxy.com/documentation/hapee/latest/configuration/config-sections/frontend/ As for filtering which services get added, you could add a feature request with the Data Plane API project: |
HI @NickMRamirez thanks for the information. I was hopping it would be possible to have some annotations via consul labels. Similar to what can be done with Fabio LB but i guess that use case is not supported. Would really like to see how the integration is being done. Can you point me to the code used to support this Sync mechanism? I wonder how hard it would be to extend this mechanism. I will try to see if I can create some expression to only filter the backends that we want to expose... that probably the simplest workaround to achieve routing via HAProxy of k8s backends. |
I am only a user of the integration myself, and not an engineer on the project, but it looks like the code is here in the "discovery" folder: https://github.com/haproxytech/dataplaneapi/tree/master/discovery |
@webmutation I see that in the latest release of the Data Plane API, they added: "the Consul Service Discovery now has the ability to filter services by namespace" https://www.haproxy.com/blog/announcing-haproxy-data-plane-api-2-4/ |
It seems its a bit limited, it seems its the consul namespace that this refers to, not the cluster namespaces, at least when i tried to filter using
even though I have a service deployed there backend consul-backend-1.1.1.1-80-another-nginx-service-nodeport-dev I did not get any services back... after i removed the namespace option it worked with all services. including the one mentioned above. If I may abuse a bit more your goodwill, how are you managing the creation of the frontend section? Do you incorporate this in the CD stage? Its what I was thinking to have the service register the frontend section once it is deployed. |
I asked our engineers about it, and it refers to the Consul namespace, which is a Consul Enterprise feature. You can then add all services that you want to proxy through HAProxy to have that one namespace. |
I haven't got as far as automating the frontend creation. My use case was more of a proof of concept to learn the service discovery feature. |
Hello,
I am trying to expose the services automatically via HAProxy, I am using the Consul K8S sync mechanism.
Currently I am having a couple of problems:
Any hints how to solve these issues?
The text was updated successfully, but these errors were encountered: