This is project repo for making an additional micro-service on the Distributed System's course repo.
Follow the steps to appropriately use the project code.
Things to know:
-
the project is for deploying 3 microservices on the cloud, the course kindly provided Makefile scripts to streamline that manual works. That Makefile is k8s.mak. However, k8s.mak has to be obtained by run
$ ./tools/process-templates.sh
or$ make -f k8s-tpl.mak templates
on k8s-tpl.mak (details below). -
The project use Github Container Registry (ghcr.io) for saving the three microservice images, so you need to provide credentials to access your GitHub. You need to figure out how to connect to your GitHub Container Registry before deploying.
-
Beside Github Container Registry, you need to connect to your cloud with crendentials. The project defaultly use AWS, so we fill AWS credentials in
~/.kube/config
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. Note that you
will need to have installed Gatling
(https://gatling.io/open-source/start-testing/) first, because you
will be entering its path in tpl-vars.txt
.
Once you have filled in all the details, run
$ make -f k8s-tpl.mak templates
This will check that all the programs you will need have been installed and are in the search path. If any program is missing, install it before proceeding.
The script will then generate makefiles personalized to the data that
you entered in clusters/tpl-vars.txt
.
Note: This is the only time you will call k8s-tpl.mak
directly. This creates all the non-templated files, such as
k8s.mak
. You will use the non-templated makefiles in all the
remaining steps.
$make -f k8s.mak cri
$make -f eks.mak start
$make -f k8s.mak provision
$make -f k8s.mak deploy
$make -f k8s.mak loader #make sure all template are initialized with your crendentials
The loader will load initial data to the database, so we have entries for querying.
$./gatling-user.sh 10 #meaning number of user =10 (light wight nework load)
$./gatling-book.sh 100 #heavy network load
Namely, ./gatling-(user | music | book).sh for each of user/music/book microservice.
$make -f k8s.mak grafana-url
$make -f k8s.mak kiali-url
The generated url is the user interface on brower of the applications of Grafana and Kiali.
Regardless of where your cluster will run, it uses AWS DynamoDB for its backend database. Check that you have the necessary tables installed by running
$ aws dynamodb list-tables
The resulting output should include tables User
and Music
.
The Final Demo video is available below: