-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile.new
39 lines (34 loc) · 1.05 KB
/
Vagrantfile.new
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
BOX_IMAGE = "generic/ubuntu2204"
WORKER_COUNT = 2
HOST_IP_BASE = "192.168.56"
CONTROL_NODE_IP = "#{HOST_IP_BASE}.10"
POD_CIDR = "10.32.0.0/12"
Vagrant.configure("2") do |config|
config.vm.box = BOX_IMAGE
config.vm.define "kube-control-plane" do |node|
node.vm.hostname = "kube-control-plane"
node.vm.network :private_network, ip: "#{CONTROL_NODE_IP}"
node.vm.provider :virtualbox do |vb|
vb.name = "kube-control-plane"
vb.memory = 2048
vb.cpus = 2
end
node.vm.provision "shell", path: "scripts/common.sh"
end
(1..WORKER_COUNT).each do |i|
WORKER_NODE_IP = "#{HOST_IP_BASE}.#{i + 10}"
config.vm.define "kube-node#{i}" do |node|
node.vm.hostname = "kube-node#{i}"
node.vm.network :private_network, ip: "#{WORKER_NODE_IP}"
node.vm.provider :virtualbox do |vb|
vb.name = "kube-node#{i}"
vb.memory = 2048
vb.cpus = 1
end
node.vm.provision "shell", path: "scripts/common.sh"
end
end
config.vm.provision "shell",
run: "always",
inline: "swapoff -a"
end