litmus/monitoring/utils/sample-application-under-test/sock-shop
Ishan Gupta 32e35ad4fb
Adding monitoring and other setup files for Percona and removing event router dependency. (#2438)
* Added percona monitoring setup for Litmus

Signed-off-by: ishangupta-ds <ishan.gupta@mayadata.io>
2021-03-11 14:00:38 +05:30
..
01-namespace.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
README.md Adding monitoring and other setup files for Percona and removing event router dependency. (#2438) 2021-03-11 14:00:38 +05:30
carts-db.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
carts.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
catalogue-db.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
catalogue.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
front-end.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
orders-db.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
orders.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
payment.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
queue-master.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
rabbitmq.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
shipping.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
user-db.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30
user-load.yaml Updated user-load manifest and Prometheus scrap time (#2397) 2021-01-12 19:09:51 +05:30
user.yaml Monitoring utils added with sample AUT demo for monitoring. (#2121) 2020-10-06 18:00:39 +05:30

README.md

Demonstration

Monitor Chaos on Sock-Shop

Run chaos experiments and workflows on sock-shop application with grafana dashboard to monitor it.

Setup Sock-Shop Microservices Application

  • Apply the sock-shop microservices manifests

    kubectl apply -f .
    
  • Wait until all services are up. Verify via kubectl get pods -n sock-shop

Setup the Monitoring Components

  • create service monitors for all the application services if using prometheus operator with service monitors.

    kubectl -n sock-shop apply -f ../../sample-application-service-monitors/sock-shop/
    

Import the grafana dashboard

image

  • Import the grafana dashboard "Sock-Shop Performance" provided here

Execute the Chaos Experiments

  • For the sake of illustration, let us execute node and pod level, CPU hog experiments on the catalogue microservice & Memory Hog experiments on the orders microservice in a staggered manner.

    kubectl apply -f ../../sample-chaos-injectors/chaos-experiments/catalogue/catalogue-pod-cpu-hog.yaml
    

    Wait for ~60s

    kubectl apply -f ../../sample-chaos-injectors/chaos-experiments/orders/orders-pod-memory-hog.yaml
    

    Wait for ~60s

    kubectl apply -f ../../sample-chaos-injectors/chaos-experiments/catalogue/catalogue-node-cpu-hog.yaml
    

    Wait for ~60s

    kubectl apply -f ../../sample-chaos-injectors/chaos-experiments/orders/orders-node-memory-hog.yaml
    
  • Verify execution of chaos experiments

    kubectl describe chaosengine catalogue-pod-cpu-hog -n litmus
    kubectl describe chaosengine orders-pod-memory-hog -n litmus
    kubectl describe chaosengine catalogue-node-cpu-hog -n litmus
    kubectl describe chaosengine orders-node-memory-hog -n litmus
    

Visualize Chaos Impact

  • Observe the impact of chaos injection through increased Latency & reduced QPS (queries per second) on the microservices under test.

    image

    image

Inject continous chaos using Argo CD.

  • Install Chaos workflow infrastructure.

    • Create argo namespace

      kubectl create ns argo
      
    • Create the CRDs, workflow controller deployment with associated RBAC.

      kubectl apply -f https://raw.githubusercontent.com/argoproj/argo/stable/manifests/install.yaml -n argo
      
    • Install the argo CLI on the test harness machine (where the kubeconfig is available)

      # Download the binary
      curl -sLO https://github.com/argoproj/argo/releases/download/v2.11.0/argo-linux-amd64.gz
      
      # Unzip
      gunzip argo-linux-amd64.gz
      
      # Make binary executable
      chmod +x argo-linux-amd64
      
      # Move binary to path
      mv ./argo-linux-amd64 /usr/local/bin/argo
      
      # Test installation
      argo version
      
  • Create the Argo Access ServiceAccount

    kubectl apply -f https://raw.githubusercontent.com/litmuschaos/chaos-workflows/master/Argo/argo-access.yaml -n litmus
    
  • Run one or more of the litmuschaos experiments as Chaos workflows using argo CLI or kubectl.

    Node CPU hog

    argo cron create ../../sample-chaos-injectors/chaos-workflows-with-argo-CD/catalogue/catalogue-node-cpu-hog-workflow.yaml -n litmus
    

    Node memory hog

    argo cron create ../../sample-chaos-injectors/chaos-workflows-with-argo-CD/orders/orders-node-memory-hog-workflow.yaml -n litmus
    

    Pod CPU hog

    kubectl apply -f ../../sample-chaos-injectors/chaos-workflows-with-argo-CD/catalogue/catalogue-pod-cpu-hog-workflow.yaml -n litmus
    

    Pod memory hog

    kubectl apply -f ../../sample-chaos-injectors/chaos-workflows-with-argo-CD/orders/orders-pod-memory-hog-workflow.yaml -n litmus
    
  • Visualize the Chaos cron workflow through argo UI by obtaining Node port or Load Balancer IP.

    kubectl patch svc argo-server -n argo -p '{"spec": {"type": "NodePort"}}'
    

    OR

    kubectl patch svc argo-server -n argo -p '{"spec": {"type": "LoadBalancer"}}'
    

    image

    image