You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/04/06 20:41:46 UTC
mesos git commit: Reset the `LIBPROCESS_IP` environment variable in
`network/cni`.
Repository: mesos
Updated Branches:
refs/heads/master 15088c43c -> c5b508489
Reset the `LIBPROCESS_IP` environment variable in `network/cni`.
Currently the `LIBPROCESS_IP` environment variable was being set to the
Agent IP if the environment variable has not be defined by the
`Framework`. For containers having their own IP address (as with
containers on CNI networks) this becomes a problem since the command
executor tries to bind to the `LIBPROCESS_IP` that does not exist in its
network namespace, and fails. Thus, for containers launched on CNI
networks the `LIBPROCESS_IP` should not be set, or rather is set to
"0.0.0.0", allowing the container to bind to the IP address provided by
the CNI network.
Review: https://reviews.apache.org/r/45801/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c5b50848
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c5b50848
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c5b50848
Branch: refs/heads/master
Commit: c5b5084894b36c64f89337a6b7db9e6ffe62013b
Parents: 15088c4
Author: Avinash sridharan <av...@mesosphere.io>
Authored: Wed Apr 6 11:40:53 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Apr 6 11:41:39 2016 -0700
----------------------------------------------------------------------
.../containerizer/mesos/isolators/network/cni/cni.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c5b50848/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp b/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
index f43ab07..159152a 100644
--- a/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
+++ b/src/slave/containerizer/mesos/isolators/network/cni/cni.cpp
@@ -558,6 +558,17 @@ Future<Option<ContainerLaunchInfo>> NetworkCniIsolatorProcess::prepare(
infos.put(containerId, Owned<Info>(new Info(containerNetworks)));
ContainerLaunchInfo launchInfo;
+
+ // Reset the `LIBPROCESS_IP` in the environment variable, so that
+ // the container binds to the IP address allocated by the CNI
+ // plugin. See MESOS-3553 to understand why we need to reset the
+ // `LIBPROCESS_IP`.
+ Environment_Variable* env =
+ launchInfo.mutable_environment()->add_variables();
+
+ env->set_name("LIBPROCESS_IP");
+ env->set_value("0.0.0.0");
+
launchInfo.set_namespaces(CLONE_NEWNET | CLONE_NEWNS | CLONE_NEWUTS);
return launchInfo;