-
Notifications
You must be signed in to change notification settings - Fork 22
/
Vagrantfile
35 lines (29 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
34
35
# -*- mode: ruby -*-
# vi: set ft=ruby :
MASTER_IP = "172.16.8.10"
NODE_01_IP = "172.16.8.11"
Vagrant.configure("2") do |config|
config.vm.box = "geerlingguy/ubuntu2004"
config.vm.box_version = "1.0.3"
boxes = [
{ :name => "master", :ip => MASTER_IP, :cpus => 1, :memory => 2048 },
{ :name => "node-01", :ip => NODE_01_IP, :cpus => 1, :memory => 2048 },
]
boxes.each do |opts|
config.vm.define opts[:name] do |box|
box.vm.hostname = opts[:name]
box.vm.network :private_network, ip: opts[:ip]
box.vm.provider "virtualbox" do |vb|
vb.cpus = opts[:cpus]
vb.memory = opts[:memory]
end
box.vm.provision "shell", path:"./install-kubernetes-dependencies.sh"
if box.vm.hostname == "master" then
box.vm.provision "shell", path:"./configure-master-node.sh"
end
if box.vm.hostname == "node-01" then ##TODO: create some regex to match worker hostnames
box.vm.provision "shell", path:"./configure-worker-nodes.sh"
end
end
end
end