Next step in simulating mesos runtime
authorMichael C Cambria <mcc@node.halfball.org>
Thu, 31 Aug 2017 15:49:57 +0000 (15:49 +0000)
committerMichael C Cambria <mcc@node.halfball.org>
Thu, 31 Aug 2017 15:49:57 +0000 (15:49 +0000)
mcc-add-anycast.sh
mcc-del-anycast.sh
mesos-test-add.sh [new file with mode: 0755]
mesos-test-del.sh [new file with mode: 0755]
mesos-test.conf [new file with mode: 0644]
test.conf

index fd4a471..0f50d7d 100755 (executable)
@@ -13,6 +13,6 @@ export CAP_ARGS='{
 }'
 
 #./cnitool add anycast /var/run/netns/test0
-/home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool add anycast /var/run/netns/test0
+sudo -E /home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool add anycast /var/run/netns/test0
 
 
index 95d309a..2ac6860 100755 (executable)
@@ -13,6 +13,6 @@ export CAP_ARGS='{
 }'
 
 #./cnitool add anycast /var/run/netns/test0
-/home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool del anycast /var/run/netns/test0
+sudo -E /home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool del anycast /var/run/netns/test0
 
 
diff --git a/mesos-test-add.sh b/mesos-test-add.sh
new file mode 100755 (executable)
index 0000000..2440507
--- /dev/null
@@ -0,0 +1,11 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+export CNI_ARGS="IP=10.244.10.20"
+export MCCVAL="Jamal Env Value"
+
+sudo -E  /home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool add mesos-test /var/run/netns/test0
+
+
diff --git a/mesos-test-del.sh b/mesos-test-del.sh
new file mode 100755 (executable)
index 0000000..4d41c6a
--- /dev/null
@@ -0,0 +1,11 @@
+#/bin/bash
+export DEBUG=1
+export NETCONFPATH=/home/mcc/go/src/github.com/containernetworking/plugins
+export CNI_PATH=/home/mcc/go/src/github.com/containernetworking/plugins/bin
+
+export CNI_ARGS="IP=10.244.10.20"
+export MCCVAL="Jamal Env Value"
+
+sudo -E  /home/mcc/go/src/github.com/containernetworking/cni/cnitool/cnitool del mesos-test /var/run/netns/test0
+
+
diff --git a/mesos-test.conf b/mesos-test.conf
new file mode 100644 (file)
index 0000000..6704b98
--- /dev/null
@@ -0,0 +1,38 @@
+{
+  "name": "mesos-test",
+  "cniVersion": "0.3.1",
+      "type": "bridge",
+      "bridge": "mynet",
+      "ipMasq": true,
+      "isGateway": true,
+      "isDefaultGateway": true,
+    "args" : {
+      "org.apache.mesos" : {
+        "network_info" : {
+          "name" : "mynet",
+          "labels" : {
+            "labels" : [
+              { "key" : "app", "value" : "myapp" },
+              { "key" : "mccKey1", "value" : "mccVal1" },
+              { "key" : "bs", "value" : "bsVal" },
+              { "key" : "StaticIP", "value" : "172.19.0.209" },
+              { "key" : "Uplink", "value" : "eth1p0" },
+              { "key" : "viaIP", "value" : "172.19.0.1" },
+              { "key" : "mccKey2", "value" : "mccVal2" },
+              { "key" : "env", "value" : "prod" }
+            ]
+          }
+        }
+      }
+    },
+      "ipam": {
+       "type": "host-local",
+       "subnet": "10.244.10.0/24",
+       "rangeStart": "10.244.10.2",
+       "rangeEnd": "10.244.10.25",
+       "routes": [
+          { "dst": "0.0.0.0/0"  }
+       ]
+      }
+}
+
index 26219cb..3344a29 100644 (file)
--- a/test.conf
+++ b/test.conf
@@ -5,6 +5,7 @@
       "bridge": "mynet",
       "ipMasq": true,
       "isGateway": true,
+      "isDefaultGateway": true,
       "ipam": {
       "type": "host-local",
       "subnet": "10.244.10.0/24",