-
Notifications
You must be signed in to change notification settings - Fork 420
/
Vagrantfile
32 lines (28 loc) · 868 Bytes
/
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
Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: <<-SHELL
apt-get update -y
echo "10.0.0.10 master-node" >> /etc/hosts
echo "10.0.0.11 worker-node01" >> /etc/hosts
echo "10.0.0.12 worker-node02" >> /etc/hosts
SHELL
config.vm.define "master" do |master|
master.vm.box = "bento/ubuntu-22.04"
master.vm.hostname = "master-node"
master.vm.network "private_network", ip: "10.0.0.10"
master.vm.provider "virtualbox" do |vb|
vb.memory = 4048
vb.cpus = 2
end
end
(1..2).each do |i|
config.vm.define "node0#{i}" do |node|
node.vm.box = "bento/ubuntu-22.04"
node.vm.hostname = "worker-node0#{i}"
node.vm.network "private_network", ip: "10.0.0.1#{i}"
node.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 1
end
end
end
end