I read the jira issue [0] that labels would be injected into the cni 
json. But I can't get this to work. I have changed the source of a 
plugin so it would dump the configuration files and this is how it looks 
like, when you dump the ip configured in the cni network json [1] as 
expected. When adding the labels, you get a totally different json [2], 
so how should this ever work??? 


This is not working
===================
{
  "id": "/server",
  "user": "nobody",
  "cmd": "python -m SimpleHTTPServer 8080",
  "cpus": 0.1,
  "mem": 32,
  "disk": 0,
  "instances": 1,
  "acceptedResourceRoles": ["*"],
  "constraints": [["hostname","CLUSTER","m03.local"]],
  "backoffSeconds": 10,
  "ipAddress": { "networkName": "test-macvtap-cniip" },
  "labels": { "CNI_ARGS": "IP=192.168.122.173" } }

This is also not working
========================
{
  "id": "/server",
  "user": "nobody",
  "cmd": "python -m SimpleHTTPServer 8080",
  "cpus": 0.1,
  "mem": 32,
  "disk": 0,
  "instances": 1,
  "acceptedResourceRoles": ["*"],
  "constraints": [["hostname","CLUSTER","m03.local"]],
  "backoffSeconds": 10,
  "networks": [ { "mode": "container", "name": "test-macvtap-cniip" } ],
  "env": { "CNI_ARGS" : "'IP=192.168.122.173'" } }

This does work:
===============
CNI_PATH="/usr/libexec/cni/" NETCONFPATH="/etc/mesos-cni" 
CNI_IFNAME="eth1" CNI_ARGS='IP=192.168.122.173' cnitool-0.5.2 add 
test-macvtap-cniip /var/run/netns/testing
  


[1]
===
Cni network config only
[
  {
    "args": {
      "cni": {
        "ips": [
          "192.168.122.177"
        ]
      }
    },
    "cniVersion": "",
    "dns": {
      "nameservers": [
        "192.168.10.10"
      ]
    },
    "hostrouteif": "macvtap1",
    "ipam": {
      "rangeEnd": "192.168.122.179",
      "rangeStart": "192.168.122.171",
      "routes": [
        {
          "dst": "192.168.122.22/32",
          "gw": "0.0.0.0"
        },
        {
          "dst": "192.168.10.10/32",
          "gw": "0.0.0.0"
        },
        {
          "dst": "192.168.10.22/32",
          "gw": "0.0.0.0"
        }
      ],
      "subnet": "192.168.122.0/24",
      "type": "host-local"
    },
    "master": "eth1",
    "name": "test-macvtap",
    "type": "macvtap"
  }
]


[2]
===
Dump from the marathon launched task with labels.
[
  {
    "args": {
      "org.apache.mesos": {
        "network_info": {
          "ip_addresses": [
            {
              "protocol": "IPv4"
            }
          ],
          "labels": {
            "labels": [
              {
                "key": "ips",
                "value": "192.168.122.172"
              }
            ]
          },
          "name": "test-macvtap-cniip"
        }
      }
    },
    "dns": {
      "nameservers": [
        "192.168.10.10"
      ]
    },
    "hostrouteif": "macvtap0",
    "ipam": {
      "rangeEnd": "192.168.122.179",
      "rangeStart": "192.168.122.171",
      "routes": [
        {
          "dst": "192.168.10.153/32",
          "gw": "0.0.0.0"
        }
      ],
      "subnet": "192.168.122.0/24",
      "type": "host-local"
    },
    "master": "eth1",
    "name": "test-macvtap-cniip",
    "type": "macvtap"
  }
]

[0] https://issues.apache.org/jira/browse/MESOS-5592



Reply via email to