[
https://issues.apache.org/jira/browse/MESOS-3740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15630652#comment-15630652
]
Jie Yu commented on MESOS-3740:
-------------------------------
My proposal:
https://www.mail-archive.com/[email protected]/msg36702.html
{noformat}
OK, guys. Thanks for the input! Here is my proposal:
1) If the container uses host network, Mesos agent will set
LIBPROCESS_ADVERTISE_IP
to agent IP. This is for the case where DNS is not configured properly on
the host (we don't need to do that if DNS is configured properly). By doing
this, libprocess will skip hostname lookup and advertise
LIBPROCESS_ADVERTISE_IP
directly.
2) If the container uses non-host network, and defines port mapping (e.g.,
bridge). Mesos agent will not set any libprocess env variables. Given that
there could be multiple mapped ports, Mesos agent don't know how to
set LIBPROCESS_ADVERTISE_PORT.
So it's framework's responsibility to set LIBPROCESS_ADVERTISE_IP and
LIBPROCESS_ADVERTISE_PORT
properly in this case (through CommandInfo.environment)
3) If the container uses non-host network, and does not define port mapping
(e.g., ip per container). Mesos agent will not set any libprocess env
variables. In this case, both CNI isolator and docker engine will properly
setup DNS in the container so hostname lookup should work properly.
{noformat}
> LIBPROCESS_IP not passed to Docker containers
> ---------------------------------------------
>
> Key: MESOS-3740
> URL: https://issues.apache.org/jira/browse/MESOS-3740
> Project: Mesos
> Issue Type: Bug
> Components: containerization, docker
> Affects Versions: 0.25.0
> Environment: Mesos 0.24.1
> Reporter: Cody Maloney
> Labels: mesosphere
>
> Docker containers aren't currently passed all the same environment variables
> that Mesos Containerizer tasks are. See:
> https://github.com/apache/mesos/blob/master/src/slave/containerizer/containerizer.cpp#L254
> for all the environment variables explicitly set for mesos containers.
> While some of them don't necessarily make sense for docker containers, when
> the docker has inside of it a libprocess process (A mesos framework
> scheduler) and is using {{--net=host}} the task needs to have LIBPROCESS_IP
> set otherwise the same sort of problems that happen because of MESOS-3553 can
> happen (libprocess will try to guess the machine's IP address with likely bad
> results in a number of operating environment).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)