Skip to content

Commit 03a0b02

Browse files
committed
Add deployment
1 parent 46978ee commit 03a0b02

15 files changed

+118
-46
lines changed

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:6.0.0
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:6.0.0
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:6.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-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: collab
16-
image: distractedcat/collab:3.0.0
16+
image: modembcc/collab:6.0.0
1717
imagePullPolicy: Always
1818
env:
1919
- name: PORT
@@ -24,4 +24,4 @@ spec:
2424
value: http://user-service:3001
2525
ports:
2626
- containerPort: 4000
27-
name: collab
27+
name: collab

kubernetes/comms-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ spec:
1313
spec:
1414
containers:
1515
- name: comms
16-
image: distractedcat/comms:1.0.0
16+
image: modembcc/comms:6.0.0
1717
imagePullPolicy: Always
1818
ports:
1919
- containerPort: 4001
20-
name: comms
20+
name: comms

kubernetes/formatter-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ spec:
1313
spec:
1414
containers:
1515
- name: formatter
16-
image: distractedcat/formatter:1.0.0
16+
image: modembcc/formatter:6.0.0
1717
imagePullPolicy: Always
1818
ports:
1919
- containerPort: 5000
20-
name: formatter
20+
name: formatter
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: inbound-gateway
5+
spec:
6+
replicas: 1
7+
selector:
8+
matchLabels:
9+
app: inbound-gateway
10+
template:
11+
metadata:
12+
labels:
13+
app: inbound-gateway
14+
spec:
15+
containers:
16+
- name: inbound-gateway
17+
image: modembcc/inbound-gateway:6.0.1
18+
imagePullPolicy: Always
19+
ports:
20+
- containerPort: 80
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: cloud.google.com/v1
2+
kind: BackendConfig
3+
metadata:
4+
name: inbound-gateway-backendconfig
5+
spec:
6+
healthCheck:
7+
checkIntervalSec: 10 # Time between health checks
8+
timeoutSec: 5 # Timeout for each health check
9+
healthyThreshold: 1 # Number of successes for "healthy" status
10+
unhealthyThreshold: 3 # Number of failures for "unhealthy" status
11+
requestPath: /health # Path for the health check (set this to your health check path)
12+
port: 80 # Port the health check uses
13+
---
14+
apiVersion: v1
15+
kind: Service
16+
metadata:
17+
name: inbound-gateway
18+
annotations:
19+
beta.cloud.google.com/backend-config: '{"default": "inbound-gateway-backendconfig"}'
20+
spec:
21+
selector:
22+
app: inbound-gateway
23+
ports:
24+
- protocol: TCP
25+
port: 80
26+
targetPort: 80
27+
type: NodePort
28+
---
29+
apiVersion: networking.k8s.io/v1
30+
kind: Ingress
31+
metadata:
32+
name: inbound-gateway-ingress
33+
annotations:
34+
# Use this if you have an NGINX Ingress Controller
35+
kubernetes.io/ingress.global-static-ip-name: "cert-service"
36+
networking.gke.io/managed-certificates: "peerprep-grp14"
37+
kubernetes.io/ingress.class: "gce"
38+
spec:
39+
defaultBackend:
40+
service:
41+
name: inbound-gateway
42+
port:
43+
number: 80
44+
# rules:
45+
# - host: peerprep-grp14.com # Replace with your domain
46+
# http:
47+
# paths:
48+
# - pathType: ImplementationSpecific
49+
# backend:
50+
# service:
51+
# name: inbound-gateway # Your service name
52+
# port:
53+
# number: 80

kubernetes/matching-service-api-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ spec:
1313
spec:
1414
containers:
1515
- name: matching-service-api
16-
image: distractedcat/matching-service-api:3.0.0
16+
image: modembcc/matching-service-api:6.0.0
1717
imagePullPolicy: Always
1818
env:
1919
- name: PORT
2020
value: :9200
2121
- name: RABBIT_URI
22-
value: amqp://grp14:grp14@rabbitmq/
22+
value: amqp://grp14:grp14@rabbitmq/
2323
- name: CORS_ORIGIN
2424
value: http://peerprep:3000
2525
ports:
2626
- containerPort: 9200
27-
name: matching-api
27+
name: matching-api

0 commit comments

Comments
 (0)