-
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
conflicting options: dns and the network mode (bridge) #11857
Comments
Hi @baxor! I was able to confirm this behavior but tl;dr this is a documentation miss and not a bug. Here's my Nomad 1.1.9+ent cluster:
It looks like the jobspec you have here has been translated from JSON, because it doesn't work as written (the argument names are quoted, are using the wrong argument assignment operator, and the service name is invalid). But I've manage to reduce it to a minimal reproduction: jobspecjob "example" {
datacenters = ["dc1"]
group "group" {
network {
mode = "bridge"
port "http" {}
}
task "task" {
driver = "docker"
config {
image = "busybox:1"
args = ["httpd", "-v", "-f", "-p", "8001", "-h", "/local"]
ports = ["http"]
dns_servers = ["172.17.0.1"]
}
template {
data = "<html>hello, world</html>"
destination = "local/index.html"
}
resources {
cpu = 128
memory = 128
}
}
}
} And after running that I get the following allocation status as you've described:
I've also stood up a current development build of Nomad and I see an identical behavior, so it doesn't look like this was an error in how we built Nomad 1.1.9+ent or something similarly embarassing. 😀 So what's going on? I took a look at the code in #8600 and realized that you've got a task with bridge networking but then you're trying to set the DNS options on the Docker task instead of on the network block. If instead we move the config to the job "example" {
datacenters = ["dc1"]
group "group" {
network {
mode = "bridge"
port "http" {}
dns {
servers = ["172.17.0.1"]
}
}
task "task" {
driver = "docker"
config {
image = "busybox:1"
args = ["httpd", "-v", "-f", "-p", "8001", "-h", "/local"]
ports = ["http"]
}
template {
data = "<html>hello, world</html>"
destination = "local/index.html"
}
resources {
cpu = 128
memory = 128
}
}
}
} Then everything works just fine:
So this looks like it's a documentation issue. We need to make it more clear that the Docker DNS options should not be used when using bridge networking mode. I'll open a PR with some patches to the docs. |
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
This seems to have been fixed in #8600 , but we are still running into the described behavior.
Nomad version
1.1.9+ent
Operating system and Environment details
Issue
failed to create container: API error (400): conflicting options: dns and the network mode
Reproduction steps
Jobspec is:
Removing the
dns_servers
entry in Job.TaskGroup[0].Task[0].Config allows the job to be submitted without error.Expected Result'
Running task
Actual Result
failed to create container: API error (400): conflicting options: dns and the network mode
Job file (if appropriate)
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
The text was updated successfully, but these errors were encountered: