mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Avinash sridharan <avin...@mesosphere.io>
Subject Review Request 61237: Updated docker executor to return IPv6 address of a container.
Date Sat, 29 Jul 2017 00:51:11 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/61237/
-----------------------------------------------------------

Review request for mesos, Jie Yu and Qian Zhang.


Bugs: MESOS-7807
    https://issues.apache.org/jira/browse/MESOS-7807


Repository: mesos


Description
-------

A docker container can have a v4 and a v6 address. Currently the docker
executor was returning only the IPv4 address. This changes allows the
executor to return the IPv4 and IPv6 address of the container.


Diffs
-----

  src/docker/docker.hpp 5593cb635e073334c6c2566be3d803cd7febb1c3 
  src/docker/docker.cpp 8081c0203bf62cf62aa3b93d745f0e829ad65509 
  src/docker/executor.cpp e03f24461ec7b19cacae79c020406f0a475f2d19 


Diff: https://reviews.apache.org/r/61237/diff/1/


Testing
-------

Start agent:
sudo ./bin/mesos-agent.sh --ip=10.0.2.15 --master=10.0.2.15:5050 --work_dir=/tmp/mesos --containerizers=mesos,docker

Start master:
sudo ./bin/mesos-master.sh --ip=10.0.2.15 --work_dir=/tmp/mesos-master

Use mesos-execute to launch a docker container on an IPv6 network:
sudo src/mesos-execute --master=10.0.2.15:5050 --task=file:///home/vagrant/dev/mesos_tasks/docker.json
2> log.txt

cat /home/vagrant/dev/mesos_tasks/docker.json
{
  "name": "test",
  "task_id": {"value" : "test"},
  "agent_id": {"value" : ""},
  "resources": [
    {
      "name": "cpus",
      "type": "SCALAR",
      "scalar": {
        "value": 0.1
      }
    },
    {
      "name": "mem",
      "type": "SCALAR",
      "scalar": {
        "value": 32
      }
    }
  ],
  "command": {
    "shell": false
  },
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "nginx",
      "network": "USER"
    },
    "network_infos": [
        {
          "name": "ipv6"
        }
    ]
  }
}


Curl the Mesos state to make sure that the right IPv6 addresses are reflected for the container:
 curl http://10.0.2.15:5051/state | jq

"role": "*",
              "statuses": [
                {
                  "state": "TASK_RUNNING",
                  "timestamp": 1501288232.79384,
                  "container_status": {
                    "container_id": {
                      "value": "59319a5b-a28b-46bf-a20f-8472e6598abd"
                    },
                    "network_infos": [
                      {
                        "ip_addresses": [
                          {
                            "protocol": "IPv4",
                            "ip_address": "172.19.0.2"
                          },
                          {
                            "protocol": "IPv6",
                            "ip_address": "fd00:0:0:1::2"
                          }
                        ],
                        "name": "ipv6"
                      }
                    ]
                  }
                }
              ],
              "container": {
                "type": "DOCKER",
                "docker": {
                  "image": "nginx",
                  "network": "USER",
                  "privileged": false
                },
                "network_infos": [
                  {
                    "name": "ipv6"
                  }
                ]
              }
            }
          ],


Thanks,

Avinash sridharan


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message