Fixed vagrant up with flannel network, removed old config values (#1737)

This commit is contained in:
Maxim Krasilnikov 2017-10-03 13:16:13 +03:00 committed by Matthew Mosesohn
parent e42cb43ca5
commit d6d58bc938

19
Vagrantfile vendored
View file

@ -27,10 +27,13 @@ $shared_folders = {}
$forwarded_ports = {} $forwarded_ports = {}
$subnet = "172.17.8" $subnet = "172.17.8"
$os = "ubuntu" $os = "ubuntu"
$network_plugin = "flannel"
# The first three nodes are etcd servers # The first three nodes are etcd servers
$etcd_instances = $num_instances $etcd_instances = $num_instances
# The first two nodes are masters # The first two nodes are kube masters
$kube_master_instances = $num_instances == 1 ? $num_instances : ($num_instances - 1) $kube_master_instances = $num_instances == 1 ? $num_instances : ($num_instances - 1)
# All nodes are kube nodes
$kube_node_instances = $num_instances
$local_release_dir = "/vagrant/temp" $local_release_dir = "/vagrant/temp"
host_vars = {} host_vars = {}
@ -39,9 +42,6 @@ if File.exist?(CONFIG)
require CONFIG require CONFIG
end end
# All nodes are kube nodes
$kube_node_instances = $num_instances
$box = SUPPORTED_OS[$os][:box] $box = SUPPORTED_OS[$os][:box]
# if $inventory is not set, try to use example # if $inventory is not set, try to use example
$inventory = File.join(File.dirname(__FILE__), "inventory") if ! $inventory $inventory = File.join(File.dirname(__FILE__), "inventory") if ! $inventory
@ -115,15 +115,12 @@ Vagrant.configure("2") do |config|
ip = "#{$subnet}.#{i+100}" ip = "#{$subnet}.#{i+100}"
host_vars[vm_name] = { host_vars[vm_name] = {
"ip": ip, "ip": ip,
"flannel_interface": ip, "bootstrap_os": SUPPORTED_OS[$os][:bootstrap_os],
"flannel_backend_type": "host-gw",
"local_release_dir" => $local_release_dir, "local_release_dir" => $local_release_dir,
"download_run_once": "False", "download_run_once": "False",
# Override the default 'calico' with flannel. "kube_network_plugin": $network_plugin
# inventory/group_vars/k8s-cluster.yml
"kube_network_plugin": "flannel",
"bootstrap_os": SUPPORTED_OS[$os][:bootstrap_os]
} }
config.vm.network :private_network, ip: ip config.vm.network :private_network, ip: ip
# Only execute once the Ansible provisioner, # Only execute once the Ansible provisioner,
@ -137,7 +134,7 @@ Vagrant.configure("2") do |config|
ansible.sudo = true ansible.sudo = true
ansible.limit = "all" ansible.limit = "all"
ansible.host_key_checking = false ansible.host_key_checking = false
ansible.raw_arguments = ["--forks=#{$num_instances}"] ansible.raw_arguments = ["--forks=#{$num_instances}", "--flush-cache"]
ansible.host_vars = host_vars ansible.host_vars = host_vars
#ansible.tags = ['download'] #ansible.tags = ['download']
ansible.groups = { ansible.groups = {