d2iq-archive / mesos-dns

DNS-based service discovery for Mesos.
https://mesosphere.github.com/mesos-dns
Apache License 2.0
483 stars 137 forks source link

Support IPv6 #508

Closed drewkerrigan closed 7 years ago

drewkerrigan commented 7 years ago

Get DC/OS with IPv6

Start a new DC/OS cluster with this image:

wget https://downloads.dcos.io/dcos/testing/pull/1842/dcos_generate_config.sh

Replace existing Mesos-DNS

On each master, update Mesos-DNS config:

In /opt/mesosphere/etc/mesos-dns.json:

Change "IPSources": ["host", "netinfo"], -> "IPSources": ["netinfo", "host"],

Then get the new mesos-dns with the following commands:

cd /opt/mesosphere/packages/mesos-dns--600da87080b7634f2380594499004a7ff0b34662/bin
mv mesos-dns mesos-dns.bak
curl -O https://959-26509179-gh.circle-artifacts.com/0/tmp/circle-artifacts.Dv9WDHl/mesos-dns--linux-amd64 --output mesos-dns--linux-amd64
mv mesos-dns--linux-amd64 mesos-dns
chmod 755 mesos-dns
systemctl restart dcos-mesos-dns.service

Create a test app on dcos6 network

{
    "id": "/ipv6-nginx",
    "cmd": "nginx -g 'daemon off;'",
    "instances": 1,
    "cpus": 0.1,
    "mem": 32,
    "container": {
        "type": "DOCKER",
        "docker": {
            "image": "nginx:stable"
        },
        "portMappings": [
            {
                "containerPort": 80,
                "protocol": "tcp",
                "name": "web"
            }
        ]
    },
    "requirePorts": false,
    "networks": [
        {
            "name": "dcos6",
            "mode": "container"
        }
    ],
    "healthChecks": [],
    "fetch": [],
    "constraints": []
}

Test the changes

dig ipv6-nginx.marathon.mesos ANY

dig ipv6-nginx.marathon.mesos AAAA

dig _ipv6-nginx._tcp.marathon.mesos SRV

curl leader.mesos:8123/v1/hosts/ipv6-nginx.marathon.mesos

curl leader.mesos:8123/v1/services/_ipv6-nginx._tcp.marathon.mesos

curl leader.mesos:8123/v1/enumerate
drewkerrigan commented 7 years ago

@jdef PTAL.

re: "ipv4 is preferred in several places to ipv6 - why?"

re: "also, what's up with the flapping mesos-go deps?"

re: "in the future it would be great to have a more well-structured commit stream to simplify the review process"

drewkerrigan commented 7 years ago

@jdef PTAL, I made some minor updates to the docs and addressed the other comments.

drewkerrigan commented 7 years ago

@jdef @urbanserj ping - updated the description with steps to test it out if you're interested.

drewkerrigan commented 7 years ago

@jdef yes we'll add integration tests with the related DC/OS PR