-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdeployment.yaml
139 lines (135 loc) · 4.46 KB
/
deployment.yaml
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# ***************** Universidad de los Andes ***********************
# ****** Departamento de Ingeniería de Sistemas y Computación ******
# ********** Arquitectura y diseño de Software - ISIS2503 **********
#
# Infraestructura para laboratorio de Base de datos No SQL
# Elementos a desplegar:
# 1. Firewalls:
# - nosqld-firewall-django
# - nosqld-firewall-mongo
# 2. Instancias MVs:
# - nosqld-django-no-patterns-instance (repositorio clonado y requerimientos instalados)
# - nosqld-django-patterns-instance (repositorio clonado y requerimientos instalados)
# - nosqld-mongo-instance (Container Optimized OS sin MongoDB)
resources:
# Firewall rules
- name: nosqld-firewall-django
type: compute.v1.firewall
properties:
network: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/global/networks/default
priority: 1000
direction: INGRESS
sourceRanges:
- 0.0.0.0/0
targetTags:
- nosqld-django
allowed:
- IPProtocol: TCP
ports:
- 8080
- name: nosqld-firewall-mongo
type: compute.v1.firewall
properties:
network: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/global/networks/default
priority: 1000
direction: INGRESS
sourceTags:
- nosqld-django
targetTags:
- nosqld-mongo
allowed:
- IPProtocol: TCP
ports:
- 27017
# Mongo Database instance
- type: compute.v1.instance
name: nosqld-mongo-instance
properties:
zone: us-central1-a
machineType: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/zones/us-central1-a/machineTypes/e2-micro
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/cos-cloud/global/images/cos-101-17162-386-64
networkInterfaces:
- network: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/global/networks/default
networkIP: 10.128.0.70
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
tags:
items:
- nosqld-mongo
# Monitoring app django with no patterns instance
- type: compute.v1.instance
name: nosqld-django-no-patterns-instance
properties:
zone: us-central1-a
machineType: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/zones/us-central1-a/machineTypes/e2-micro
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20240307b
networkInterfaces:
- network: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/global/networks/default
networkIP: 10.128.0.71
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
tags:
items:
- nosqld-django
metadata:
items:
- key: startup-script
value: |
#!/bin/bash
sudo apt-get update
sudo apt install python3-pip -y
sudo mkdir /labs
cd /labs
sudo git clone https://github.com/ISIS2503/ISIS2503-MonitoringAppNoSQL.git
cd ISIS2503-MonitoringAppNoSQL
sudo git checkout nosql-no-patterns
sudo pip3 install -r requirements.txt
# Monitoring app django with patterns instance
- type: compute.v1.instance
name: nosqld-django-patterns-instance
properties:
zone: us-central1-a
machineType: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/zones/us-central1-a/machineTypes/e2-micro
disks:
- deviceName: boot
type: PERSISTENT
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20240307b
networkInterfaces:
- network: https://www.googleapis.com/compute/v1/projects/<id-proyecto>/global/networks/default
networkIP: 10.128.0.72
accessConfigs:
- name: External NAT
type: ONE_TO_ONE_NAT
tags:
items:
- nosqld-django
metadata:
items:
- key: startup-script
value: |
#!/bin/bash
sudo apt-get update
sudo apt install python3-pip -y
sudo mkdir /labs
cd /labs
sudo git clone https://github.com/ISIS2503/ISIS2503-MonitoringAppNoSQL.git
cd ISIS2503-MonitoringAppNoSQL
sudo git checkout nosql-patterns
sudo pip3 install -r requirements.txt