CiscoCloud / marathon-consul

bridge Marathon information to Consul KV
Apache License 2.0
85 stars 18 forks source link

unconsistent behaviour for service port #7

Closed tgermain closed 9 years ago

tgermain commented 9 years ago

Problem

I cannot understand the logic of port mapping and service port in marathon and using marthon-consul

Working part :

This is a json file describing an app running on Marathon and the result in my KV store in consul : https://gist.github.com/tgermain/32e0387ba9f1491a2aad

Note the Ports part in the KV store :

    "ports":[
        30501,
        10002
    ],

The specified port 30501 is still there, and the servicePort=0 as been assigned to a free port of the host, here 10002.

Not working part

Here a slightly different json file discribing the same app with a different portMapping and the result in my KV store in consul : https://gist.github.com/tgermain/add38414effe1557d612

Here is the problem :

    "ports":[
        0
    ],

There no trace of the port 30501 and consul-marathon ( & consul-template) interpret this as "easy-python-app is listening on port 0 on the host ". I don't think you can listen on port 0, with my fair knowledge on network.

Any hint ? Am I missing something in port mapping definition ? Is it related to marathon more than marathon-consul ?

BrianHicks commented 9 years ago

Is the bad result the same in marathon or only marathon-consul? If it is we'll see about fixing it here, but if we're working with bad upstream data there's not much we can do, sadly.

tgermain commented 9 years ago

I think about after posting the issue, it's related to marathon for sure.

The data in marathon are wrong, so it's not your fault. I'll contact marathon people to make it clearer.

BrianHicks commented 9 years ago

Weird bug though! Thanks for clarifying.

tgermain commented 9 years ago

Up : this is a known bug in marathon : https://github.com/mesosphere/marathon/issues/1365

The patch will be include in release 0.9, soon to be release.

BrianHicks commented 9 years ago

Great! I've been testing with the RCs, so we should be good as soon as it's released. :D