-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
104 lines (97 loc) · 4.04 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# IMAGE_NAME = "leandrocalmeida/ubuntu"
IMAGE_NAME = "bento/ubuntu-20.04"
N = 2
Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 4
end
# VIDEO SERVICE MACHINES
# Video Service Cluster Master
config.vm.define "video-service-master" do |master|
master.vm.box = IMAGE_NAME
master.vm.network "private_network", ip: "192.168.10.10"
master.vm.network "forwarded_port", guest: 8080, host:3000
master.vm.hostname = "video-service-master"
master.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-docker.sh"
master.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-nginx-master.sh"
master.vm.provision "ansible" do |ansible|
ansible.playbook = "video-service-slice/kubernetes-setup/master-playbook.yml"
ansible.extra_vars = {
node_ip: "192.168.10.10",
}
end
master.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-iptables.sh"
end
# Video Service Worker 1
config.vm.define "video-service-node-1" do |node|
node.vm.box = IMAGE_NAME
node.vm.network "private_network", ip: "192.168.10.20"
node.vm.hostname = "video-service-node-1"
node.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-docker.sh"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "video-service-slice/kubernetes-setup/node-playbook.yml"
ansible.extra_vars = {
node_ip: "192.168.10.20",
}
end
node.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-iptables.sh"
end
# Video Service Worker 2
config.vm.define "video-service-node-2" do |node|
node.vm.box = IMAGE_NAME
node.vm.network "private_network", ip: "192.168.10.30"
node.vm.hostname = "video-service-node-2"
node.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-docker.sh"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "video-service-slice/kubernetes-setup/node-playbook.yml"
ansible.extra_vars = {
node_ip: "192.168.10.30",
}
end
node.vm.provision "shell", path: "video-service-slice/kubernetes-setup/setup-iptables.sh"
end
# ===============================
# DATABASE SERVICE MACHINES
# Database Service Cluster Master
# ===============================
config.vm.define "database-service-master" do |master|
master.vm.box = IMAGE_NAME
master.vm.network "private_network", ip: "192.168.20.10"
master.vm.network "forwarded_port", guest: 8080, host:4000
master.vm.hostname = "database-service-master"
master.vm.provision "shell", path: "database-service-slice/kubernetes-setup/setup-docker.sh"
master.vm.provision "ansible" do |ansible|
ansible.playbook = "database-service-slice/kubernetes-setup/master-playbook.yml"
ansible.extra_vars = {
node_ip: "192.168.20.10",
}
end
end
# Database Service Worker 1
config.vm.define "database-service-node-1" do |node|
node.vm.box = IMAGE_NAME
node.vm.network "private_network", ip: "192.168.20.20"
node.vm.hostname = "database-service-node-1"
node.vm.provision "shell", path: "database-service-slice/kubernetes-setup/setup-docker.sh"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "database-service-slice/kubernetes-setup/node-playbook.yml"
ansible.extra_vars = {
node_ip: "192.168.20.20",
}
end
end
# Database Service Worker 2
config.vm.define "database-service-node-2" do |node|
node.vm.box = IMAGE_NAME
node.vm.network "private_network", ip: "192.168.20.30"
node.vm.hostname = "database-service-node-2"
node.vm.provision "shell", path: "database-service-slice/kubernetes-setup/setup-docker.sh"
node.vm.provision "ansible" do |ansible|
ansible.playbook = "database-service-slice/kubernetes-setup/node-playbook.yml"
ansible.extra_vars = {
node_ip: "192.168.20.30",
}
end
end
end