0

Tried setting VIP (non name based with IP and port) as described in the documentation

Also referred the Marathon examples.

Writing the sample json here (same as the one in above link)

{
  "id": "/server",
  "cmd": "python -m SimpleHTTPServer 80",
  "cpus": 1,
  "mem": 128,
  "disk": 0,
  "instances": 1,
  "container": {
    "docker": {
      "image": "python:2.7-alpine",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 80,
          "protocol": "tcp",
          "name": "http",
          "labels": {
            "VIP_0": "192.168.0.100:80"
          }
        }
      ]
    },
    "type": "DOCKER"
  }
}

But as per the original expectation in the documentation the IP 192.168.0.100:80 should be reachable from nodes the cluster.. But apparently this doesn't work for me.. A simple Curl fails.. I need to make access this application accessible from other process which are not mesos-dns aware.

Tombart
  • 30,520
  • 16
  • 123
  • 136
Radeep R
  • 3
  • 1
  • Which DC/OS version are you running? First you are referencing old 1.7 documentation. Secondly, I just tried on a 1.10 cluster and it works for me ```curl 192.168.0.100:80 ``` – js84 Oct 09 '17 at 18:19
  • We are currently in 1.8.7 release.. Could you confirm if you are able to curl from the terminal in the cluster and not inside any other marathon application..? – Radeep R Oct 10 '17 at 15:29
  • I could curl it from the master node, see above – js84 Oct 10 '17 at 18:19

1 Answers1

0

The configuration you're using would require a USER network, simply replace the IP address by a name:

  "portMappings": [
        {
          "containerPort": 80,
          "protocol": "tcp",
          "name": "http",
          "labels": {
            "VIP_0": "web-app:80"
          }
        }
      ]

and then it should be reachable at web-app.marathon.l4lb.thisdcos.directory:80

Tombart
  • 30,520
  • 16
  • 123
  • 136