Skip to content

Commit f4ba1fc

Browse files
authored
Merge pull request #73 from CS3219-AY2425S1/deploy-risky
Deploy final
2 parents acc31c6 + 2d95ebc commit f4ba1fc

32 files changed

+400
-54
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/.env
22
.idea
33
*.log
4-
main.exe
4+
main.exe
5+
kubernetes

compose.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
peerprep:
33
build: peerprep
4-
image: distractedcat/peerprep
4+
image: modembcc/peerprep:7.0.3
55
env_file:
66
- peerprep/.env
77
ports:
@@ -15,10 +15,9 @@ services:
1515
path: peerprep
1616
target: /frontend
1717

18-
1918
user-service:
2019
build: user-service
21-
image: distractedcat/user-service
20+
image: modembcc/user-service:6.0.0
2221
volumes:
2322
- /user-service/node_modules
2423
env_file:
@@ -35,7 +34,7 @@ services:
3534

3635
backend:
3736
build: backend
38-
image: distractedcat/backend
37+
image: modembcc/backend:6.0.0
3938
env_file:
4039
- backend/.env
4140
ports:
@@ -74,7 +73,7 @@ services:
7473

7574
matching-service:
7675
build: matching-service
77-
image: distractedcat/matching-service
76+
image: modembcc/matching-service:6.0.0
7877
env_file:
7978
- matching-service/.env
8079
extra_hosts:
@@ -90,7 +89,7 @@ services:
9089

9190
matching-service-api:
9291
build: matching-service-api
93-
image: distractedcat/matching-service-api
92+
image: modembcc/matching-service-api:6.0.0
9493
env_file:
9594
- matching-service-api/.env
9695
extra_hosts:
@@ -108,7 +107,7 @@ services:
108107

109108
storage-blob-api:
110109
build: storage-blob-api
111-
image: distractedcat/storage-blob-api
110+
image: modembcc/storage-blob-api:6.0.0
112111
env_file:
113112
- storage-blob-api/.env
114113
extra_hosts:
@@ -125,7 +124,7 @@ services:
125124

126125
collab:
127126
build: collab
128-
image: distractedcat/collab
127+
image: modembcc/collab:7.0.3
129128
env_file:
130129
- collab/.env
131130
ports:
@@ -138,7 +137,7 @@ services:
138137

139138
formatter:
140139
build: formatter
141-
image: distractedcat/formatter
140+
image: modembcc/formatter:6.0.0
142141
extra_hosts:
143142
- "host.docker.internal:host-gateway"
144143
ports:
@@ -151,7 +150,7 @@ services:
151150

152151
comms:
153152
build: comms
154-
image: distractedcat/comms
153+
image: modembcc/comms:7.0.0
155154
#env_file:
156155
#- comms/.env
157156
ports:
@@ -164,7 +163,7 @@ services:
164163

165164
nginx:
166165
build: nginx
167-
image: distractedcat/nginx
166+
image: modembcc/nginx:6.0.0
168167
volumes:
169168
- ./nginx/nginx.conf:/etc/nginx/internal.conf
170169
ports:
@@ -175,10 +174,10 @@ services:
175174
- user-service
176175
- storage-blob-api
177176
- matching-service-api
178-
177+
179178
inbound-gateway:
180179
build: inbound-gateway
181-
image: wzwren/inbound-gateway
180+
image: modembcc/inbound-gateway:6.0.1
182181
ports:
183182
- "80:80"
184183
volumes:

inbound-gateway/nginx.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,11 @@ http {
5252
proxy_set_header Connection "upgrade";
5353
proxy_read_timeout 86400;
5454
}
55+
56+
location /health {
57+
access_log off;
58+
return 200 'OK\n';
59+
add_header Content-Type text/plain;
60+
}
5561
}
5662
}

kubernetes/apply_k8s_configs.ps1

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
# Array of Kubernetes YAML files to apply
22
$files = @(
33
"backend-deployment.yaml",
4-
"backend-service.yaml",
54
"collab-service-deployment.yaml",
6-
"collab-service-service.yaml",
75
"matching-service-api-deployment.yaml",
8-
"matching-service-api-service.yaml",
96
"matching-service-deployment.yaml",
107
"nginx-deployment.yaml",
11-
"nginx-service.yaml",
8+
"formatter-deployment.yaml",
9+
"formatter-service.yaml",
1210
"peerprep-deployment.yaml",
13-
"peerprep-service.yaml",
14-
"rabbitmq-service.yaml",
1511
"rabbitmq-statefulset.yaml",
16-
"redis-service.yaml",
1712
"redis-statefulset.yaml",
1813
"storage-blob-api-deployment.yaml",
19-
"storage-blob-api-service.yaml",
2014
"user-service-deployment.yaml",
21-
"user-service-service.yaml"
15+
"inbound-gateway-deployment.yaml"
2216
)
2317

2418
# Loop through each file and apply it using kubectl

kubernetes/backend-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
spec:
1414
containers:
1515
- name: backend
16-
image: distractedcat/backend:1.0.0
16+
image: modembcc/backend:6.0.0
1717
imagePullPolicy: IfNotPresent
1818
env:
1919
- name: MONGODB_URI
@@ -31,4 +31,4 @@ spec:
3131
memory: "128Mi"
3232
limits:
3333
cpu: "200m"
34-
memory: "256Mi"
34+
memory: "256Mi"

kubernetes/collab-service-HPA.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: collab
5+
spec:
6+
scaleTargetRef:
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
name: collab
10+
minReplicas: 1
11+
maxReplicas: 5
12+
metrics:
13+
- type: Resource
14+
resource:
15+
name: cpu
16+
target:
17+
type: Utilization
18+
averageUtilization: 80

kubernetes/collab-service-deployment.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
spec:
1414
containers:
1515
- name: collab
16-
image: distractedcat/collab:3.0.0
16+
image: modembcc/collab:7.0.3
1717
imagePullPolicy: Always
1818
env:
1919
- name: PORT
@@ -24,4 +24,11 @@ spec:
2424
value: http://user-service:3001
2525
ports:
2626
- containerPort: 4000
27-
name: collab
27+
name: collab
28+
resources:
29+
requests:
30+
cpu: "100m"
31+
memory: "128Mi"
32+
limits:
33+
cpu: "200m"
34+
memory: "256Mi"

kubernetes/comms-HPA.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: autoscaling/v2
2+
kind: HorizontalPodAutoscaler
3+
metadata:
4+
name: comms
5+
spec:
6+
scaleTargetRef:
7+
apiVersion: apps/v1
8+
kind: Deployment
9+
name: comms
10+
minReplicas: 1
11+
maxReplicas: 5
12+
metrics:
13+
- type: Resource
14+
resource:
15+
name: cpu
16+
target:
17+
type: Utilization
18+
averageUtilization: 80

kubernetes/comms-deployment.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ spec:
1313
spec:
1414
containers:
1515
- name: comms
16-
image: distractedcat/comms:1.0.0
16+
image: modembcc/comms:7.0.0
1717
imagePullPolicy: Always
1818
ports:
1919
- containerPort: 4001
20-
name: comms
20+
name: comms
21+
resources:
22+
requests:
23+
cpu: "100m"
24+
memory: "128Mi"
25+
limits:
26+
cpu: "200m"
27+
memory: "256Mi"

kubernetes/comms-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ spec:
99
- protocol: TCP
1010
port: 4001
1111
targetPort: 4001
12-
type: LoadBalancer
12+
type: ClusterIP

0 commit comments

Comments
 (0)