We are team CUMULLUS and this is our repo for CMPT 756 Project (Spring 2022). Our Project mainly focuses on building microservices for a library scenario where a user can register and lend/return a book. In addition, we performed load testing using gatling simulation scripts and analysed the metrics using grafana and kiali dashboard.
cluster
: Cluster and Service related Configuration Filesdb
: Database servicegatling
: Gatling script to perform load testingloader
: Loader service to populate the databases1
: User services2
: Book services3
: Checkout service
-
For our project, we have used Google Cloud Platform for deploying our application. Install Google Cloud SDk on the local machine.
-
Download and install istioctl.
-
Install helm.
Copy the file cluster/tpl-vars-blank.txt
to cluster/tpl-vars.txt
and fill in all the required values in tpl-vars.txt
. These include
things like your AWS keys, your GitHub signon, and other identifying
information. See the comments in that file for details.
Once you have filled in all the details, run
$ make -f k8s-tpl.mak templates
Start the cluster by going to project root directory and using command:
make -f gcp.mak start
# Create c756ns namespace inside each cluster and set each context to use
$ kubectl config use-context gcp756
$ kubectl create ns c756ns
$ kubectl config set-context gcp756 --namespace=c756ns
Build images for the database service, user service, book service, checkout service, and the data loader. After running this command, you may go to Github packages and make each image public.
make -B -f k8s.mak cri
To deploy our services on the cluster, run the below commmand:
make -f k8s.mak provision`
This installs service mesh and istio to enable injection. Also, it will run the cloudformation stack to create DynamoDB tables and loader to initialize data in the DynamoDB tables.
To clear the deployed services from your cluster, run:
make -f k8s.mak scratch
To update your services, run:
make -f k8s.mak rollout
To send requests to our application, we can get the external IP of our application by running:
kubectl -n istio-system get service istio-ingressgateway | cut -c -140
make -f k8s.mak grafana-url
make -f k8s.mak prometheus-url
# Install kiali before getting the url
make -f k8s.mak kiali
make -f k8s.mak kiali-url
The command below can be run to generate test load using Gatling:
# Replace n with 5, 10 or 50
bash tools/gatling-n-user.sh
bash tools/gatling-n-book.sh
bash tools/gatling-n-checkout.sh
The following command stops Gatling jobs that are currently running:
./tools/kill-gatling.sh
make -f gc.mak stop