Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions cso2/k8s/argocd/application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: cs02-project
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
source:
repoURL: https://github.com/CSO2/cs02-computer-store.git
targetRevision: HEAD
path: k8s/services
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: default
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
36 changes: 36 additions & 0 deletions cso2/k8s/services/ai-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-service
labels:
app: ai-service
spec:
replicas: 1
selector:
matchLabels:
app: ai-service
template:
metadata:
labels:
app: ai-service
spec:
containers:
- name: ai-service
image: cso2/ai-service:latest
ports:
- containerPort: 8089
env:
- name: DB_HOST
value: "postgres"
---
apiVersion: v1
kind: Service
metadata:
name: ai-service
spec:
selector:
app: ai-service
ports:
- protocol: TCP
port: 8089
targetPort: 8089
53 changes: 53 additions & 0 deletions cso2/k8s/services/api-gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-gateway
labels:
app: api-gateway
spec:
replicas: 1
selector:
matchLabels:
app: api-gateway
template:
metadata:
labels:
app: api-gateway
spec:
containers:
- name: api-gateway
image: cso2/api-gateway:latest
ports:
- containerPort: 8080
env:
- name: AUTH_SERVICE_URL
value: "http://auth-service:8081"
- name: PRODUCT_CATALOGUE_SERVICE_URL
value: "http://product-catalogue-service:8082"
- name: SHOPPING_CART_SERVICE_URL
value: "http://shoppingcart-wishlist-service:8084"
- name: ORDER_SERVICE_URL
value: "http://order-service:8083"
- name: NOTIFICATIONS_SERVICE_URL
value: "http://notifications-service:8087"
- name: CONTENT_SERVICE_URL
value: "http://content-service:8086"
- name: SUPPORT_SERVICE_URL
value: "http://support-service:8085"
- name: REPORTING_SERVICE_URL
value: "http://reporting-and-analysis-service:8088"
- name: AI_SERVICE_URL
value: "http://ai-service:8089"
---
apiVersion: v1
kind: Service
metadata:
name: api-gateway
spec:
selector:
app: api-gateway
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: NodePort # Or LoadBalancer
36 changes: 36 additions & 0 deletions cso2/k8s/services/auth-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-service
labels:
app: auth-service
spec:
replicas: 1
selector:
matchLabels:
app: auth-service
template:
metadata:
labels:
app: auth-service
spec:
containers:
- name: auth-service
image: cso2/auth-service:latest
ports:
- containerPort: 8081
env:
- name: DB_HOST
value: "postgres" # Update this to your DB host
---
apiVersion: v1
kind: Service
metadata:
name: auth-service
spec:
selector:
app: auth-service
ports:
- protocol: TCP
port: 8081
targetPort: 8081
36 changes: 36 additions & 0 deletions cso2/k8s/services/content-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: content-service
labels:
app: content-service
spec:
replicas: 1
selector:
matchLabels:
app: content-service
template:
metadata:
labels:
app: content-service
spec:
containers:
- name: content-service
image: cso2/content-service:latest
ports:
- containerPort: 8086
env:
- name: DB_HOST
value: "postgres"
---
apiVersion: v1
kind: Service
metadata:
name: content-service
spec:
selector:
app: content-service
ports:
- protocol: TCP
port: 8086
targetPort: 8086
37 changes: 37 additions & 0 deletions cso2/k8s/services/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: frontend
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: cso2/frontend:latest
ports:
- containerPort: 3000
env:
- name: NEXT_PUBLIC_API_URL
value: "http://api-gateway:8080" # Assuming internal or external access, might need adjustment if accessed from browser
---
apiVersion: v1
kind: Service
metadata:
name: frontend
spec:
selector:
app: frontend
ports:
- protocol: TCP
port: 3000
targetPort: 3000
type: NodePort # Or LoadBalancer/ClusterIP depending on needs
36 changes: 36 additions & 0 deletions cso2/k8s/services/notifications-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: notifications-service
labels:
app: notifications-service
spec:
replicas: 1
selector:
matchLabels:
app: notifications-service
template:
metadata:
labels:
app: notifications-service
spec:
containers:
- name: notifications-service
image: cso2/notifications-service:latest
ports:
- containerPort: 8087
env:
- name: DB_HOST
value: "postgres"
---
apiVersion: v1
kind: Service
metadata:
name: notifications-service
spec:
selector:
app: notifications-service
ports:
- protocol: TCP
port: 8087
targetPort: 8087
36 changes: 36 additions & 0 deletions cso2/k8s/services/order-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: order-service
labels:
app: order-service
spec:
replicas: 1
selector:
matchLabels:
app: order-service
template:
metadata:
labels:
app: order-service
spec:
containers:
- name: order-service
image: cso2/order-service:latest
ports:
- containerPort: 8083
env:
- name: DB_HOST
value: "postgres"
---
apiVersion: v1
kind: Service
metadata:
name: order-service
spec:
selector:
app: order-service
ports:
- protocol: TCP
port: 8083
targetPort: 8083
36 changes: 36 additions & 0 deletions cso2/k8s/services/product-catalogue-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-catalogue-service
labels:
app: product-catalogue-service
spec:
replicas: 1
selector:
matchLabels:
app: product-catalogue-service
template:
metadata:
labels:
app: product-catalogue-service
spec:
containers:
- name: product-catalogue-service
image: cso2/product-catalogue-service:latest
ports:
- containerPort: 8082
env:
- name: MONGODB_URI
value: "mongodb://mongodb:27017/CSO2_product_catalogue_service" # Update host
---
apiVersion: v1
kind: Service
metadata:
name: product-catalogue-service
spec:
selector:
app: product-catalogue-service
ports:
- protocol: TCP
port: 8082
targetPort: 8082
36 changes: 36 additions & 0 deletions cso2/k8s/services/reporting-and-analysis-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: reporting-and-analysis-service
labels:
app: reporting-service
spec:
replicas: 1
selector:
matchLabels:
app: reporting-service
template:
metadata:
labels:
app: reporting-service
spec:
containers:
- name: reporting-service
image: cso2/reporting-and-analysis-service:latest
ports:
- containerPort: 8088
env:
- name: DB_HOST
value: "postgres"
---
apiVersion: v1
kind: Service
metadata:
name: reporting-and-analysis-service
spec:
selector:
app: reporting-service
ports:
- protocol: TCP
port: 8088
targetPort: 8088
Loading