bobrik / marathoner

Service discovery for marathon
26 stars 5 forks source link

Feature Request , Health Checks in Haproxy Config , Enviroment Variables #1

Closed michaelhaessig closed 9 years ago

michaelhaessig commented 9 years ago

First off , nice work on Marathoner ! :)

The code looks really clean, i havent tried the service ( yet ). I'm currently evaluating a good load balancing solution for marathon apps. I've tried some other tools but wasnt happy with the output , so at the moment i'm back to using a modified version of the default marathon-haproxy-bridge skript.

I really like the concept of updaters & listener for scalabilty :+1:

I see you have the ability to externalize the haproxy config files on your TODOs. The following features would make this app extremely usful.

I know i'm asking for much , my golang skills are very limited.. At first i wanted to implemented my own solution in java by querying zookeeper state, but your service would be a fit for most of my requirements :)

greetings miki4you

bobrik commented 9 years ago

I'll publish new version with external config and labels in HaproxyApp next week.

I'm not going to add health for haproxy, though. In my environment I have 100s of mesos-slaves and 2 marathoner-listener containers on each. Marathon checks each task every 2 seconds, that makes 0.5 rps for each task. If I add health check from each haproxy on 100 nodes, that would make:

100 nodes * 2 listeners per node * 0.5 rps from each = 100 rps

Making 100 rps just for health checks looks like an overkill to me. Imagine what kind of a collapse could happen with 1000 nodes.

michaelhaessig commented 9 years ago

sounds great looking forward for this release :)

i understand your point i'm currently only running 10 slave nodes. I'm running MariaDB Galera Cluster with Marathon Health checks every minute and the frequent health check are made by haproxy. I don't think it is necessary for all marathon task to be double health checked. If we had access to the health check structure we could make a condition in the template to generate health checks for haproxy. If you don't want to add the health check structure , which i'm perfectly fine with your decision, access to the supplied env variables would also make it possible to check for some condition in the template and generate some special config for this particular marathon task. i also have some task that do not need to be load balanced , currently i'm setting a env variable on the task to not generate a config in haproxy. The feature to access env vars in de template would really be useful.

bobrik commented 9 years ago

I just pushed v1.7 to docker hub. You can replace stock haproxy config template by bind-mounting your own to /etc/haproxy/haproxy.cfg.template or by extending my image and replacing the same file. App labels can be used in template.

Note that now you need to set label marathoner_haproxy_enabled to true in order to expose your app with marathoner-listener.

michaelhaessig commented 9 years ago

nice , i will try it out as soon as possible :+1: