QubitProducts / bamboo

HAProxy auto configuration and auto service discovery for Mesos Marathon
Apache License 2.0
793 stars 214 forks source link

Export Marathon app env variables to the template environment #69

Closed sttts closed 9 years ago

sttts commented 9 years ago

The first patch adds the $app.Env map in the template environment.

This mechanism is used in the second patch to add TCP support by setting the BAMBOO_TCP_PORT variable in the application definition. This leads to a "mode tcp" section for that app in the haproxy configuration with the value of BAMBOO_TCP_PORT as the port to listen on.

j1n6 commented 9 years ago

Wow, that's great! This actually resolves a few feature request and leave some flexibility to the template customization.

j1n6 commented 9 years ago

I'm going to test it later today before merging.

sttts commented 9 years ago

Sure, if you find any issue, just tell me.

Actually I am realizing right now that with this patch and a bit of magic in the template one can implement a complete service discovery infrastructure using bamboo, haproxy and proper values in the app definitions. This would allow to get rid of progrium/registrator and consul in my case. Crazy.

j1n6 commented 9 years ago

That's awesome to know. :)

pdpi commented 9 years ago

one can implement a complete service discovery infrastructure using bamboo, haproxy and proper values in the app definitions.

That was kind of the plan all along ;)