Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-7092

Manual port mapping is not working


    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Docs
    • Labels:
    • Customer Issue Status:
      a clearer doc would be nice!


      Hi there,

       I have some issues with port mapping on marathon. I'm trying to manually assign a port to a given docker. 

       According to https://github.com/mesosphere/marathon/blob/master/docs/docs/ports.md :

      portMapping: In Docker BRIDGE mode, a port mapping is necessary for every port that should be reachable from outside of your container. A port mapping is a tuple containing a host port, container port, service port and protocol. Multiple port mappings may be specified for a Marathon application; an unspecified hostPort defaults to 0 (meaning that Marathon will assign one at random). In Docker USER mode the semantic for hostPort slightly changes: hostPort is not required for USER mode and if left unspecified Marathon WILL NOT automatically allocate one at random. This allows containers to be deployed on USER networks that include containerPort and discovery information, but do NOT expose those ports on the host network (and by implication would not consume host port resources).

      If I want to use the manual port mapping, I just have to change the default "0" value on hostPort, to the assigned port. Taking this post in example, we can assume that my json app should look like the attached json. Yet, when I apply the configuration, marathon stales ad vitam the deployment processus and no taks is ever assigned to anyone. Am I missing something here?


      Forgot to mention : I'm on debian jessie, using :

      ii marathon 1.4.1-1.0.633.debian81 amd64 Cluster-wide init and control system for services running on Apache Mesos
      ii mesos 1.1.0-2.0.107.debian81 amd64 Cluster resource manager with efficient resource isolation

      the packaged versions of mesos and marathon. My setup can run docker and mesos tasks just fine, the only issue I have so far is with port mapping.




            • Assignee:
              marco.monaco Marco Monaco
              theonlydoo theonlydoo
              Orchestration Team
              Jason Gilanfarr (Inactive), theonlydoo
            • Watchers:
              2 Start watching this issue


              • Created: