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 2018/12/10 17:32:30 UTC

[mesos] branch master updated: Added UCR bridge network for Mesos Mini.

This is an automated email from the ASF dual-hosted git repository.

jieyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c91e2a  Added UCR bridge network for Mesos Mini.
3c91e2a is described below

commit 3c91e2ab79493b3c8bb262e744b3ab39d6d59816
Author: Jie Yu <yu...@gmail.com>
AuthorDate: Sun Dec 9 22:08:54 2018 -0800

    Added UCR bridge network for Mesos Mini.
    
    This patch adds the UCR bridge network support for Mesos Mini using CNI
    bridge plugin and Mesos port mapper CNI plugin.
    
    Review: https://reviews.apache.org/r/69538
---
 support/mesos-mini/Dockerfile                    | 11 ++++++++++-
 support/mesos-mini/mesos/agent_environment       |  2 +-
 support/mesos-mini/mesos/master_environment      |  2 ++
 support/mesos-mini/mesos/ucr-default-bridge.json | 22 ++++++++++++++++++++++
 4 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/support/mesos-mini/Dockerfile b/support/mesos-mini/Dockerfile
index f8af422..1211ce9 100644
--- a/support/mesos-mini/Dockerfile
+++ b/support/mesos-mini/Dockerfile
@@ -2,7 +2,7 @@ ARG BASE_IMAGE_NAME
 
 FROM $BASE_IMAGE_NAME
 
-RUN yum install -y java-1.8.0-openjdk iptables
+RUN yum install -y java-1.8.0-openjdk iptables iproute
 
 # Prepare systemd environment.
 ENV container docker
@@ -56,6 +56,15 @@ COPY mesos/master_environment /etc/default/mesos-master
 COPY mesos/agent_environment /etc/default/mesos-agent
 COPY mesos/modules /etc/mesos/modules
 
+# Prepare CNI environment.
+ARG CNI_PLUGINS_URL=https://github.com/containernetworking/plugins/releases/download/v0.7.4/cni-plugins-amd64-v0.7.4.tgz
+
+RUN curl -sL $CNI_PLUGINS_URL -o /cni-plugins.tgz && \
+    tar xzvf /cni-plugins.tgz -C /usr/libexec/mesos/cni && \
+    rm -f /cni-plugins.tgz
+
+COPY mesos/ucr-default-bridge.json /etc/mesos/cni/
+
 # Prepare Marathon environment.
 ARG MARATHON_URL=https://downloads.mesosphere.com/marathon/releases/1.6.322/marathon-1.6.322-2bf46b341.tgz
 ARG MARATHON_INSTALL_DIR=/usr/local/marathon
diff --git a/support/mesos-mini/mesos/agent_environment b/support/mesos-mini/mesos/agent_environment
index 4876728..d239138 100644
--- a/support/mesos-mini/mesos/agent_environment
+++ b/support/mesos-mini/mesos/agent_environment
@@ -1,5 +1,5 @@
-MESOS_ADVERTISE_IP=127.0.0.1
 MESOS_HOSTNAME_LOOKUP=false
+MESOS_HOSTNAME=localhost
 MESOS_WORK_DIR=/var/lib/mesos/agent
 MESOS_MASTER=127.0.0.1:5050
 MESOS_CONTAINERIZERS=mesos,docker
diff --git a/support/mesos-mini/mesos/master_environment b/support/mesos-mini/mesos/master_environment
index 0382558..b427164 100644
--- a/support/mesos-mini/mesos/master_environment
+++ b/support/mesos-mini/mesos/master_environment
@@ -1,3 +1,5 @@
+MESOS_CLUSTER=mesos-mini
 MESOS_ADVERTISE_IP=127.0.0.1
 MESOS_HOSTNAME_LOOKUP=false
+MESOS_HOSTNAME=localhost
 MESOS_WORK_DIR=/var/lib/mesos/master
diff --git a/support/mesos-mini/mesos/ucr-default-bridge.json b/support/mesos-mini/mesos/ucr-default-bridge.json
new file mode 100644
index 0000000..10f2461
--- /dev/null
+++ b/support/mesos-mini/mesos/ucr-default-bridge.json
@@ -0,0 +1,22 @@
+{
+  "name": "mesos-bridge",
+  "type": "mesos-cni-port-mapper",
+  "excludeDevices": ["ucr-br0"],
+  "chain": "UCR-DEFAULT-BRIDGE",
+  "delegate": {
+    "type": "bridge",
+    "bridge": "ucr-br0",
+    "isDefaultGateway": true,
+    "forceAddress": false,
+    "ipMasq": true,
+    "hairpinMode": true,
+    "ipam": {
+      "type": "host-local",
+      "dataDir": "/var/run/mesos/cni/networks",
+      "subnet": "172.31.254.0/24",
+      "routes": [
+        { "dst": "0.0.0.0/0" }
+      ]
+    }
+  }
+}