Browse code

Fix the Vagrant network setup

The Vagrantfile configures the machines with:

master_ip = "10.245.1.2"
minion_ip_base = "10.245.2."

The issue is that, by default, Vagrant uses a netmask of 255.255.255.0.
With that netmask, Vagrant considers that the master and the minions are on
two distinct subnets and so, creates two distinct private networks.
This prevents the master and the minions from communicating between each other.

By explicitly forcing the netmask to be 255.255.0.0, Vagrant will create a
single private network for the master and the minions.

Lénaïc Huard authored on 2015/01/30 17:40:25
Showing 1 changed files
... ...
@@ -81,7 +81,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
81 81
       config.vm.box = kube_box[kube_os]["name"]
82 82
       config.vm.box_url = kube_box[kube_os]["box_url"]
83 83
       config.vm.provision "shell", inline: "/vagrant/vagrant/provision-master.sh #{master_ip} #{num_minion} #{minion_ips_str} #{ENV['OPENSHIFT_SDN']}"
84
-      config.vm.network "private_network", ip: "#{master_ip}"
84
+      config.vm.network "private_network", ip: "#{master_ip}", netmask: "255.255.0.0"
85 85
       config.vm.hostname = "openshift-master"
86 86
     end
87 87
 
... ...
@@ -93,7 +93,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
93 93
         minion.vm.box = kube_box[kube_os]["name"]
94 94
         minion.vm.box_url = kube_box[kube_os]["box_url"]
95 95
         minion.vm.provision "shell", inline: "/vagrant/vagrant/provision-minion.sh #{master_ip} #{num_minion} #{minion_ips_str} #{minion_ip} #{minion_index} #{ENV['OPENSHIFT_SDN']}"
96
-        minion.vm.network "private_network", ip: "#{minion_ip}"
96
+        minion.vm.network "private_network", ip: "#{minion_ip}", netmask: "255.255.0.0"
97 97
         minion.vm.hostname = "openshift-minion-#{minion_index}"
98 98
       end
99 99
     end