Skip to content

Commit f8fe75b

Browse files
authored
Merge pull request #2 from Hatheecshanaa/dev
feat: Add ArgoCD application.
2 parents 53e34f9 + 2127fa1 commit f8fe75b

12 files changed

Lines changed: 438 additions & 0 deletions

cso2/k8s/argocd/application.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: cs02-project
5+
namespace: argocd
6+
finalizers:
7+
- resources-finalizer.argocd.argoproj.io
8+
spec:
9+
project: default
10+
source:
11+
repoURL: https://github.com/CSO2/cs02-computer-store.git
12+
targetRevision: HEAD
13+
path: k8s/services
14+
directory:
15+
recurse: true
16+
destination:
17+
server: https://kubernetes.default.svc
18+
namespace: default
19+
syncPolicy:
20+
automated:
21+
prune: true
22+
selfHeal: true
23+
syncOptions:
24+
- CreateNamespace=true

cso2/k8s/services/ai-service.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: ai-service
5+
labels:
6+
app: ai-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: ai-service
12+
template:
13+
metadata:
14+
labels:
15+
app: ai-service
16+
spec:
17+
containers:
18+
- name: ai-service
19+
image: cso2/ai-service:latest
20+
ports:
21+
- containerPort: 8089
22+
env:
23+
- name: DB_HOST
24+
value: "postgres"
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: ai-service
30+
spec:
31+
selector:
32+
app: ai-service
33+
ports:
34+
- protocol: TCP
35+
port: 8089
36+
targetPort: 8089

cso2/k8s/services/api-gateway.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: api-gateway
5+
labels:
6+
app: api-gateway
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: api-gateway
12+
template:
13+
metadata:
14+
labels:
15+
app: api-gateway
16+
spec:
17+
containers:
18+
- name: api-gateway
19+
image: cso2/api-gateway:latest
20+
ports:
21+
- containerPort: 8080
22+
env:
23+
- name: AUTH_SERVICE_URL
24+
value: "http://auth-service:8081"
25+
- name: PRODUCT_CATALOGUE_SERVICE_URL
26+
value: "http://product-catalogue-service:8082"
27+
- name: SHOPPING_CART_SERVICE_URL
28+
value: "http://shoppingcart-wishlist-service:8084"
29+
- name: ORDER_SERVICE_URL
30+
value: "http://order-service:8083"
31+
- name: NOTIFICATIONS_SERVICE_URL
32+
value: "http://notifications-service:8087"
33+
- name: CONTENT_SERVICE_URL
34+
value: "http://content-service:8086"
35+
- name: SUPPORT_SERVICE_URL
36+
value: "http://support-service:8085"
37+
- name: REPORTING_SERVICE_URL
38+
value: "http://reporting-and-analysis-service:8088"
39+
- name: AI_SERVICE_URL
40+
value: "http://ai-service:8089"
41+
---
42+
apiVersion: v1
43+
kind: Service
44+
metadata:
45+
name: api-gateway
46+
spec:
47+
selector:
48+
app: api-gateway
49+
ports:
50+
- protocol: TCP
51+
port: 8080
52+
targetPort: 8080
53+
type: NodePort # Or LoadBalancer
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: auth-service
5+
labels:
6+
app: auth-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: auth-service
12+
template:
13+
metadata:
14+
labels:
15+
app: auth-service
16+
spec:
17+
containers:
18+
- name: auth-service
19+
image: cso2/auth-service:latest
20+
ports:
21+
- containerPort: 8081
22+
env:
23+
- name: DB_HOST
24+
value: "postgres" # Update this to your DB host
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: auth-service
30+
spec:
31+
selector:
32+
app: auth-service
33+
ports:
34+
- protocol: TCP
35+
port: 8081
36+
targetPort: 8081
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: content-service
5+
labels:
6+
app: content-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: content-service
12+
template:
13+
metadata:
14+
labels:
15+
app: content-service
16+
spec:
17+
containers:
18+
- name: content-service
19+
image: cso2/content-service:latest
20+
ports:
21+
- containerPort: 8086
22+
env:
23+
- name: DB_HOST
24+
value: "postgres"
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: content-service
30+
spec:
31+
selector:
32+
app: content-service
33+
ports:
34+
- protocol: TCP
35+
port: 8086
36+
targetPort: 8086

cso2/k8s/services/frontend.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: frontend
5+
labels:
6+
app: frontend
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: frontend
12+
template:
13+
metadata:
14+
labels:
15+
app: frontend
16+
spec:
17+
containers:
18+
- name: frontend
19+
image: cso2/frontend:latest
20+
ports:
21+
- containerPort: 3000
22+
env:
23+
- name: NEXT_PUBLIC_API_URL
24+
value: "http://api-gateway:8080" # Assuming internal or external access, might need adjustment if accessed from browser
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: frontend
30+
spec:
31+
selector:
32+
app: frontend
33+
ports:
34+
- protocol: TCP
35+
port: 3000
36+
targetPort: 3000
37+
type: NodePort # Or LoadBalancer/ClusterIP depending on needs
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: notifications-service
5+
labels:
6+
app: notifications-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: notifications-service
12+
template:
13+
metadata:
14+
labels:
15+
app: notifications-service
16+
spec:
17+
containers:
18+
- name: notifications-service
19+
image: cso2/notifications-service:latest
20+
ports:
21+
- containerPort: 8087
22+
env:
23+
- name: DB_HOST
24+
value: "postgres"
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: notifications-service
30+
spec:
31+
selector:
32+
app: notifications-service
33+
ports:
34+
- protocol: TCP
35+
port: 8087
36+
targetPort: 8087
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: order-service
5+
labels:
6+
app: order-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: order-service
12+
template:
13+
metadata:
14+
labels:
15+
app: order-service
16+
spec:
17+
containers:
18+
- name: order-service
19+
image: cso2/order-service:latest
20+
ports:
21+
- containerPort: 8083
22+
env:
23+
- name: DB_HOST
24+
value: "postgres"
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: order-service
30+
spec:
31+
selector:
32+
app: order-service
33+
ports:
34+
- protocol: TCP
35+
port: 8083
36+
targetPort: 8083
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: product-catalogue-service
5+
labels:
6+
app: product-catalogue-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: product-catalogue-service
12+
template:
13+
metadata:
14+
labels:
15+
app: product-catalogue-service
16+
spec:
17+
containers:
18+
- name: product-catalogue-service
19+
image: cso2/product-catalogue-service:latest
20+
ports:
21+
- containerPort: 8082
22+
env:
23+
- name: MONGODB_URI
24+
value: "mongodb://mongodb:27017/CSO2_product_catalogue_service" # Update host
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: product-catalogue-service
30+
spec:
31+
selector:
32+
app: product-catalogue-service
33+
ports:
34+
- protocol: TCP
35+
port: 8082
36+
targetPort: 8082
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: reporting-and-analysis-service
5+
labels:
6+
app: reporting-service
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: reporting-service
12+
template:
13+
metadata:
14+
labels:
15+
app: reporting-service
16+
spec:
17+
containers:
18+
- name: reporting-service
19+
image: cso2/reporting-and-analysis-service:latest
20+
ports:
21+
- containerPort: 8088
22+
env:
23+
- name: DB_HOST
24+
value: "postgres"
25+
---
26+
apiVersion: v1
27+
kind: Service
28+
metadata:
29+
name: reporting-and-analysis-service
30+
spec:
31+
selector:
32+
app: reporting-service
33+
ports:
34+
- protocol: TCP
35+
port: 8088
36+
targetPort: 8088

0 commit comments

Comments
 (0)