-
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
Updating job with host_network, no effect #9728
Comments
I was able to reproduce this. I know we've seen similar bugs with Consul Connect-related updates (ex. #9029) so it wouldn't surprise me if it's something like that here too. Just as @cpl says, it doesn't make a difference whether we're adding or removing the field, and the field does work if it's there in the first place, so it's only the change that's the problem. Reproduced on the current HEAD of 1.0.3-dev, on our Vagrant development file (after applying the following diff to get more network interfaces): diff --git a/Vagrantfile b/Vagrantfile
index f55b623b7..e64a99006 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -44,6 +44,10 @@ Vagrant.configure(2) do |config|
privileged: false,
path: './scripts/vagrant-linux-unpriv-bootstrap.sh'
+ vmCfg.vm.provider "virtualbox" do |_|
+ vmCfg.vm.network :private_network, ip: LINUX_IP_ADDRESS
+ end
+
# Expose the nomad api and ui to the host
vmCfg.vm.network :forwarded_port, guest: 4646, host: 4646, auto_correct: true
vmCfg.vm.network :forwarded_port, guest: 8500, host: 8500, auto_correct: true Using the following Nomad configuration: name = "standalone"
log_level = "DEBUG"
enable_debug = true
data_dir = "/var/nomad"
server {
enabled = true
bootstrap_expect = 1
}
client {
enabled = true
host_network "public" {
cidr = "10.199.0.200/24"
reserved_ports = "22"
}
} The example job that @cpl provided works as-is (thank you for giving us a working reproduction job!). Run the job:
See the resulting address:
Note the resulting containers so that we can verify tasks are not changed:
Uncomment the host network field and run the job again:
We're told the allocations are being modified in place. But if we check the allocation status we see no change to the network address:
The containers are unchanged as well:
The server logs show the job be evaluated as an in-place update:
But there are no changes logged on the client. |
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. |
Nomad version
Nomad v1.0.1 (c9c68aa)
Operating system and Environment details
Linux 5.4.0-54-generic Ubuntu 20.04 x86_64 GNU/Linux
Hetzner Cloud Instance
Issue
Updating a job with
host_network
does not seem to have any effect.It works if the job is first stopped.
Reproduction steps
Setup a Nomad + Consul cluster.
With the following Nomad client config.
countdash
job with#host_network = "public"
commented.host_network = "public"
nomad job run countdash.nomad
(step 1,2 work the other way around too)
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: