Skip to content

Milestone 4

Sudip Padhye edited this page Apr 14, 2021 · 17 revisions

TASKS:

  • Developing Jmeter Script
  • Load Testing
  • Spike Testing
  • Measuring Fault Tolerance

Developing Jmeter Script

  sudo apt-get update &&
  sudo apt-get install default-jre &&
  sudo apt-get install zip &&
  sudo apt-get install unzip
  1. Installing Jmeter
  2. Dependencies: Concurrent Thread Groups
  3. Enabling Jmeter Cache Storage
  4. Configuring Jmeter web-browser certificate and localhost proxy
  5. Storing images into the Jmeter bin folder

Load Testing

For 4 replicas of our Kubernetes microservices, we observed the following throughput graphs for 100, 500, and 1000 users.

100 users

500 users

1000 users

Spike Testing

<2-3 graphs>

Scaling-up command:

  kubectl scale deployment <deployment-name> --replicas=<higher-replica-number> -n <namespace>

Scaling-down command:

  kubectl scale deployment <deployment-name> --replicas=<lower-replica-number> -n <namespace>

Measuring Fault Tolerance

Dependencies:

  1. helm
  2. kube-monkey (Chaos Engineering)
  3. Kubernetes Replication Controller

To measure the fault tolerance of our system we made use of Kubemonkey (Chaos Engineering) concept. Following is the code to install helm & kubemonkey:

  cd PingIntelligence &&
  git checkout automation-script &&
  git pull &&
  bash helm-installation.sh &&
  cd .. &&
  git clone https://github.com/asobti/kube-monkey &&
  mv PingIntelligence/values.yaml kube-monkey/helm/kubemonkey/ &&
  helm install -name my-release kubemonkey -f kube-monkey/helm/kubemonkey/values.yaml &&
  kubectl apply -f PingIntelligence/kubemonkey-config.yaml

The above code enables kubemonkey to monitor the default namespace, kills 3 random service replicas with a frequency of daily run (Scheduling runs at 8am and pods are destroyed from 10 am-4 pm).

Architectural Changes:

  1. Deploying Kafka, Zookeeper, MySQL, consumer-queue1 & consumer-queue2 into another namespace that is blacklisted by Kube-monkey
  2. Establishing communication between pods of different namespaces (default and other).
  3. Introducing Replication controller/ReplicaSet along with Horizontal Pod Autoscaler (HPA).

https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/

https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/

Clone this wiki locally