-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
50 lines (45 loc) · 1.56 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- mode: ruby -*-
# vi: set ft=ruby :
workers = (ENV['WORKERS'] || "1").to_i
box_name = (ENV['VAGRANT_BOX'] || "sysnet4admin/Ubuntu-k8s")
box_version = "0.7.1"
Vagrant.configure("2") do |config|
config.vm.box = "#{box_name}"
config.vm.box_version = "#{box_version}"
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update = false
end
config.vm.define "host" do |host|
host.vm.hostname = 'host'
host.vm.network :private_network, ip: "192.168.80.9", :netmask => "255.255.255.0"
host.vm.provision :shell, :path => "nodes/host.sh"
host.vm.provider :virtualbox do |vbox|
vbox.memory = "4096"
vbox.cpus = "4"
vbox.default_nic_type = "virtio"
end
end
config.vm.define "master" do |master|
master.vm.hostname = 'master'
master.vm.network :private_network, ip: "192.168.80.10", :netmask => "255.255.255.0"
master.vm.provision :shell, :path => "nodes/master.sh"
master.vm.provider :virtualbox do |vbox|
vbox.memory = "4096"
vbox.cpus = "2"
vbox.default_nic_type = "virtio"
end
end
(1..workers).each do |node_number|
config.vm.define "worker#{node_number}" do |worker|
worker.vm.hostname = "worker#{node_number}"
ip = node_number + 100
worker.vm.network :private_network, ip: "192.168.80.#{ip}", :netmask => "255.255.255.0"
worker.vm.provision :shell, :path => "nodes/worker.sh"
worker.vm.provider :virtualbox do |vbox|
vbox.memory = "4096"
vbox.cpus = "4"
vbox.default_nic_type = "virtio"
end
end
end
end