1

I have a running Mesos/Marathon cluster but the ip of the running instances is not propagated to the Marathon-UI or the traefik proxy.

My mesos setup:

ExecStart=/bin/bash -c "/usr/sbin/mesos-slave \
            --hostname=$(/usr/bin/hostname) \
            --work_dir=/var/lib/mesos \
            --master=zk://xxx.net:2181,yyy:2181,zzz:2181/mesos \
            --log_dir=/var/log/mesos \
            --executor_registration_timeout=10mins \
            --containerizers=docker,mesos \
            --docker=$(which docker) \
            --ip=$(ifconfig eth0 | grep -oP 'inet \K\S+')"

My treafik conf:

logLevel = "INFO"
[web]
address = ":8088"
[marathon]
endpoint = "http://xxx:8080"
watch = true
domain = "xxx"
exposedByDefault = true
groupsAsSubDomains = true
forceTaskHostname = true

[accessLog]

enter image description here enter image description here

UPDATE: The application definition is:

{
  "id": "/web",
  "cmd": null,
  "cpus": 1,
  "mem": 64,
  "disk": 0,
  "instances": 1,
  "acceptedResourceRoles": [
    "*"
  ],
  "container": {
    "type": "DOCKER",
    "volumes": [],
    "docker": {
      "image": "ldaume/caddy",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 2015,
          "hostPort": 0,
          "servicePort": 10001,
          "protocol": "tcp",
          "labels": {}
        }
      ],
      "privileged": false,
      "parameters": [],
      "forcePullImage": false
    }
  },
  "portDefinitions": [
    {
      "port": 10001,
      "protocol": "tcp",
      "labels": {}
    }
  ]
}

The app is accessible if I use the Marathon DNS with the given port.

Lenny
  • 143
  • 7
  • Can you please specify what version of Marathon you're using, and add a sanitized app definition? Ivan on the Marathon team says "If it is Marathon 1.5.x, then the answer is probably easy, because Marathon is outdated, and there are some breaking networking-related changes in 1.5. Probably the same applies to traefik". Although it might not be the same for traefik considering the below answer. – Judith Malnick Oct 18 '17 at 20:14
  • Of cause @JudithMalnick. I'm using Mesos 1.4 with Marathon 1.4.8 (tried 1.5.1 before) on debian stretch (9) and traefik 1.4 – Lenny Oct 18 '17 at 20:22
  • Sweet, thanks! Could you add your application or pod definition? – Judith Malnick Oct 18 '17 at 20:44
  • I updated the post with the app definition ;) – Lenny Oct 19 '17 at 07:11

1 Answers1

0

I have the same setup as you and I have mine reporting correctly. I am using 1.4 traefik. Traefik config is very simple:

################################################################
# Global configuration
################################################################

defaultEntryPoints = ["http"]


################################################################
# Web configuration backend
################################################################

[web]
  address = ":8081"

################################################################
# Marathon configuration backend
################################################################


[marathon]
  endpoint = "http://172.31.xx.xx:8080"

  domain = "marathon.localhost"

  watch = true

...... That is an AWS setup using docker containers where endpoint is the internal VPC IP, not the external AWS IP.