Skip to content

scp756-221/term-project-knights

Repository files navigation

Open in Visual Studio Code

Term-Project-Knights

To move away from the use of tools container (tools/shell.sh), we need to install the dependencies outside of the tools container. The following list of dependencies serve as pre-requisites for further steps in this project.

PRE-REQUISITES:

Install ==> where is , 1) kubectl 2) eksctl 3) minicube 4) istioctl 5) helm 6) k9s

REPO:

Clone the git repo for term-project-knights (or pull latest from main to make sure you have latest changes).

The githubid is unique for every user. Before proceeding, make sure to replace your githubuserid in all places, if not already done.

CONFIGURATIONS:

Make sure your aws configurations and kube configurations from the course assignments are carried forward towards the term project. We will re-use several components from earlier assignments. This includes the "*-tpl" template files from which the actual configurations and executables will be derived from.

GENERATE ARTEFACTS FROM TEMPLATES:

tools/process-templates.sh
--> to generate configurations from templates

EKS CLUSTER:

To start the cluster,

make -f eks.mak start

To delete the cluster,

make -f eks.mak stop

NOTE: Do not forget to delete the cluster after the end of the day's work. You will be billed for its continued execution.

EKS CLUSTER NAMESPACES & CONTEXTS:

kubectl config use-context aws756
kubectl create ns c756ns
kubectl config set-context aws756 --namespace=c756ns
istioctl install -y --set profile=demo --set hub=gcr.io/istio-release
kubectl label namespace c756ns istio-injection=enabled

Steps, 1-3 should deploy all your services into your EKS clusters

  1. TO BUILD DOCKER IMAGES:
make -f k8s.mak cri
  1. TO PROVISION/DEPLOY THE EKS CLUSTER:
make -f k8s.mak provision
  1. TO LOAD THE DATA INTO DYNAMODB:
make -f k8s.mak loader
  1. TO DELETE ALL PODS AND DEPLOYMENTS:
kubectl delete deployment --all
  1. TO CLEAN LOGS AND PREPARE FRESH DEPLOYMENT:
make -f k8s.mak clean

K9S:

You can check the deployments using k9s. Open a new terminal and type "k9s". k9s control terminal should open up to track the status of deployments.

GET EXTERNAL IP OF EKS CLUSTER:

The following command should give you the EXTERNAL_IP of the EKS Cluster, which will serve as an entry point.

kubectl get svc --all-namespaces | cut -c -140

You should now be able to connect to this EXTERNAL_IP via the mcli and execute commands. In case of error, you can check the logs using commands mentioned in Assignment 4 to retrieve the logs and address the issues.

TO REMOVE ALL DOCKER IMAGES (USE WITH CAUTION):

docker rmi -f $(docker images -a -q)

To run Grafana dashboard

make -f k8s.mak grafana-url

To run Prometheus dashbord

make -f k8s.mak prometheus-url

To run Gatling

  1. Go to tools/gatling-1-music.sh and add your cluster ip

  2. To run from root folder:

 tools/gatling-1-music.sh
  1. To stop call:
tools/kill-gatling.sh

To run the app locally:

  1. Run 3 terminal windows.

  2. In the first window, run the db:

 cd dynamodb_local_latest 
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb
  1. In the second window, run the app:
 cd leaderboard_local
python app.py 30001 
  1. In the third window, run the mcli to test:
 cd leaderboard_local
python mcli.py localhost 30001 

After that you can test "read", "create", and "delete" functionalities.

About

term-project-knights created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •