Skip to content

Latest commit

 

History

History
106 lines (81 loc) · 2.9 KB

File metadata and controls

106 lines (81 loc) · 2.9 KB

TODOS

Create a Kind Cluster

Deploy the Demo Microservice and Install Litmus

Run Experiments and Observe (repeat steps for each experiment)

Requirements

  • Kubernetes/kubectl
  • kind

Note: I am using the sock shop microservice

Create Kind Cluster

  1. Verify kind installation

    kind version
  2. Create kind cluster

    kind create cluster --config kind-config.yaml 
  3. Set context and verify nodes

    #specify cluster name as a context
    kubectl cluster-info --context kind-kind
    #verify
    kubectl get nodes

Deploy demo microservice and install Litmus

  1. Deploy demo microservice and verify pods are running

     #deploy
     kubectl create -f sock-shop.yaml
     #verify - wait for running status
     kubectl get pods -n sock-shop
  2. Deploy Litmus ChaosOperator

    kubectl apply -f https://litmuschaos.github.io/litmus/litmus-operator-v1.9.0.yaml
  3. Install Litmus Experiments

    curl -sL https://github.com/litmuschaos/chaos-charts/archive/1.9.0.tar.gz -o litmus.tar.gz
    tar -zxvf litmus.tar.gz
    rm litmus.tar.gz
    find chaos-charts-1.9.0 -name experiments.yaml | grep generic | xargs kubectl apply -n sock-shop -f
  4. Create Service Account

    kubectl create -f rbac.yaml
  5. Get front-end deployment port info

     kubectl get deploy front-end -n sock-shop -o jsonpath='{.spec.template.spec.containers[?(@.name == "front-end")].ports[0].containerPort}'
  6. Set port forwarding

     kubectl port-forward deploy/front-end -n sock-shop 3000:8079
     #browser address: 127.0.0.1:3000

Run experiments and observe

  1. Delete any existing Chaos engines in the namespace

    kubectl delete chaosengine kind-chaos -n sock-shop
  2. Run the experiment

    kubectl create -f litmus/container-kill.yaml -n sock-shop
  3. Observe Results (Takes a few seconds for command to turnover, results initially in await state)

    kubectl get pods -n sock-shop --watch
    kubectl describe chaosengine kind-chaos -n sock-shop
    kubectl describe chaosresult kind-chaos-container-kill -n sock-shop
    #to save results to file: 
    kubectl describe chaosengine kind-chaos -n sock-shop > chaosengine.txt
    kubectl describe chaosresult kind-chaos-container-kill -n sock-shop > chaosresult.txt
  4. Uninstall

    kubectl delete -f https://litmuschaos.github.io/litmus/litmus-operator-v1.9.0.yaml
    kubectl delete chaosengine --all -n sock-shop
    kubectl delete chaosengine --all -n litmus
    kubectl delete namespaces sock-shop