Search code examples
marathondcos

Marathon Service Ports


I know that 'servicePort' is used by marathon-lb to identify an app. Is there any other user of this setting besides marathon-lb?
If the answer is no, why is it mandatory (omitting it well generate one for me)? I have many marathon apps which are not managed by marathon-lb, and they all take up service ports by default.


Solution

  • From the documentation: ""servicePort" is a helper port intended for doing service discovery using a well-known port per service. The assigned servicePort value is not used/interpreted by Marathon itself but supposed to be used by the load balancer infrastructure."

    So service ports seem to have no other use other than for marathon-lb. When you don't specify a servicePort, its as if you put in "servicePort": 0. See closed issue here.

    Here's a discussion about the re-architected networking API.

    If you look at the Jira ticket, you will see that the new API model lets you define services without servicePorts at all.