diff --git a/application/sockshop/README.md b/application/sockshop/README.md new file mode 100644 index 0000000..1e086c8 --- /dev/null +++ b/application/sockshop/README.md @@ -0,0 +1,27 @@ +# Sock Shop + +Sock Shop is a microservices demo platform which simulates a basic web shop selling socks. +It consists out of 19 open-source microservices whose repositories can be found [here](https://github.com/microservices-demo) + +## Deployment +Sock Shop can be deployed by executing the following steps on the master node: + +1. Clone the repository + ```git clone https://github.com/microservices-demo/microservices-demo``` + +2. Setup the sock shop + 1. ```cd microservices-demo``` + 1. ```kubectl create -f deploy/kubernetes/manifests-logging``` + 1. ```kubectl create -f deploy/kubernetes/manifests/sock-shop-ns.yaml -f deploy/kubernetes/manifests``` + +After a few minutes the pods should all be running and the sock shop can be opened. + +The deployment includes: +* The Sock Shop application +* Two services providing basic load on the system (namespace load-test) +* Partial implementation opentraces with zipkin + +## Exposed ports +When deployed, the following ports are exposed on Kubernetes cluster nodes: +* `30001` Sock Shop Front-End +* `31002` Zipkin Opentraces diff --git a/application/sockshop/workload/README.md b/application/sockshop/workload/README.md new file mode 100644 index 0000000..b222fa5 --- /dev/null +++ b/application/sockshop/workload/README.md @@ -0,0 +1,19 @@ +# Workload for Sock Shop + +[Locust](http://locust.io/) is used as a workload generator for the Sock Shop. +By default two locust services put a basic load on the system. +There's no web interface for those two services and they somehow lack controllability. +We therefore setup a different locust microservice with the default web UI. + +## Deployment +Locust can be deployed by executing the following steps on the master node: + * delete the existing load setup + ```kubectl delete pods,services,deployments --all --namespace=load-test``` + * setup the new locust microservice + ```kubectl create -f https://raw.githubusercontent.com/spec-rgdevops/CASPA-platform/master/application/sockshop/workload/locust.yaml``` + +## Exposed ports +When deployed, the following ports are exposed on Kubernetes cluster nodes: +* `31050` Locust web interface +* `31051` Locust master p1 +* `31052` Locust master p2 diff --git a/application/sockshop/workload/locust.yaml b/application/sockshop/workload/locust.yaml new file mode 100644 index 0000000..7dab41a --- /dev/null +++ b/application/sockshop/workload/locust.yaml @@ -0,0 +1,108 @@ +kind: Service +apiVersion: v1 +metadata: + name: locust-master + labels: + name: locust + role: master +spec: + type: NodePort + ports: + - port: 8089 + targetPort: loc-master-web + protocol: TCP + name: loc-master-web + nodePort: 31050 + - port: 5557 + targetPort: loc-master-p1 + protocol: TCP + name: loc-master-p1 + nodePort: 31051 + - port: 5558 + targetPort: loc-master-p2 + protocol: TCP + name: loc-master-p2 + nodePort: 31052 + selector: + name: locust + role: master +--- +kind: ReplicationController +apiVersion: v1 +metadata: + name: locust-master + labels: + name: locust + role: master +spec: + replicas: 1 + selector: + name: locust + role: master + template: + metadata: + labels: + name: locust + role: master + spec: + containers: + - name: locust + image: tinyjosh/docker-locust-faker:latest + imagePullPolicy: Always + env: + - name: LOCUST_MODE + value: master + - name: LOCUST_FILE_URL + value: https://raw.githubusercontent.com/microservices-demo/load-test/master/locustfile.py + - name: TARGET_URL + value: http://front-end.sock-shop.svc.cluster.local + - name: INFLUXDB_URL + value: influxdb + - name: INFLUXDB_PORT + value: '8086' + ports: + - name: loc-master-web + containerPort: 8089 + protocol: TCP + - name: loc-master-p1 + containerPort: 5557 + protocol: TCP + - name: loc-master-p2 + containerPort: 5558 + protocol: TCP +--- +kind: ReplicationController +apiVersion: v1 +metadata: + name: locust-worker + labels: + name: locust + role: worker +spec: + replicas: 2 + selector: + name: locust + role: worker + template: + metadata: + labels: + name: locust + role: worker + spec: + containers: + - name: locust + image: tinyjosh/docker-locust-faker:latest + imagePullPolicy: Always + env: + - name: LOCUST_MODE + value: slave + - name: MASTER_HOST + value: locust-master + - name: TARGET_URL + value: http://front-end.sock-shop.svc.cluster.local + - name: LOCUST_FILE_URL + value: https://raw.githubusercontent.com/microservices-demo/load-test/master/locustfile.py + - name: INFLUXDB_URL + value: influxdb + - name: INFLUXDB_PORT + value: '8086' \ No newline at end of file