slave dynamic port mapping for docker containers

222 views
Skip to first unread message

Joe Stein

unread,
Sep 11, 2014, 10:19:51 PM9/11/14
to marathon-...@googlegroups.com
Hi, I am trying to get a docker container to link to a dynamic port that the slave assigns but it doesn't seem to be working.  It keeps getting mapped to 1:1 for what is in the container to the slave for the containers port.

In the case below 80,8125,8126 but i am setting 0,0,0

{
  "id": "\/grafana",
  "cmd": null,
  "args": [
    
  ],
  "user": null,
  "env": {
    
  },
  "instances": 1,
  "cpus": 0.5,
  "mem": 128,
  "disk": 0,
  "executor": "",
  "constraints": [
    
  ],
  "uris": [
    
  ],
  "storeUrls": [
    
  ],
  "ports": [
    0,
    0,
    0
  ],
  "requirePorts": false,
  "backoffSeconds": 1,
  "backoffFactor": 1.15,
  "container": {
    "type": "DOCKER",
    "volumes": [
      {
        "containerPath": "\/etc\/localtime",
        "hostPath": "\/etc\/localtime",
        "mode": "RO"
      }
    ],
    "docker": {
      "image": "kamon\/grafana_graphite"
    }
  },
  "healthChecks": [
    
  ],
  "dependencies": [
    
  ],
  "upgradeStrategy": {
    "minimumHealthCapacity": 1
  },
  "version": "2014-09-12T01:28:35.141Z"
}
In marathon I have 

IDStatusVersion Updated
grafana.e9d83984-3a1a-11e4-a042-3ea7733f1fa9
slave1:[311353113631137]

But it is really just running on the slave on 80 http://192.168.3.5/#/dashboard/file/default.json

Wasn't sure if I was doing something wrong, defect or not implemented yet let me know please.

Thanks!

Everything else is awesome so far!!!!

/*******************************************
 Joe Stein
 Founder, Principal Consultant
 Big Data Open Source Security LLC
 Twitter: @allthingshadoop
********************************************/

Connor Doyle

unread,
Sep 11, 2014, 11:51:29 PM9/11/14
to Joe Stein, marathon-...@googlegroups.com
Hi Joe,

You didn't do anything wrong.  This feature is not implemented yet (but it's already in the works).
The docker containerizer released with Mesos 0.20.0 supports only the "host" Docker networking mode.

Tim Chen has made a lot of progress already in exposing the bridge networking mode.
Meanwhile, there is a branch of Marathon with preliminary work paralleling the in-progress Mesos features.

Read all about it and follow along here: https://github.com/mesosphere/marathon/issues/587

We plan to release soon after it's available in Mesos, most likely in the next point release (0.7.1).

Let us know if you have any more questions or feedback about this.

Thanks for checking out the RC!
--
Connor


--
You received this message because you are subscribed to the Google Groups "marathon-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marathon-framew...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobi Knaup

unread,
Sep 12, 2014, 12:06:59 AM9/12/14
to Connor Doyle, Joe Stein, marathon-...@googlegroups.com
With the current release you can make it work by overriding the default cmd/entrypoint in the Docker with a "cmd" param in Marathon that reads the ports from the PORT, PORT1, ... env vars.
--
Tobi Knaup
CTO & Founder

Joe Stein

unread,
Sep 12, 2014, 1:02:32 AM9/12/14
to Tobi Knaup, Connor Doyle, marathon-...@googlegroups.com
cool, cool, thanks!

/*******************************************
 Joe Stein
 Founder, Principal Consultant
 Big Data Open Source Security LLC
 Twitter: @allthingshadoop
********************************************/


Reply all
Reply to author
Forward
0 new messages