-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile.vbox
43 lines (32 loc) · 1.14 KB
/
Vagrantfile.vbox
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
# -*- mode: ruby -*-
# vi: set ft=ruby
require 'yaml'
servers = YAML.load_file(File.join(File.dirname(__FILE__), 'config/servers.yaml'))
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.trigger.before :up do |trigger|
trigger.name = "Removing stale kube-join.sh"
trigger.info = "A stale kube-join.sh will prevent the nodes from joining the master"
trigger.run = {inline: "bash -c 'if [ -f config/kube-join.sh ]; then rm -f config/kube-join.sh; fi'"}
end
config.vm.provider "virtualbox" do |vb|
vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
end
servers['vagrant'].each do |name, server|
config.vm.define name do |host|
host.vm.hostname = name
host.vm.network :private_network, ip: server["ip"]
end
if server.has_key?("mem") then
config.vm.provider :virtualbox do |host|
host.memory = server["mem"]
end
end
if server.has_key?("cpu") then
config.vm.provider :virtualbox do |host|
host.cpus = server["cpu"]
end
end
end
config.vm.provision :shell, path: "config/bootstrap-kube.sh", :privileged => true
end