Skip to content

scp756-221/term-project-cumulus

Repository files navigation

Open in Visual Studio Code

SFU CMPT 756 PROJECT

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.

Main Directories

  1. cluster: Cluster and Service related Configuration Files
  2. db: Database service
  3. gatling: Gatling script to perform load testing
  4. loader: Loader service to populate the database
  5. s1: User service
  6. s2: Book service
  7. s3: Checkout service

Setup

  1. For our project, we have used Google Cloud Platform for deploying our application. Install Google Cloud SDk on the local machine.

  2. Download and install istioctl.

  3. Install helm.

Instantiate the template files

Fill in the required values in the template variable file

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

Creating the cluster:

Start the cluster by going to project root directory and using command:

make -f gcp.mak start

Setup the configuration for Kubenetes:

# 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 Docker images and push it to ghcr (Container Registry)

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

Deploy the Services

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

Get external IP of our application

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

Get grafana url:

make -f k8s.mak grafana-url 

Get prometheus url:

make -f k8s.mak prometheus-url 

Get kiali url:

# Install kiali before getting the url
make -f k8s.mak kiali
make -f k8s.mak kiali-url 

Gatling Simulation

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

Killing the Cluster

make -f gc.mak stop

About

term-project-cumulus created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published