Hi Mike, That is what i am also doing with my "daemon project", bamboo comes close but there are always some features that are missing so I drew inspiration from everyone's comments and whipped up a small project.
https://github.com/ankurcha/haproxy-marathon-manager I am still developing but my idea is very simple. 1. User has a rest api to send application definitions (identified by the marathon app id - thanks bamboo for the inspiration). 2. The user defines the exact template of the haproxy rules (as a moustache.js template - thanks mike/bamboo for the inspiration). *this is probably the only point of difference* 3. Use zookeeper to save the application configurations ( thanks bamboo!). Obviously, this is pretty much as "ALPHA" as it gets but I will be vetting this strategy over the next few days but the theory is to make it as light weight as possible. As always, any comments suggestions are welcome! -- Ankur Chauhan On Tue, Sep 9, 2014 at 11:54 AM, Mike Michel <[email protected]> wrote: > Hi, > > > > i changed the haproxy script so it makes use of haproxys ACL feature. I > need to have subdomains for every new app a user creates but always the > same root domain. The output looks like this: > > > > frontend http-in > > bind *:80 > > mode http > > option httplog > > option dontlognull > > option forwardfor > > option http-server-close > > acl host_bla1 hdr_beg(host) -i bla1.dev.example.io > > use_backend bla1 if host_bla1 > > acl host_easy hdr_beg(host) -i easy.dev.example.io > > use_backend easy if host_easy > > acl host_nodecellar hdr_beg(host) -i nodecellar.dev.example.io > > use_backend nodecellar if host_nodecellar > > > > backend bla1 > > option httpclose > > option forwardfor > > mode http > > balance leastconn > > server bla1-1 MesosSlave01:31439 check > > > > backend easy > > option httpclose > > option forwardfor > > mode http > > balance leastconn > > server easy-2 MesosSlave02:31002 check > > server easy-1 MesosSlave02:31123 check > > > > backend nodecellar > > option httpclose > > option forwardfor > > mode http > > balance leastconn > > server nodecellar-1 MesosSlave01:31660 check > > > > > > Still fine tuning this but right now it does what i need. > > > > > > Best, > > > > Mike > > > > *Von:* Bart Spaans [mailto:[email protected]] > *Gesendet:* Dienstag, 9. September 2014 17:30 > *An:* [email protected] > *Betreff:* Re: Frontend loadbalancer configuration for long running tasks > > > > Hi Ankur, > > > > It doesn't cater for that at the moment, but it should be fairly easy to > modify the HAProxy configuration generation - have a look at haproxy.go. > > > > A setup we have been using is to have applications expose unique ports, > have HAProxy as an internal load balancer and then have a public facing > load balancer in front of that to map from port 80/443 to the internal > port, but YMMV. > > > > Cheers, > > Bart > > > > On 9 September 2014 17:11, Ankur Chauhan <[email protected]> wrote: > > How does mesos_service_discovery handle the case of multiple applications > listening to the same set of ports but differing only in the domain. > > > Sent from my iPhone > > > On Sep 9, 2014, at 4:45 AM, Bart Spaans <[email protected]> wrote: > > Hi Ankur, > > > > Another solution that might fit your use case can be found at > https://github.com/opencredo/mesos_service_discovery > > > > The main advantage of this project is that it doesn't depend on DNS, so it > avoids issues with expiring TTLs and application caches, which can be > problematic. > > > > Cheers, > > Bart > > > > On 9 September 2014 10:52, Ankur Chauhan <[email protected]> wrote: > > Hi all, > > > > (Please let me know if this is not the correct place for such a question). > > I have been looking at mesos + marathon + haproxy as a way of deploying > long running web applications. Mesos coupled with marathon's /tasks api > gives me all the information needed to get a haproxy configured and load > balancing all the tasks but it seems a little too simplistic. > > > > I was wondering if there are other projects or if others could share how > they configure/reconfigure their loadbalancers when new tasks come alive. > > > > Just to make things a little more concrete consider the following use case: > > > > There are two web applications that are running as tasks on mesos: > > 1. webapp1 (http + https) on app1.domain.com > > 2. webapp2 (http + https) on app2.domain.com > > > > We want to configure a HAProxy server that routes traffic from users (:80 > and :443) and loadbalances it correctly onto the correct set of tasks. > Obviously there is some haproxy configuration happening here but i am > interested in finding out what others have been doing in similar cases > before I go around building yet another haproxy reconfigure and reload > script. > > > > -- Ankur > > > > > > -- > > Bart Spaans > Consultant > OpenCredo Ltd -- Excellence in Enterprise Application Development > > Mobile: +44(0) 7453 777 558 > > Registered Office: 5-11 Lavington St., London SE1 0NZ > Registered in UK. No 3943999 > > If you have received this e-mail in error please accept our apologies, > destroy it immediately and it would be greatly appreciated if you notified > the sender. It is your responsibility to protect your system from viruses > and any other harmful code or device. We try to eliminate them from > e-mails and attachments; but we accept no liability for any that remain. We > may monitor or access any or all e-mails sent to us. > > > > > > -- > > Bart Spaans > Consultant > OpenCredo Ltd -- Excellence in Enterprise Application Development > > Mobile: +44(0) 7453 777 558 > > Registered Office: 5-11 Lavington St., London SE1 0NZ > Registered in UK. No 3943999 > > If you have received this e-mail in error please accept our apologies, > destroy it immediately and it would be greatly appreciated if you notified > the sender. It is your responsibility to protect your system from viruses > and any other harmful code or device. We try to eliminate them from > e-mails and attachments; but we accept no liability for any that remain. We > may monitor or access any or all e-mails sent to us. >

