Steps to Deploy DeathStar using Go Script
This readme is meant to provide insight into setting up and running the media-microservices DeathStarBench on a Cloudlab instance with 3 nodes (1 master, 2 worker nodes)
It has also been tested with the social-network micrroservices application. The only change is in the namespace that you have to create (i.e. create namespace social-network
)
Setup Steps:
- Install Docker and Kubernetes and Go
- Instantiate a K8s cluster
- Install python3-pip, asyncio, and aiohttp
- Install k8s client go libraries:
go get k8s.io/api go get k8s.io/apimachinery go get k8s.io/client-go
Deploy Application without Go Script
- Change lines 55, 59, 63, and 67 in
<path-to-repo>/DeathStarBench/mediaMicroservices/k8s-yaml/nginx-web-server.yaml
which refers to the the installation directory location of DeathStarBench to the appropriate location - On Master note, create namespace
media-microsvc
via:kubectl create namespace media-microsvc
- Deploy all pods via:
kubectl apply -f <path-of-repo>/mediaMicroservices/k8s-yaml/
- Wait until
kubectl -n media-microsvc get pod
displays all Pods as running
Deploy Application with Go Script
- Change lines 55, 59, 63, and 67 in
<path-to-repo>/DeathStarBench/mediaMicroservices/k8s-yaml/nginx-web-server.yaml
which refers to the the installation directory location of DeathStarBench to the appropriate location - On Master note, create namespace
media-microsvc
via:kubectl create namespace media-microsvc
- Deploy all pods via:
go run main.go -f <path-to-app-def-json>
- assure that the app-def JSON file has the correct filepath to the deployment application
- Wait until
kubectl -n media-microsvc get pod
displays all Pods as running
Register users and movie information
- Use
kubectl -n media-microsvc get svc nginx-web-server
to get its cluster-ip. - Paste the cluster ip at
<path-of-repo>/mediaMicroservices/scripts/write_movie_info.py:99
and<path-of-repo>/mediaMicroservices/scripts/register_users.sh:5
3.Update<path-of-repo>/mediaMicroservices/scripts/write_movie_info.py:95 & 97
to point to the installation path of the repo python3 <path-of-repo>/mediaMicroservices/scripts/write_movie_info.py && <path-of-repo>/mediaMicroservices/scripts/register_users.sh
Running HTTP workload generator
A sample workload can be to compose reviews - to do this, do:
- Paste the cluster ip at
<path-of-repo>/mediaMicroservices/wrk2/scripts/media-microservices/compose-review.lua:1032
-
cd <path-of-repo>/mediaMicroservices/wrk2 ./wrk -D exp -t <num-threads> -c <num-conns> -d <duration> -L -s ./scripts/media-microservices/compose-review.lua http://<cluster-ip>:8080/wrk2-api/review/compose -R <reqs-per-sec>