File tree Expand file tree Collapse file tree 7 files changed +41
-15
lines changed
Expand file tree Collapse file tree 7 files changed +41
-15
lines changed Original file line number Diff line number Diff line change @@ -528,6 +528,15 @@ Following commands are useful to build and push the images one by one
528528./src/apps/scripts/push-images.sh
529529```
530530
531+ ### How to deploy the application on Kubernetes
532+
533+ You can deploy the application on Kubernetes cluster.
534+
535+ ``` bash
536+ # Build images
537+ ./src/apps/scripts/deploy-k8s.sh
538+ ```
539+
531540
532541### Deploy in a cloud instance
533542
Original file line number Diff line number Diff line change 4747 secretKeyRef :
4848 name : gnx-app-secrets
4949 key : MONGODB_CONNECTION_STRING
50+ # Reverse Proxy
51+ - name : reverseProxy__clusters__identities-cluster__destinations__destination1__address
52+ value : http://identities-svc
53+ - name : reverseProxy__clusters__products-cluster__destinations__destination1__address
54+ value : http://products-svc
55+ - name : reverseProxy__clusters__orders-cluster__destinations__destination1__address
56+ value : http://orders-svc
57+ - name : reverseProxy__clusters__notifications-cluster__destinations__destination1__address
58+ value : http://notifications-svc
5059
5160 ports :
5261 - containerPort : 8080 # Port the container exposes
Original file line number Diff line number Diff line change 1717 spec :
1818 containers :
1919 - name : notifications-container
20- image : genocs/notifications-webapi:1.0.3 # Replace with your image
20+ image : genocs/notifications-webapi:1.0.4 # Replace with your image
2121 env :
2222 - name : ASPNETCORE_ENVIRONMENT
2323 value : " Development"
@@ -52,11 +52,11 @@ spec:
5252 - containerPort : 8080 # Port the container exposes
5353 resources : # Optional resource requests and limits
5454 requests :
55+ cpu : 50m
56+ memory : 100Mi
57+ limits :
5558 cpu : 100m
5659 memory : 200Mi
57- limits :
58- cpu : 200m
59- memory : 400Mi
6060
6161---
6262# notifications-service.yml
Original file line number Diff line number Diff line change @@ -47,16 +47,18 @@ spec:
4747 secretKeyRef :
4848 name : gnx-app-secrets
4949 key : MONGODB_CONNECTION_STRING
50+ - name : httpclient__services__products
51+ value : " http://products-svc"
5052
5153 ports :
5254 - containerPort : 8080 # Port the container exposes
5355 resources : # Optional resource requests and limits
5456 requests :
57+ cpu : 50m
58+ memory : 100Mi
59+ limits :
5560 cpu : 100m
5661 memory : 200Mi
57- limits :
58- cpu : 200m
59- memory : 400Mi
6062
6163---
6264# orders-service.yml
Original file line number Diff line number Diff line change @@ -52,11 +52,11 @@ spec:
5252 - containerPort : 8080 # Port the container exposes
5353 resources : # Optional resource requests and limits
5454 requests :
55+ cpu : 50m
56+ memory : 100Mi
57+ limits :
5558 cpu : 100m
5659 memory : 200Mi
57- limits :
58- cpu : 200m
59- memory : 400Mi
6060
6161---
6262# products-service.yml
Original file line number Diff line number Diff line change @@ -6,21 +6,20 @@ cd ./src/apps
66export $( grep -v ' ^#' ./local.env | xargs)
77
88
9-
109# Build the api gateway
1110docker build -t genocs/apigateway:$IMAGE_VERSION -t genocs/apigateway:latest -f ./apigateway.dockerfile .
1211
1312# Build the identities service
14- docker build -t genocs/identities:$IMAGE_VERSION -t genocs/identities:latest -f ./identities.dockerfile .
13+ docker build -t genocs/identities-webapi :$IMAGE_VERSION -t genocs/identities-webapi :latest -f ./identities.dockerfile .
1514
1615# Build the products service
17- docker build -t genocs/products:$IMAGE_VERSION -t genocs/products:latest -f ./products.dockerfile .
16+ docker build -t genocs/products-webapi :$IMAGE_VERSION -t genocs/products-webapi :latest -f ./products.dockerfile .
1817
1918# Build the orders service
20- docker build -t genocs/orders:$IMAGE_VERSION -t genocs/orders:latest -f ./orders.dockerfile .
19+ docker build -t genocs/orders-webapi :$IMAGE_VERSION -t genocs/orders-webapi :latest -f ./orders.dockerfile .
2120
2221# Build the notifications service
23- docker build -t genocs/notifications:$IMAGE_VERSION -t genocs/notifications:latest -f ./notifications.dockerfile .
22+ docker build -t genocs/notifications-webapi :$IMAGE_VERSION -t genocs/notifications-webapi :latest -f ./notifications.dockerfile .
2423
2524cd ..
2625cd ..
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+
4+ for service in apigateway identities products orders notifications
5+ do
6+ microk8s kubectl apply -f ./$service .yml
7+ done
You can’t perform that action at this time.
0 commit comments