You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Avinash Sridharan (JIRA)" <ji...@apache.org> on 2017/06/06 21:28:18 UTC

[jira] [Updated] (MESOS-7631) DefautlExecutor needs to inform tasks about IP addresses

     [ https://issues.apache.org/jira/browse/MESOS-7631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Avinash Sridharan updated MESOS-7631:
-------------------------------------
    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.



> DefautlExecutor needs to inform tasks about IP addresses
> --------------------------------------------------------
>
>                 Key: MESOS-7631
>                 URL: https://issues.apache.org/jira/browse/MESOS-7631
>             Project: Mesos
>          Issue Type: Task
>          Components: executor
>            Reporter: Avinash Sridharan
>            Assignee: Anand Mazumdar
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)