Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-7631

DefautlExecutor needs to inform tasks about IP addresses

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • executor
    • None
    • Mesosphere Sprint 57, Mesosphere Sprint 58

    Description

      Currently, when the DefaultExecutor launches tasks it doesn’t pass any networking information (host or CNI network IP addresses) to the tasks that it launches. This becomes problematic for the applications which need to know the IP address that they need to bind to and cannot rely on binding to INADDR_ANY. The tasks launched by the DefaultExecutor can potentially look at all the available interface IP addresses and select a non-loopback IP address but this is very error prone when there are multiple interfaces on a host or a container is attached to multiple networks.

      Possible solution:
      The DefaultExecutor sets a variable MESOS_TASK_IP into the task’s shell. The task will always read the variable to determine the IP address it should use. Below we describe the algorithm to set MESOS_CONTAINER_IP for various cases.

      Setting MESOS_CONTAINER_IP for `host` network:
      For host network the `LIBPROCESS_IP` in the DefaultExecutor is always set to the agent IP. The DefaultExecutor can therefore set `MESOS_TASK_IP` to the `LIBPROCESS_IP` whenever it sees that the LIBPROCESS_IP is anything other than “0.0.0.0” or “::” (for IPv6).
      Setting MESOS_TASK_IP for a single “CNI” network:
      For CNI network the `LIBPROCESS_IP` is set to “0.0.0.0” and the `hostname` of the container is set to the CNI ip address. The DefaultExecutor already resolves the hostname for CNI network (to register with agent), so it can just set MESOS_TASK_IP to the IP address it learnt by resolving the hostname.

      Attachments

        Activity

          People

            avinash.mesos Avinash Sridharan
            avinash.mesos Avinash Sridharan
            Anand Mazumdar Anand Mazumdar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: