forked from AhmadRafiee/Kubernetes_training_with_DockerMe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
44 lines (39 loc) · 1.45 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
IMAGE_1604 = "bento/ubuntu-16.04"
IMAGE_1804 = "bento/ubuntu-18.04"
IMAGE_2004 = "bento/ubuntu-20.04"
IMAGE_2204 = "bento/ubuntu-22.04"
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
Vagrant.configure(2) do |config|
config.proxy.http = "http://192.168.56.1:8123"
config.proxy.https = "http://192.168.56.1:8123"
config.proxy.no_proxy = "localhost,127.0.0.1,192.168.56.0/24,repo.rke.mecan.ir,*.rke.mecan.ir"
config.vm.provision "shell", path: "bootstrap.sh"
NodeMaster = 3
(1..NodeMaster).each do |master_id|
config.vm.define "master#{master_id}" do |master_vm|
master_vm.vm.box = IMAGE_2204
master_vm.vm.hostname = "master#{master_id}.kube.mecan.ir"
master_vm.vm.network "private_network", ip: "192.168.56.10#{master_id}"
master_vm.vm.provider "virtualbox" do |v|
v.name = "master#{master_id}"
v.memory = 2048
v.cpus = 2
end
master_vm.vm.provision "shell", path: "bootstrap_master.sh"
end
end
NodeWorker = 0
(1..NodeWorker).each do |worker_id|
config.vm.define "worker#{worker_id}" do |worker_vm|
worker_vm.vm.box = IMAGE_1604
worker_vm.vm.hostname = "worker#{worker_id}.kube.mecan.ir"
worker_vm.vm.network "private_network", ip: "192.168.56.11#{worker_id}"
worker_vm.vm.provider "virtualbox" do |v|
v.name = "worker#{worker_id}"
v.memory = 1024
v.cpus = 1
end
worker_vm.vm.provision "shell", path: "bootstrap_worker.sh"
end
end
end