-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
81 lines (57 loc) · 1.91 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
VAGRANT_BOX = "ubuntu/jammy64"
VAGRANT_BOX_VERSION = "20240207.0.0"
CPUS_MASTER_NODE = 2
CPUS_WORKER_NODE = 2
MEMORY_MASTER_NODE = 6144
MEMORY_WORKER_NODE = 4096
WORKER_NODES_COUNT = 2
Vagrant.configure(2) do |config|
config.vm.synced_folder "src/", "/srv/join"
config.vm.provision "shell", path: "bootstrap.sh"
# Kubernetes Master Server
config.vm.define "master" do |node|
node.vm.box = VAGRANT_BOX
node.vm.box_check_update = false
node.vm.box_version = VAGRANT_BOX_VERSION
node.vm.hostname = "master.example.com"
node.vm.network "private_network", ip: "172.16.16.100"
for p in 30000..32700
node.vm.network "forwarded_port", guest: p, host: p
end
node.vm.provider :virtualbox do |v|
v.name = "master"
v.memory = MEMORY_MASTER_NODE
v.cpus = CPUS_MASTER_NODE
end
node.vm.provider :libvirt do |v|
v.memory = MEMORY_MASTER_NODE
v.nested = true
v.cpus = CPUS_MASTER_NODE
end
node.vm.provision "shell", path: "bootstrap_master.sh"
end
# Kubernetes Worker Nodes
(1..WORKER_NODES_COUNT).each do |i|
config.vm.define "worker#{i}" do |node|
node.vm.box = VAGRANT_BOX
node.vm.box_check_update = false
node.vm.box_version = VAGRANT_BOX_VERSION
node.vm.hostname = "worker#{i}.example.com"
node.vm.network "private_network", ip: "172.16.16.10#{i}"
node.vm.provider :virtualbox do |v|
v.name = "worker#{i}"
v.memory = MEMORY_WORKER_NODE
v.cpus = CPUS_WORKER_NODE
end
node.vm.provider :libvirt do |v|
v.memory = MEMORY_WORKER_NODE
v.nested = true
v.cpus = CPUS_WORKER_NODE
end
node.vm.provision "shell", path: "bootstrap_worker.sh"
end
end
end