eBayClassifiedsGroup / PanteraS

PanteraS - PaaS - Platform as a Service in a box
GNU General Public License v2.0
199 stars 61 forks source link

Setting consul keys #213

Closed cookandy closed 8 years ago

cookandy commented 8 years ago

Hi,

Is there a way to specify Consul keys in the marathon deployment script? I see things like {{if key $key_maxconn}}{{key $key_maxconn}}{{else}}128{{end}} in haproxy.cfg.ctmpl which makes me think there is a way to trigger things in consul template based on keys.

What I'd like to do is define a SERVICE_8080_OPTIONS list in marathon, and then add those options to the backend rule using Consul template. I thought maybe consul keys would be the answer. Any tips?

sielaq commented 8 years ago

if you do SERVICE_8080_TAGS=haproxy then registered and healthy service will appear in HAproxy. There is also another haproxy option we support via tags: weight=10 - useful for A/B testing AKA canaries releases (see example) haproxy_route=/foo - used to re-route to specific endpoint, haproxy_tcp=31337 - used to specify TCP port for tcp proxy

for max_conn we made exception so you can create in K/V consul "/haproxy/<service_name>/maxconn and change value on fly.

cookandy commented 8 years ago

Thanks, that makes sense.

I am planning on adding a backendoptions= tag which we can use to add config lines into the backend rules. This will take us one step closer to supporting SNI with haproxy SSL.