forked from rmnobarra/kubernetes-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
33 lines (28 loc) · 1.06 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
vms = {
'node1' => {'memory' => '1024', 'cpus' => 1, 'ip' => '20', 'provision' => 'node.sh'},
'node2' => {'memory' => '1024', 'cpus' => 1, 'ip' => '30', 'provision' => 'node.sh'},
'master' => {'memory' => '2048', 'cpus' => 2, 'ip' => '10', 'provision' => 'master.sh'}
}
Vagrant.configure('2') do |config|
config.vm.box = 'debian/buster64'
config.vm.box_check_update = false
vms.each do |name, conf|
config.vm.define "#{name}" do |k|
k.vm.hostname = "#{name}.k8s.com"
k.vm.network 'private_network', ip: "172.27.11.#{conf['ip']}"
k.vm.provider 'virtualbox' do |vb|
vb.memory = conf['memory']
vb.cpus = conf['cpus']
end
k.vm.provider 'libvirt' do |lv|
lv.memory = conf['memory']
lv.cpus = conf['cpus']
lv.cputopology :sockets => 1, :cores => conf['cpus'], :threads => '1'
end
k.vm.provision 'shell', path: "provision/#{conf['provision']}", args: "#{conf['ip']}"
end
end
config.vm.provision 'shell', path: 'provision/provision.sh'
end