CiscoCloud / haproxy-consul

Dynamic haproxy configuration using consul
Apache License 2.0
168 stars 85 forks source link

Incompatibility with lastest version of marathon-consul #9

Closed tgermain closed 9 years ago

tgermain commented 9 years ago

Hi,

I've several problems with the generated configuration of HAproxy.

Problem

Here is an extract of the current configuration :

listen kibana_30070
    mode tcp
    bind *:30070

    server <no value> dc1-docker-dev-mesos-master1.dev.dc1.kelkoo.net.node.consul:31306 # TASK_RUNNING

This <no value> should be the taskId, it also break make the configuration invalid.

In consulKV (marathon/kibana/tasks/ ) I got :

{
  "timestamp": "2015-07-16T12:41:21.370Z",
  "slaveId": "20150716-074236-1046891530-15050-30616-S0",
  "id": "kibana.f2a929ba-2bb7-11e5-a9ad-ae227afcbacd",
  "taskStatus": "TASK_RUNNING",
  "appId": "/kibana",
  "host": "dc1-docker-dev-mesos-master1.dev.dc1.kelkoo.net.node.consul",
  "ports": [
    31306
  ],
  "version": "2015-07-16T12:41:12.875Z"
}

With this id key which used to be taskId.

It's a recent modification of marathon-consul :

Incriminated (no offence, You are doing a great jog @BrianHicks ) commit : https://github.com/CiscoCloud/marathon-consul/commit/c7b968be3d23a5a70fb577ff66058f568c8d7bba#diff-a3520fb65206c9e232f10baaff310c7a

Solutions:

Change the HAproxy template and use this id key instead of taskId. It's easy and simple but I'm against this id key which is a too generic name (we already got slaveId so taskId is not a long name in comparison ).

OR

Adapt the incriminated commit (poke @BrianHicks ) and stick with taskId .

OR

go talk with marathon people and make them use consistent name for every taskId. Slowest solution since it has to be discuss and approve on marathon side and to be release in marathon.

BrianHicks commented 9 years ago

we're going to take the easy solution for now. Mesosphere is contemplating work on a V3 API for Marathon, so there will be some bigger changes coming down the pipe. We'll work with them on making sure the fields are more consistent in the new API.