-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker service registration for IPv6 addresses fails #6412
Comments
Thanks for the details! If you have
I'm afraid Nomad is scheduling onto the IPv4 address first, although I'm unsure why that address isn't being displayed in the CLI output. Unfortunately you can only specify which network_interface Nomad should schedule on, but not choose which IP address on that interface is preferred. Luckily Docker is doing the right thing and your service is available on the intended IPv6 address. The IPv6 address should be advertised in Consul as well. Could you paste the output of:
FixesI believe there are 2 things we need to do:
|
Sorry I haven't had time to test this yet, so I've held off on replying but I felt I should let you know I still plan to give your steps a run @schmichael I just have another backlog of work to get through – I've had to apply some workarounds as I cannot use Nomad until this works. An alternative might be Podman (with IPv6 of course) but I am unfamiliar with Drivers for Nomad and how to extend them. |
@tsujp I'm using the same setup for a while now. The address should be published in consul. |
(1)
(2) No output. EDIT: for (2) I didn't have Consul running at all, I quickly skimmed the docs to get something up (for a ninja edit) and the curl command still returns nothing, at it's base it's
When I view the Consul UI and go to I assume as @42wim states this means everything is working under the hood (as how else is it going to determine the correct address) but that it's just a Nomad UI error in both the Web UI and CLI @schmichael |
I have this same issue. On some wifi networks, the unique IP address is When that happens, my tasks fail:
[
{
"CIDR": "fd67:2a00:1152:1:6a:8c9e:b809:7d5f/128",
"DNS": null,
"Device": "en0",
"DynamicPorts": null,
"Hostname": "",
"IP": "fd67:2a00:1152:1:6a:8c9e:b809:7d5f",
"MBits": 1000,
"Mode": "host",
"ReservedPorts": null
},
{
"CIDR": "2406:5a00:1011:7b00:186b:fea3:d955:36b8/128",
"DNS": null,
"Device": "en0",
"DynamicPorts": null,
"Hostname": "",
"IP": "2406:5a00:1011:7b00:186b:fea3:d955:36b8",
"MBits": 1000,
"Mode": "host",
"ReservedPorts": null
},
{
"CIDR": "2406:5a00:1011:7b00:64a5:2481:bc7e:22b3/128",
"DNS": null,
"Device": "en0",
"DynamicPorts": null,
"Hostname": "",
"IP": "2406:5a00:1011:7b00:64a5:2481:bc7e:22b3",
"MBits": 1000,
"Mode": "host",
"ReservedPorts": null
},
{
"CIDR": "192.168.4.55/32",
"DNS": null,
"Device": "en0",
"DynamicPorts": null,
"Hostname": "",
"IP": "192.168.4.55",
"MBits": 1000,
"Mode": "host",
"ReservedPorts": null
}
] I would prefer to force the nomad client to use the It looks like part of the issue is that |
Hey all, this has been open a while, and various things have changed over the years. I'll try to summarize them here before closing out the issue. 1. IPv6 not showing in CLI / UI:I can only reproduce this happening one way, which is also today true of IPv4 addresses, with this config: job "job" {
group "grp" {
task "tsk" {
driver = "docker"
config = {...}
service {
name = "web"
port = 8000
}
}
}
} Notes: the The proper format for this nowadays would be: job "job" {
group "grp" {
network {
port "http" {
static = 8000
}
}
service {
name = "web"
port = "http"
provider = "nomad" # or default "consul"
}
task "tsk" {
driver = "docker"
config = {
...
ports = ["http"]
}
}
}
} This makes the static port available to Nomad for scheduling (to prevent port collisions), and it's passed down to service and task by its label "http" rather than number. Both Which brings us to IPv6: 2. Ability to prefer an address family when schedulingInstead of asking Docker to provide an IPv6, you can now (as of #23388 -> Nomad 1.8.2) set E.g. My laptop has these addresses:
By default, my services would get that
("web" service and "http" port label are from my example jobspec in part 1 above) With
Note: If you use Finally, for folks with the opposite issue, to avoid IPv6, you may try setting So with all that, I'm closing this out, but please let us know if we missed something important! |
Nomad version
Nomad v0.9.5 (1cbb2b9)
Docker version
Docker info
Operating system and Environment details
None applicable, nothing but a barebones install of Nomad, Docker, and a basic hello world container.
Issue
Nomad does not show the service IP of the Docker container, yet Docker reports the container IP via direct inspection of the properties the Service stanza should be grabbing the IP from.
Reproduction steps
nomad agent -dev
after fresh install, no other nomad configuration./etc/docker/daemon.json
Addresses
on the CLI or on the Nomad UI.Job file (if appropriate)
Nomad Job Allocation
Host Interfaces from
ip a s
Docker network inspect bridge
Notes
I have tested this works (the Docker container is reachable) via the command
curl -g -6 'http://[2a01:4f8:c2c:bafc::4]:5555/'
being able to be run from anywhere and returninghello world
.The image is a barebones nodejs http server, nothing special
The Dockerfile for the image is
docker ps -a
givesThe text was updated successfully, but these errors were encountered: