<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Litmus-Chaos - Medium]]></title>
        <description><![CDATA[Litmus is a toolset to do cloud-native chaos engineering. Litmus provides tools to orchestrate chaos on Kubernetes to help SREs find weaknesses in their deployments. Fixing the weaknesses leads to increased resilience of the system. - Medium]]></description>
        <link>https://medium.com/litmus-chaos?source=rss----2e2aae676db---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Litmus-Chaos - Medium</title>
            <link>https://medium.com/litmus-chaos?source=rss----2e2aae676db---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:52:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/litmus-chaos" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[GCP IAM Integration for LitmusChaos with Workload Identity]]></title>
            <link>https://medium.com/litmus-chaos/gcp-iam-integration-for-litmuschaos-with-workload-identity-50b7cb082491?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/50b7cb082491</guid>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[workload-identity]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <dc:creator><![CDATA[Neelanjan Manna]]></dc:creator>
            <pubDate>Sun, 04 Sep 2022 05:53:28 GMT</pubDate>
            <atom:updated>2022-09-04T05:52:47.120Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjuo-fPRZUQj-4ma6A3iLQ.png" /></figure><p>In this blog, we’ll take a look at how to do a GCP IAM integration for LitmusChaos using Workload Identity for executing the GCP experiments in a keyless manner when using the Google Kubernetes Engine (GKE) as the execution plane.</p><h3>Introduction</h3><p>To execute LitmusChaos GCP experiments, one needs to authenticate with GCP using a service account before trying to access the target resources. Usually, you have only one way of providing the service account credentials to the experiment, using a service account key, but if you’re using a GKE cluster you have a keyless medium of authentication as well. Therefore you have two ways of providing the service account credentials to your GKE cluster:</p><ul><li><strong>Using Secrets:</strong> As you would normally do, you can create a secret containing the GCP service account in your GKE cluster, which gets utilized by the experiment for authentication to access your GCP resources.</li><li><strong>IAM Integration:</strong> When you’re using a GKE cluster, you can bind a GCP service account to a Kubernetes service account as an IAM policy, which can be then used by the experiment for keyless authentication using <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity">GCP Workload Identity</a>. We’ll discuss more on this method in the following sections.</li></ul><h3>Why use Workload Identity for GCP authentication?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmyaNfpfmeC90n0bUTLExA.png" /><figcaption>Places where a service account key might exist</figcaption></figure><p>A Google API request can be made using a GCP IAM service account, which is an identity that an application uses to make calls to Google APIs. You might create individual IAM service accounts for the users who execute GCP experiments to enforce role-based access control, then download and save the keys as a Kubernetes secret that you manually rotate. Not only is this time-consuming, but service account keys only last ten years (or until you manually rotate them). An unaccounted-for key could give an attacker extended access in the event of a breach or compromise. Using service account keys as secrets is not an optimal way of authenticating GKE workloads due to this potential blind spot and the management cost of key inventory and rotation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*REe_OptsdqI0Sh122Ijn9g.png" /><figcaption>Workload Identity in a nutshell</figcaption></figure><p>Workload Identity allows you to restrict the possible “blast radius” of a breach or compromise while enforcing the principle of least privilege across your environment. It accomplishes this by automating workload authentication best practices, eliminating the need for workarounds, and making it simple to implement recommended security best practices.</p><ul><li>Your tasks will only have the permissions they require to fulfill their role with the principle of least privilege. It minimizes the breadth of a potential compromise by not granting broad permissions.</li><li>Unlike the 10-year lifetime service account keys, credentials supplied to the Workload Identity are only valid for a short time, decreasing the blast radius in the case of a compromise.</li><li>The risk of unintentional disclosure of credentials due to a human mistake is greatly reduced because Google controls the namespace service account credentials for you. It also eliminates the need for you to manually rotate these credentials.</li></ul><h3>Enabling service accounts to access GCP resources</h3><h4>STEP 1: Enable Workload Identity</h4><p>You can enable Workload Identity on clusters and node pools using the Google Cloud CLI or the Google Cloud Console. Workload Identity <strong>must</strong> be enabled at the cluster level before you can enable Workload Identity on node pools. Workload Identity can be enabled for an existing cluster as well as a new cluster.</p><p>To enable Workload Identity on a new cluster using the console, choose to create a GKE cluster, and aside from the usual configuration, simply enable the Workload Identity under security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZzVg8rLDk1O5YQkFNRVzQ.png" /><figcaption>Enable Workload Identity in GCP Cloud Console</figcaption></figure><p>You can also use the gcloud tool to create the Kubernetes cluster with Workload Identity enabled using the following command:</p><pre>gcloud container clusters create CLUSTER_NAME \    --region=COMPUTE_REGION \    --workload-pool=PROJECT_ID.svc.id.goog</pre><p>Replace the following:</p><ul><li>CLUSTER_NAME: the name of your new cluster.</li><li>COMPUTE_REGION: the Compute Engine region of your cluster. For zonal clusters, use --zone=COMPUTE_ZONE.</li><li>PROJECT_ID: your Google Cloud project ID.</li></ul><p>You can enable Workload Identity on an existing Standard cluster by using the gcloud CLI or the Cloud Console. Existing node pools are unaffected, but any new node pools in the cluster use Workload Identity by the modification of the same setting as shown above in the Cloud Console. Alternatively, you can use the following command to achieve it:</p><pre>gcloud container clusters update CLUSTER_NAME \<br>   --region=COMPUTE_REGION \<br>   --workload-pool=PROJECT_ID.svc.id.goog</pre><p>Replace the following:</p><ul><li>CLUSTER_NAME: the name of your new cluster.</li><li>COMPUTE_REGION: the Compute Engine region of your cluster. For zonal clusters, use --zone=COMPUTE_ZONE.</li><li>PROJECT_ID: your Google Cloud project ID.</li></ul><h4>STEP 2: Configure LitmusChaos to use Workload Identity</h4><p>Assuming that you already have LitmusChaos installed in your GKE cluster as well as the Kubernetes service account you want to use for your GCP experiments, execute the following steps.</p><ol><li>Get Credentials for your cluster.</li></ol><pre>gcloud container clusters get-credentials CLUSTER_NAME</pre><p>Replace CLUSTER_NAME with the name of your cluster that has Workload Identity enabled.</p><p>2. Create an IAM service account for your application or use an existing IAM service account instead. You can use any IAM service account in any project in your organization. For Config Connector, apply the IAMServiceAccount object for your selected service account. To create a new IAM service account using the gcloud CLI, run the following command:</p><pre>gcloud iam service-accounts create GSA_NAME \<br>--project=GSA_PROJECT</pre><p>Replace the following:</p><ul><li>GSA_NAME: the name of the new IAM service account.</li><li>GSA_PROJECT: the project ID of the Google Cloud project for your IAM service account.</li></ul><p>Alternatively, you can also use the Cloud Console UI to create a new GCP IAM Service Account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rsnVn1bWfZYu1tz-e6goJQ.png" /><figcaption>IAM Service Accounts in GCP Cloud Console</figcaption></figure><p>3. Ensure that this service account has all the roles required for interacting with the Compute Engine resources including VM Instances and Persistent Disks according to the GCP experiments that you’re willing to run. You can grant additional roles either using the Cloud Console or using the following command:</p><pre>gcloud projects add-iam-policy-binding PROJECT_ID \    <br>--member &quot;serviceAccount:GSA_NAME@GSA_PROJECT.iam.gserviceaccount.com&quot; \<br>--role &quot;ROLE_NAME&quot;</pre><p>Replace the following:</p><ul><li>PROJECT_ID: your Google Cloud project ID.</li><li>GSA_NAME: the name of your IAM service account.</li><li>GSA_PROJECT: the project ID of the Google Cloud project of your IAM service account.</li><li>ROLE_NAME: the IAM role to assign to your service account, like roles/spanner.viewer.</li></ul><p>4. Allow the Kubernetes service account to be used for the GCP experiments to impersonate the GCP IAM service account by adding an <a href="https://cloud.google.com/sdk/gcloud/reference/iam/service-accounts/add-iam-policy-binding">IAM policy binding</a> between the two service accounts. This binding allows the Kubernetes service account to act as the IAM service account.</p><pre>gcloud iam service-accounts add-iam-policy-binding GSA_NAME@GSA_PROJECT.iam.gserviceaccount.com \<br>   --role roles/iam.workloadIdentityUser \<br>   --member &quot;serviceAccount:PROJECT_ID.svc.id.goog[NAMESPACE/KSA_NAME]&quot;</pre><p>Replace the following:</p><ul><li>GSA_NAME: the name of your IAM service account.</li><li>GSA_PROJECT: the project ID of the Google Cloud project of your IAM service account.</li><li>KSA_NAME: the name of the Kubernetes service account to be used for LitmusChaos GCP experiments. If you’re using ChaosCenter, then by default the litmus-admin service account is used for all the experiments.</li><li>NAMESPACE: the namespace in which the Kubernetes service account to be used for LitmusChaos GCP experiments is present. If you’re using ChaosCenter, then by default litmus is the namespace.</li></ul><p>5. Annotate the Kubernetes service account to be used for LitmusChaos GCP experiments with the email address of the GCP IAM service account.</p><pre>kubectl annotate serviceaccount KSA_NAME \<br>   --namespace NAMESPACE \<br>iam.gke.io/gcp-service-account=GSA_NAME@GSA_PROJECT.iam.gserviceaccount.com</pre><p>Replace the following:</p><ul><li>KSA_NAME: the name of the Kubernetes service account to be used for LitmusChaos GCP experiments. If you’re using ChaosCenter, then by default the litmus-admin service account is used for all the experiments.</li><li>NAMESPACE: the namespace in which the Kubernetes service account to be used for LitmusChaos GCP experiments is present. If you’re using ChaosCenter, then by default litmus is the namespace.</li><li>GSA_NAME: the name of your IAM service account.</li><li>GSA_PROJECT: the project ID of the Google Cloud project of your IAM service account.</li></ul><h4>STEP 3: Update ChaosEngine Manifest</h4><p>When creating a new workflow with GCP experiments, edit the manifest YAML and add the following value to the ChaosEngine manifest field .spec.experiments[].spec.components.nodeSelector to schedule the experiment pod on nodes that use Workload Identity:</p><p>iam.gke.io/gke-metadata-server-enabled: &quot;true&quot;</p><p>As an example, say you’re adding the GCP VM Instance Stop experiment, you’d make the following change:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*id8oMvx3S32DFeZHH1WTrg.png" /><figcaption>Update the nodeSelector field for an experiment in the ChaosEngine Manifest</figcaption></figure><h4>STEP 4: Update ChaosExperiment Manifest</h4><p>Remove cloud-secret at .spec.definition.secrets in the ChaosExperiment manifest as we are not using a secret to provide our GCP Service Account credentials.</p><p>As an example, say you’re adding the GCP VM Instance Stop experiment, you’d remove the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iYYrPyPGqJT2aqffFs8lw.png" /><figcaption>Remove the Kubernetes secret for GCP SA from ChaosEngine Manifest</figcaption></figure><p>Now you can run your GCP experiments with a keyless authentication provided by GCP using Workload Identity.</p><h3>Summary</h3><p>To conclude, we were able to set up a keyless authentication medium for the GCP experiments executing in a GKE that belongs to the target GCP environment. We saw how we can leverage Workload Identity for the GKE node pools to assign an IAM identity to our Kubernetes workloads, which was then used for the authentication of LitmusChaos GCP experiments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50b7cb082491" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/gcp-iam-integration-for-litmuschaos-with-workload-identity-50b7cb082491">GCP IAM Integration for LitmusChaos with Workload Identity</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to HTTP Chaos in LitmusChaos]]></title>
            <link>https://medium.com/litmus-chaos/introduction-to-http-chaos-in-litmuschaos-e5ac7286862?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/e5ac7286862</guid>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[litmus]]></category>
            <dc:creator><![CDATA[Akash Shrivastava]]></dc:creator>
            <pubDate>Thu, 25 Aug 2022 21:05:33 GMT</pubDate>
            <atom:updated>2022-08-31T11:21:40.539Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cyqul8JBuwJOGEdtarGmgg.png" /></figure><p>This article is a getting-started guide for HTTP Chaos in LitmusChaos. We will be talking about</p><ol><li>Introduction to LitmusChaos</li><li>How does HTTP Chaos work — Architecture</li><li>Types of HTTP Chaos Experiments</li><li>HTTP Chaos Demo</li></ol><h3>What is LitmusChaos</h3><p>LitmusChaos is a toolset to do cloud-native chaos engineering. It provides tools to orchestrate chaos on Kubernetes to help SREs find weaknesses in their deployments. SREs use Litmus to run chaos experiments initially in the staging environment and eventually in production to find bugs and vulnerabilities. Fixing the weaknesses leads to increased resilience of the system.</p><p>Litmus takes a cloud-native approach to creating, managing and monitoring chaos. Chaos is orchestrated using the following Kubernetes Custom Resource Definitions (CRDs):</p><ul><li>ChaosEngine: A resource to link a Kubernetes application or Kubernetes node to a ChaosExperiment. ChaosEngine is watched by Litmus’ Chaos-Operator which then invokes Chaos-Experiments</li><li>ChaosExperiment: A resource to group the configuration parameters of a chaos experiment. ChaosExperiment CRs are created by the operator when experiments are invoked by ChaosEngine.</li><li>ChaosResult: A resource to hold the results of a chaos experiment. The Chaos-exporter reads the results and exports the metrics into a configured Prometheus server.</li></ul><p>For more information, you can visit <a href="https://litmuschaos.io/">litmuschaos.io</a> or <a href="https://github.com/litmuschaos/litmus">github.com/litmuschaos/litmus</a></p><h3>Architecture</h3><p>The experiments internally use two things to inject HTTP chaos and redirect traffic properly. First, it runs a proxy server that acts as a middleman and modifies the request/response per the experiment type. Second, it creates a routing rule in the network routing table using the IPtables library to redirect all incoming traffic on the targetted service port to the proxy port.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*E-VWfjVEYQ2Z8hxb6-FK5Q.png" /><figcaption>Without proxy server</figcaption></figure><p>This diagram shows a request without HTTP chaos injected. The request to access Service A comes at port 80 and is forwarded to Service A to be processed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*ZCQrMFUbjvVbNXMnTvNEEw.png" /><figcaption>With proxy server</figcaption></figure><p>Now, after we inject HTTP chaos, the request to access Service A comes to port 80 but is forwarded to port 8000, on which the proxy server listens for requests. This is done by adding a routing rule in the routing table using IPtables. After the proxy server has modified the request, if required, it will forward the request to Service A to be processed. Now the response will follow the same path, the proxy server will modify the response if required and then send it back to the client to complete the request loop.</p><p>The proxy server is running inside the service pod and the service pod routing table is updated by running commands inside the service pod using the nsenter tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZoDUj7m56Bg8mu7f" /><figcaption>How proxy server and IPtable are run inside Target Pod</figcaption></figure><p>To facilitate the creation of a proxy server and adding rules to the routing table, a helper pod is run which uses nsenter to enter inside the target pod to run commands to achieve this.</p><h3>Experiments</h3><p>Currently, there are 5 different types of HTTP experiments available. They are</p><ol><li><a href="https://litmuschaos.github.io/litmus/experiments/categories/pods/pod-http-latency/">HTTP Latency</a></li><li><a href="https://litmuschaos.github.io/litmus/experiments/categories/pods/pod-http-reset-peer/">HTTP Reset Peer</a></li><li><a href="https://litmuschaos.github.io/litmus/experiments/categories/pods/pod-http-status-code/">HTTP Status Code</a></li><li><a href="https://litmuschaos.github.io/litmus/experiments/categories/pods/pod-http-modify-header/">HTTP Modify Header</a></li><li><a href="https://litmuschaos.github.io/litmus/experiments/categories/pods/pod-http-modify-body/">HTTP Modify Body</a></li></ol><p>Let’s know more about them</p><p><strong>HTTP Latency</strong></p><p>HTTP latency adds latency to the HTTP requests by adding a sleep timer before sending the request forward from the proxy server. It can be used to simulate delayed responses from the APIs. To tune the latency value, use the LATENCY experiment variable and provide the value in milliseconds.</p><p><strong>HTTP Reset Peer</strong></p><p>HTTP Reset Peer simulates TCP connection reset error by closing the connection after a specified timeout. It can be used to simulate connection failures. To tune the timeout value, use the RESET_TIMEOUTexperiment variable and provide the value in milliseconds</p><p><strong>HTTP Status Code</strong></p><p>HTTP Status Code can modify the status code of the response from the service as well as change the body of the response for the defined status code with a predefined template. It can be used to simulate API failures. To specify the status code using the STATUS_CODE experiment variable to tune the value. Supported values are available in the docs. You can also provide a comma-separated list of values and the experiment will select a random value from the list to use. If no value is provided then any random value from the supported values will be chosen.</p><p>You can use the MODIFY_RESPONSE_BODY variable to tune whether the response is changed with a predefined template according to the status code or not.</p><p><strong>HTTP Modify Header</strong></p><p>HTTP Modify Header can modify, add or remove headers from a request or response based on provided values. To specify whether you want to modify the request or response, use the HEADER_MODEvariable. You can set it to request or response.</p><p>The HEADERS_MAP needs a JSON-type input. Suppose you want to add a header litmus with a value 2.12.0 then you should provide it like this {“litmus”: “2.12.0”} similarly for multiple values as well. To remove a header, you can overwrite its value to an empty string, currently removing the header key is not possible.</p><p><strong>HTTP Modify Body</strong></p><p>HTTP Modify Body can modify the request/response body completely. This can be used to modify API responses. You can use the RESPONSE_BODY variable to provide the overwrite value, this can be an HTML, plain text or JSON object.</p><h3>Important Tuneable</h3><p>These are the tuneable specific to all the HTTP Chaos experiments</p><h4>Toxicity</h4><p>TOXICITY can be used to provide the probability of requests being affected. Suppose you want only 50% of the requests to be affected, by setting the value TOXICITY to 50, the probability of a request getting affected is 50%. This doesn’t mean every alternate request will be affected, but each request has a 50–50 chance of being affected. In large requests count, this comes out to be around 50% of requests being affected.</p><h4>Target Service Port</h4><p>TARGET_SERVICE_PORT is the port of the service you want to target. This should be the port where the application runs at the pod level, not at the service level. This means if the application pod is running the service at port 8080 and we create a service exposing that at port 80, then the target service port should be 8080 and not 80, which is the port at pod-level.</p><h4>Proxy Port</h4><p>PROXY_PORT is the port at which the proxy server will be running. You are not required to change the default value (which is 20000) if this port is being used explicitly by any of your other services. If the experiment fails due to a port bind issue for the proxy server, you can change this value to an empty port to make it work.</p><h4>Network Interface</h4><p>NETWORK_INTERFACE is the interface name for the network which your service is using. The default value is eth0. If the experiment injection is failing due to a network interface error, you can use this to change it to the correct value.</p><h3>Demo</h3><p>Let us run the HTTP Status Code experiment. For simplicity, we will be injecting chaos into an Nginx service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NnuFgvvqUI_gl5CpjQpBFA.png" /></figure><p>The service is running on port 80, we will be targeting this.</p><p>If we access the service, we are getting a 200 OK response with the default Nginx webpage. I will be using Postman to verify the status code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*LYTsx6qovZ26I3QgAouAKw.png" /></figure><p>Now, that we have the application set up on which we will be injecting chaos, let’s start creating a chaos scenario with the HTTP Status Code experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_rmMQQxncmM_MQai9etJQ.gif" /></figure><p>Login to Chaos Centre and get to the Chaos Scenario section. Click on the Schedule a Chaos Scenario button. Select your agent and then select the chaos hub (HTTP experiments are available from ChaosHub version 2.11.0). Add a name for your scenario and move ahead. Now we are at selecting the experiments page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWssLrRTw0sYk7UJW4u5hw.gif" /></figure><p>We will be selecting the generic/pod-http-status-code experiment from the list of experiments. Moving ahead, we will tune the experiment variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7KHiitRvjJpF0FXMOHoiJg.gif" /></figure><p>Click on the pencil icon next to the experiment name to edit the experiment. Now we have to select the app to inject chaos into. The NGINX application we are using is running in the default namespace, it is of deployment kind and has the label app=nginx. We will skip adding probes to keep it simple. The next section is to tune the experiment variables. Change the STATUS_CODE to 500 and the TARGET_SERVICE_PORT to the port of the service, in this case, it is port 80. The MODIFY_RESPONSE_BODY is a boolean to specify whether the response body should be changed to a pre-defined HTTP template according to the status code. Now we are done with tuning the required variables in this experiment, let’s move ahead and run this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLoP7bTGTU_xG3eJMd-ubw.gif" /></figure><p>Now LitmusChaos will set up the experiment and then run it, once it starts injecting chaos we will be seeing the status code changing for the service. The output will be something similar to this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMkzkEL700vJTTgVYGtmFQ.gif" /></figure><p>That’s it, we have injected HTTP chaos into our application. The experiment passed because we haven’t specified any criteria to verify, we can do this using probes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9Oyb9NVRSBCZvkmQyz_Eg.png" /></figure><h3>Summary</h3><p>Through this article, we could understand how the HTTP chaos experiment works internally and then talk about the current types of HTTP chaos experiments available. Then we injected the HTTP Status code experiment on a sample NGINX service and saw the experiment in live action. In further tutorial blogs, I will be talking about running the other HTTP experiments as well.</p><p>You can join the LitmusChaos community on <a href="https://github.com/litmuschaos/litmus"><em>GitHub</em></a><em> </em>and <a href="https://www.notepadonline.org/wmtBaRICHQ"><em>Slack</em></a>. The community is very active and tries to solve queries quickly.</p><p>I hope you enjoyed this journey and found the blog interesting. You can leave your queries or suggestions (appreciation as well) in the comments below.</p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! 🙏</p><p>Thank you for reading</p><p>Akash Shrivastava</p><p>Software Engineer at Harness</p><p><a href="https://www.linkedin.com/in/avaakash/">Linkedin </a>| <a href="https://github.com/avaakash">Github </a>| <a href="https://instagram.com/avaakash">Instagram </a>| <a href="https://twitter.com/_avaakash_">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5ac7286862" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/introduction-to-http-chaos-in-litmuschaos-e5ac7286862">Introduction to HTTP Chaos in LitmusChaos</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Litmus 2.0 — Simplify Chaos Engineering]]></title>
            <link>https://medium.com/litmus-chaos/introducing-litmus-2-0-simplify-chaos-engineering-365c5b9f3fd3?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/365c5b9f3fd3</guid>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[resilience]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Ajesh Baby]]></dc:creator>
            <pubDate>Tue, 07 Sep 2021 14:08:43 GMT</pubDate>
            <atom:updated>2021-11-25T08:35:26.336Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introducing Litmus 2.0 — Simplify Chaos Engineerin</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*wfX8HSQ8X1-wudD4.png" /></figure><p>I am feeling delighted to write this blog on the eve of the announcement of LitmusChaos 2.0. We had spent a bit more than a year planning on adding additional features and making the user journey better and simpler. While more requirements and improvements are flowing in, we are encouraged by the possibilities and feedback. The principles and features of 2.0 have been solidified over many months of beta.</p><p>Let me put the thoughts before making LitmusChaos 2.0. We wanted to have a clear distinction between the existing 1.x and 2.x versions. The items which we concentrated are as mentioned below.</p><ul><li>Provide a single pane for orchestration ChaosCenter. This piece of LitmusChaos is not just, and it’s built upon the API layer. Keeping any user interaction can be achieved through this either through UI, API or LitmusCTL. Hold on. I will be covering LitmusCTL later on this blog.</li><li>Didn’t want to deviate from the principle on how the Chaos Engineering Platform should be built and stick the features in alignment with these principles.</li><li>Users should be able to share or collaborate the workflow with others</li><li>GitOps enabled, i.e. the user should be able to source control the workflow or execute workflow based on the changes in the environment</li><li>Open Observability, able to observe chaos injection impact using their existing observability tools. Support Non-K8S Chaos from Litmus and enable it to schedule it the same way as other workflows.</li><li>Central repo from which users can consume or contribute the experiments. ChaosHub.</li><li>For Novice have a predefined workflow so that they can consume the ChaosEngineering on a Standard microservices reference architecture like Sock-Shop, PodatoHead Application and Bank of Anthos.</li></ul><p>Now let’s briefly explore the new feature additions in LitmusChaos 2.0.</p><p><strong>Chaos Center</strong></p><p>Let us consider the life cycle of Chaos Engineering in 4 simple steps as depicted in the diagram. And let us increase a bit more complexity in your environment. You want to manage the multiple clusters and cross-cloud or do it across various teams. You need an interface, i.e. to do either using UI or API. To answer this, we devised ChaosCenter.</p><ul><li>A chaos control plane or portal provides centralised management and orchestration of chaos operations on multiple clusters across data centres/clouds. The control plane carries out experiments through agents installed on the registered clusters.</li><li>Comprises documented APIs to invoke chaos programmatically.</li><li>Provides visualisation capabilities and analytics</li><li>Supports an org-project-teams-users structure to enable collaboration within teams for chaos operations.</li><li>Introduces chaos workflows — to (a) automate dependency setup (b) aid creation of complex chaos scenarios with multiple faults © support definition of load/validation jobs along with chaos injection</li><li>Provides flexibility in creating/running workflows in different ways — via templates, an integrated hub, and custom uploads.</li><li>Supports setup (control plane &amp; agents) and execution of chaos experiments in both: cluster-scoped and namespace-scoped modes to help operations in shared clusters with a self-service model</li></ul><p><strong>LitmusCTL</strong></p><p>LitmusCTL is a command-line tool for advanced users who would want to perform operations in the command line. At present, this has support for registering Chaos agents to ChaosCenter.</p><p>* <em>Open Observability &amp; Steady State Hypothesis Validation *</em></p><ul><li>Provides an increased set of Prometheus metrics with additional filters — that can be used for instrumenting application dashboards to observe chaos impact</li><li>Provides a diverse set of probes to automate validation of steady-state hypothesis — thereby improving the efficiency of running automated chaos experiments</li></ul><p><strong>GitOps for Chaos</strong></p><ul><li>Integrates with Git-based SCM to provide a single-source-of-truth for chaos artifacts (workflows). Changes are synchronised bi-directionally b/w the git source and the ChaosCenter — thereby pulling the latest artifact for execution.</li><li>Provides an event-tracker microservice to automatically launch “subscribed” chaos workflows upon app upgrades affected by GitOps tools like ArgoCD, Flux.</li></ul><p><strong>Non-Kubernetes Chaos</strong></p><ul><li>Adds experiments to inject chaos on infrastructure (cloud) resources such as VMs/instances and disks (AWS, GCP, Azure, VMWare) — irrespective of whether they host the Kubernetes clusters or not.</li><li>Introduces chaos experiments to bring down bare metal nodes that provide IPMI-based out-of-band access.</li></ul><p>We invite you to discuss <a href="https://github.com/litmuschaos/litmus/discussions/">GitHub</a> or <a href="https://slack.litmuschaos.io/">Slack</a> with us and provide us with your requirements to improve Litmus as a community project.</p><p><strong>Conclusion</strong></p><p>That’s all, folks. Thank you for reading it till the end. I hope you had a productive time learning about Litmus, and we hope you are as excited as we are about the features/additions to <a href="https://github.com/litmuschaos/litmus">Litmus</a></p><p>Are you an <a href="https://en.wikipedia.org/wiki/Site_Reliability_Engineering">SRE</a> or a <a href="https://kubernetes.io/">Kubernetes</a> enthusiast? Does <a href="https://en.wikipedia.org/wiki/Chaos_engineering">Chaos Engineering</a> excite you?</p><p>Join Our Community On Slack For Detailed Discussion, Feedback &amp; Regular Updates On Chaos Engineering For Kubernetes: <a href="https://slack.litmuschaos.io/">https://slack.litmuschaos.io</a> (#litmus channel on the Kubernetes workspace)</p><p><em>Originally published at </em><a href="https://dev.to/litmus-chaos/introducing-litmus-2-0-simplify-chaos-engineering-4g5e"><em>https://dev.to</em></a><em> on Sep 1, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=365c5b9f3fd3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/introducing-litmus-2-0-simplify-chaos-engineering-365c5b9f3fd3">Introducing Litmus 2.0 — Simplify Chaos Engineering</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run Azure Disk Loss Experiment in LitmusChaos]]></title>
            <link>https://medium.com/litmus-chaos/how-to-run-azure-disk-loss-in-litmuschaos-86912b43dafe?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/86912b43dafe</guid>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[litmus]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[azure]]></category>
            <dc:creator><![CDATA[Akash Shrivastava]]></dc:creator>
            <pubDate>Thu, 26 Aug 2021 13:23:23 GMT</pubDate>
            <atom:updated>2022-08-22T09:53:42.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5MRbsyEFH9jnrmlRNpU8g.png" /></figure><p>This article is a guide for setting up and running the Azure Virtual Disk Loss experiment on LitmusChaos 2.0. The experiment causes detachment of one or more virtual disks from the instance for a certain chaos duration and then re-attached them. The broad objective of this experiment is to extend support of LitmusChaos to non-Kubernetes targets while ensuring resiliency for all kinds of targets, as a part of a single chaos workflow for the entirety of a business.</p><p>If you are looking for the Azure Instance Stop experiment, you can find it <a href="https://medium.com/litmus-chaos/how-to-run-azure-instance-stop-experiment-in-litmuschaos-63ae3bcdb9ad">here</a></p><h3>Pre-Requisites</h3><p>To run this experiment, we need a few things beforehand</p><ol><li>An Azure account</li><li>Disk(s) attached to Virtual Machine Scale Set (or an Instance only)</li><li>A Kubernetes cluster with LitmusChaos 2.0 installed (you can follow this blog to set up LitmusChaos 2.0 on AKS — <a href="https://medium.com/litmus-chaos/litmus-in-aks-f8838cfc551f"><em>Getting Started with LitmusChaos 2.0 in Azure Kubernetes Service</em></a>)</li></ol><h3>Setting up Azure Credentials as Kubernetes Secret</h3><p>To let LitmusChaos access your Azure instances, you need to set up the azure credentials as a Kubernetes secret. It is a very simple process, first, you need to install Azure CLI (if you already haven’t) and log in to it. Now run this command to get the azure credentials saved in an <em>azure.auth</em> file.</p><pre>az ad sp create-for-rbac — sdk-auth &gt; azure.auth</pre><p>Next, create a<em> secret.yaml</em> file with the following content. Change the content inside <em>azure.auth </em>with the contents inside your <em>azure.auth</em> file</p><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: cloud-secret<br>type: Opaque<br>stringData:<br>  azure.auth: |-<br>    {<br>      &quot;clientId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;clientSecret&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;subscriptionId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;tenantId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;activeDirectoryEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;resourceManagerEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;activeDirectoryGraphResourceId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;sqlManagementEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;galleryEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;managementEndpointUrl&quot;: &quot;XXXXXXXXX&quot;<br>    }</pre><p>Now run the following command. Remember to change the namespace if you have installed LitmusChaos in any other namespace</p><pre>kubectl apply -f secret.yaml -n litmus</pre><h3>Updating ChaosHub</h3><p>As the experiment is only available as a technical preview right now, we will have to update the ChaosHub to use the technical preview (master) branch.</p><p>Login to the Chaos Center and go to the ChaosHub section, select MyHub there and click on Edit Hub</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlqxOFLnlZ_9b3uZ-IPpsw.png" /></figure><p>Now change the branch to “master”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZiNzR4eL8ku4iIh8myObjQ.png" /></figure><p>Click on Submit Now and the ChaosHub will now show the Azure Disk Loss experiment.</p><h3>Scheduling the Experiment Workflow</h3><p>Now move to the Workflows section and click on Schedule a Workflow. Select the Self-Agent (or any other one if you have multiple agents installed) and click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSTrvNK3GYDg3Qp5siCnDg.png" /></figure><p>Select the third option to create a workflow from experiments using ChaosHub. Click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0E5BalV9CQWFTqCkEz8Wyw.png" /></figure><p>Click Next again (or edit the workflow name if you want to) and now on the Experiments page, click on Add a new Experiment and select the Azure Virtual Disk Loss experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrT-_fFxofdXnlnVN9ceVw.png" /></figure><p>Next click on Edit YAML, you will now have to add the Disk Name(s) and Resource Group name in the ChaosEngine environments. Scroll down to the ChaosEngine artefacts, where you will see the environment variables, and set the values accordingly. If your disks are connected to an instance that is a part of Scale Set, set the SCALE_SET to “enable”. Save the changes and schedule your workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4X6KbmJk_8dEGhd9s-9Zw.png" /></figure><p><strong>Note:</strong> For Scale set and node pools, the experiment works only for disk(s) attached to a specific instance in the scale set and not to the scale set</p><h3>Observing the Experiment Run</h3><p>Great, now your workflow is running and you can check it out, click on Go to Workflow and then select your workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P-o-1gDyd9Y3J5JJvE_PEg.png" /></figure><p>You can check the status of your disk(s) in the Azure Portal to verify that the experiment is working as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbgfNEICOCA_0hCvMlP7AA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfIJaGvTcyjUzfix4dQT4A.png" /></figure><p>You can also click on azure-disk-loss to view the experiment logs. After the given chaos duration, the experiment will automatically re-attach the disk(s) and give a pass/fail verdict. In case the experiment fails, verify through the logs and portal that the disk has been re-attached.</p><p>This was it, you have successfully run the Azure Disk Loss experiment using LitmusChaos 2.0 Chaos Center.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8H5iqZLFoJacFJ0fltJ_A.png" /></figure><p>In this blog, we saw how we can perform the Azure Disk Loss experiment using LitmusChaos 2.0. You can learn more about this experiment from the <a href="https://github.com/litmuschaos/litmus-docs/blob/master/docs/azure-disk-loss.md">docs</a>. This experiment is one of the many experiments Non-Kubernetes experiments in LitmusChaos, including experiments for AWS, GKS, and VMWare, which are targeted toward making Litmus an absolute Chaos Engineering toolset for every enterprise regardless of the technology stack used.</p><p>You can join the LitmusChaos community on <a href="https://github.com/litmuschaos/litmus"><em>Github</em></a><em> </em>and <a href="https://www.notepadonline.org/wmtBaRICHQ"><em>Slack</em></a>. The community is very active and tries to solve queries quickly.</p><p>I hope you enjoyed this journey and found the blog interesting. You can leave your queries or suggestions (appreciation as well) in the comments below.</p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! 🙏</p><p>Thank you for reading</p><p>Akash Shrivastava</p><p>Software Engineer at Harness</p><p><a href="https://www.linkedin.com/in/avaakash/">Linkedin </a>| <a href="https://github.com/avaakash">Github </a>| <a href="https://instagram.com/avaakash">Instagram </a>| <a href="https://twitter.com/_avaakash_">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86912b43dafe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/how-to-run-azure-disk-loss-in-litmuschaos-86912b43dafe">How to run Azure Disk Loss Experiment in LitmusChaos</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding User Management and Authentication in LitmusChaos]]></title>
            <link>https://medium.com/litmus-chaos/understanding-user-management-and-authentication-in-litmuschaos-e9eb838b8326?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/e9eb838b8326</guid>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Saranya Jena]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 06:07:51 GMT</pubDate>
            <atom:updated>2021-08-24T06:07:50.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_p2h5qjqfGl4BN9Cxalfsw.png" /></figure><p>In this post, I will be explaining how user management and authentication are done in <a href="https://litmusdocs-beta.netlify.app/docs/introduction/what-is-litmus">LitmusChaos</a>. LitmusChaos is a Cross-Cloud Chaos Orchestration framework for practicing chaos engineering in cloud-native environments.</p><h3>LitmusChaos 2.0 is out now!🚀</h3><p>LitmusChaos 2.0 provides a new way of chaos engineering performed by the users. LitmusChaos itself is composed of microservices. And we made sure that adding the features for 2.0 seamlessly integrates the additional microservices in conjunction with the existing one. It is completely backward compatible. No features are deprecated.</p><p><strong>Highlights:</strong></p><ul><li>All features of Litmus 1.x</li><li>Addition of Chaos Workflow creation</li><li>User Management &amp; Teaming</li><li>Introduction of ChaosCenter (The central chaos management center)</li><li>Monitoring and Observability</li><li>Resilience Score Calculation</li><li>Manage Workflows using GitOps, Custom Image Registry</li></ul><h3>User Roles and Accessibility</h3><p>First of all, let me explain the different user-level roles and their privileges. LitmusChaos also has project-level roles which come under the <a href="https://dev.to/litmus-chaos/introducing-teaming-in-litmuschaos-to-ease-your-chaos-engineering-experience-5alo">teaming section</a>.</p><ol><li><strong>Admin:</strong> The admin user is created by default on the initial portal <a href="https://litmusdocs-beta.netlify.app/docs/getting-started/installation">setup</a> and can log into the portal using the credentials admin/litmus once the server pods are up and running. The admin can access every feature with exclusive access to the User-management feature for user creation and management. Admin users can also view the overall usage statistics of the portal.</li><li><strong>Non-Admins:</strong> The non-admin users, created by the admin, have access to all the features except User-management and Usage statistics.</li></ol><h3>Features</h3><h3>User-management</h3><p>Admin can access the following features through the User management section:</p><ol><li><strong>Create a User:</strong> Admin can create a user by assigning a unique username and password and other optional details like name email-id.</li><li><strong>View Users list:</strong> Once the user is created, it will be listed in the table along with other details such as current status(active or deactivated), name, username, email-id, date, and time of the user creation.</li><li><strong>Activate/Deactivate users:</strong> Admin can toggle the current status of the user. Once a particular user is deactivated he/she won’t be able to access any APIs of the LitmusChaos but all the previous data will be stored, which can be accessed back once the user gets reactivated.</li><li><strong>Edit profile:</strong> Here, Admin can reset the password of other users.</li></ol><h3>Authentication and Getting Started</h3><p>Once a user is created, the user will be able to login into the portal with non-admin privileges. In case a user forgets the credentials, he/she can contact the portal admin to reset the credentials.<br>On successful authentication, the user will be redirected to the /getStarted route. Users will be asked to change the password for the initial login and use the updated password for subsequent logins. One can also skip the option to change the password. Users can update their password anytime through the My Account section. In either case, a default project will be created for you under which you can do your chaos testing!</p><p>Here’s a short GIF explaining all the basic features of User-management:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*hotyD5r_1S2d87q_.gif" /></figure><h3>Some noteworthy points</h3><p>I have noticed, people are often confused between the types of roles. There are two layers of privilege levels:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/0*3G-5AjDghI2RNqmD.png" /></figure><ol><li><strong>Portal Level:</strong> This is the first layer of privilege levels where user roles are assigned during user creation. As of now, one who installs the LitmusChaos and logs in with admin/litmus credentials are assigned the role admin, and all other users created by admin are assigned the role user.</li><li><strong>Project Level:</strong> This is the second layer of the privilege level, where roles are assigned to the project members while sending an invitation. If you want to know more about Projects and Teaming, you can find them <a href="https://dev.to/litmus-chaos/introducing-teaming-in-litmuschaos-to-ease-your-chaos-engineering-experience-5alo">here</a>.</li></ol><h3>Conclusion</h3><p>That’s all, folks. Thank you for reading it till the end. I hope you had a productive time learning about LitmusChaos, and we hope you are as excited as we are about the upcoming features/additions!</p><p><em>Are you an SRE or a Kubernetes enthusiast? Does Chaos Engineering excite you?</em></p><p>Join Our Community On Slack For Detailed Discussion, Feedback &amp; Regular Updates On Chaos Engineering For Kubernetes: <a href="https://slack.litmuschaos.io/">https://slack.litmuschaos.io</a> (#litmus channel on the Kubernetes workspace)</p><p>Check out the Litmus Chaos GitHub repo and do share your feedback: <a href="https://github.com/litmuschaos/litmus/issues">https://github.com/litmuschaos/litmus/issues</a><br>Submit a pull request if you identify any necessary changes.<br>Show your ❤️ with a ⭐ on our Github. To learn more about Litmus, check out the Litmus <a href="https://litmusdocs-beta.netlify.app/docs/introduction/what-is-litmus">documentation</a>. Cheers✌🏼</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9eb838b8326" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/understanding-user-management-and-authentication-in-litmuschaos-e9eb838b8326">Understanding User Management and Authentication in LitmusChaos</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run Azure Instance Stop Experiment in LitmusChaos]]></title>
            <link>https://medium.com/litmus-chaos/how-to-run-azure-instance-stop-experiment-in-litmuschaos-63ae3bcdb9ad?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/63ae3bcdb9ad</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[azure-kubernetes-service]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[litmus]]></category>
            <dc:creator><![CDATA[Akash Shrivastava]]></dc:creator>
            <pubDate>Thu, 19 Aug 2021 11:40:16 GMT</pubDate>
            <atom:updated>2022-08-22T09:52:43.068Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5MRbsyEFH9jnrmlRNpU8g.png" /></figure><p>This article is a guide for setting up and running the Azure Instance Stop experiment on LitmusChaos 2.0. The experiment causes the power off of one or more azure instance(s) for a certain chaos duration and then powers them on. The broad objective of this experiment is to extend the principles of cloud-native chaos engineering to non-Kubernetes targets while ensuring resiliency for all kinds of targets, as a part of a single chaos workflow for the entirety of a business.</p><h3>Pre-Requisites</h3><p>To run this experiment, we need a few things beforehand</p><ol><li>An Azure account</li><li>A Virtual Machine Scale Set (or an Instance only)</li><li>A Kubernetes cluster with LitmusChaos 2.0 installed (you can follow this blog to set up LitmusChaos 2.0 on AKS — <a href="https://medium.com/litmus-chaos/litmus-in-aks-f8838cfc551f"><em>Getting Started with LitmusChaos 2.0 in Azure Kubernetes Service</em></a>)</li></ol><h3>Setting up Azure Credentials as Kubernetes Secret</h3><p>To let LitmusChaos access your Azure instances, you need to set up the azure credentials as a Kubernetes secret. It is a very simple process, first, you need to install Azure CLI (if you already haven’t) and log in to it. Now run this command to get the azure credentials saved in an <em>azure.auth</em> file.</p><pre>az ad sp create-for-rbac — sdk-auth &gt; azure.auth</pre><p>Next, create a<em> secret.yaml</em> file with the following content. Change the content inside <em>azure.auth </em>with the contents inside your <em>azure.auth</em> file</p><pre>apiVersion: v1<br>kind: Secret<br>metadata:<br>  name: cloud-secret<br>type: Opaque<br>stringData:<br>  azure.auth: |-<br>    {<br>      &quot;clientId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;clientSecret&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;subscriptionId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;tenantId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;activeDirectoryEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;resourceManagerEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;activeDirectoryGraphResourceId&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;sqlManagementEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;galleryEndpointUrl&quot;: &quot;XXXXXXXXX&quot;,<br>      &quot;managementEndpointUrl&quot;: &quot;XXXXXXXXX&quot;<br>    }</pre><p>Now run the following command. Remember to change the namespace if you have installed LitmusChaos in any other namespace</p><pre>kubectl apply -f secret.yaml -n litmus</pre><h3>Updating ChaosHub</h3><p>As the experiment is only available as a technical preview right now, we will have to update the ChaosHub to use the technical preview (master) branch.</p><p>Login to the Chaos Center and go to the ChaosHub section, select MyHub there and click on Edit Hub</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hlqxOFLnlZ_9b3uZ-IPpsw.png" /></figure><p>Now change the branch to “master”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZiNzR4eL8ku4iIh8myObjQ.png" /></figure><p>Click on Submit Now and the ChaosHub will now show the Azure Instance Stop experiment.</p><h3>Scheduling the Experiment Workflow</h3><p>Now move to the Workflows section and click on Schedule a Workflow. Select the Self-Agent (or any other one if you have multiple agents installed) and click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSTrvNK3GYDg3Qp5siCnDg.png" /></figure><p>Select the third option to create a workflow from experiments using ChaosHub. Click on Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0E5BalV9CQWFTqCkEz8Wyw.png" /></figure><p>Click Next again (or edit the workflow name if you want to) and now on the Experiments page, click on Add a new Experiment and select the Azure Instance Stop experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gD3kIvUsyz9WuWSjKhbnQ.png" /></figure><p>Next click on Edit YAML, you will now have to add the Instance Name(s) and Resource Group name in the ChaosEngine environments. Scroll down to the ChaosEngine artefacts, where you will see the environment variables, and set the values accordingly. If you are injecting chaos on a Scale Set, set the SCALE_SET to “enable”. Save the changes and schedule your workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTfE1yOBIQxSjIgLcJ8rIA.png" /></figure><p><strong>Note</strong>: You need to provide the instance name from the Virtual Machine Scale Set section for Azure AKS nodes, not from the AKS node pools section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8upszlv4RP-5cmR6MWeMjg.png" /><figcaption>Azure Virtual Machine Scale Set Instances section</figcaption></figure><h3>Observing the Experiment Run</h3><p>Great, now your workflow is running and you can check it out, click on Go to Workflow and then select your workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4SXDitLKyJGsqM1QInxf0A.png" /></figure><p>You can check the status of your instance in the Azure Portal to verify that the experiment is working as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kfd4MGH0FL8Gmofy3D6d0g.png" /></figure><p>You can also click on azure-instance-stop to view the experiment logs. After the given chaos duration, the experiment will automatically power on the instance(s) to give a pass/fail verdict. In case the experiment fails, verify through the logs and portal that the instances have started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VqdyLQ69YTSFS5qR5UbqoQ.png" /></figure><p>This was it, you have successfully run the Azure Instance Stop experiment using LitmusChaos 2.0 Chaos Center.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b62g91Uq8utVzZkug6mCzA.png" /></figure><p>In this blog, we saw how we can perform the Azure Instance Stop experiment using LitmusChaos 2.0. You can learn more about this experiment from the <a href="https://litmuschaos.github.io/litmus/experiments/categories/azure/azure-instance-stop/">docs</a>. This experiment is one of the many experiments Non-Kubernetes experiments in LitmusChaos, including experiments for AWS, GKS, and VMWare, which are targeted toward making Litmus an absolute Chaos Engineering toolset for every enterprise regardless of the technology stack used.</p><p>You can join the LitmusChaos community on <a href="https://github.com/litmuschaos/litmus"><em>Github</em></a><em> </em>and <a href="https://www.notepadonline.org/wmtBaRICHQ"><em>Slack</em></a>. The community is very active and tries to solve queries quickly.</p><p>I hope you enjoyed this journey and found the blog interesting. You can leave your queries or suggestions (appreciation as well) in the comments below.</p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! 🙏</p><p>Thank you for reading</p><p>Akash Shrivastava</p><p>Software Engineer at Harness</p><p><a href="https://www.linkedin.com/in/avaakash/">Linkedin </a>| <a href="https://github.com/avaakash">Github </a>| <a href="https://instagram.com/avaakash">Instagram </a>| <a href="https://twitter.com/_avaakash_">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63ae3bcdb9ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/how-to-run-azure-instance-stop-experiment-in-litmuschaos-63ae3bcdb9ad">How to run Azure Instance Stop Experiment in LitmusChaos</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GCP VM Disk Loss Experiment for LitmusChaos]]></title>
            <link>https://medium.com/litmus-chaos/gcp-vm-disk-loss-experiment-for-litmuschaos-881e8edcc4b5?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/881e8edcc4b5</guid>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <dc:creator><![CDATA[Neelanjan Manna]]></dc:creator>
            <pubDate>Sun, 25 Jul 2021 14:59:29 GMT</pubDate>
            <atom:updated>2021-08-13T11:32:56.745Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BfGgphZRr5SJqWm0kQf9Ag.png" /></figure><p>In this beginner-friendly blog, we’ll be going through the GCP VM Disk Loss experiment for LitmusChaos. GCP VM Disk Loss experiment causes detachment of a non-boot persistent storage disk from a GCP VM instance for a specified duration of time and later re-attaches the disk to its respective VM instance. The broad objective of this experiment is to extend the principles of cloud-native chaos engineering to non-Kubernetes targets while ensuring resiliency for all kinds of targets, be it Kubernetes or non-Kubernetes ones, as a part of a single chaos workflow for the entirety of a business.</p><p>At the time of writing this blog, the experiment is available only as a technical preview in the chaos hub, but in the upcoming releases, the experiment will surely become an integral part of the chaos hub. That being said, we can still access and execute the experiment without any problem, as I am about to show you in this blog.</p><h3>Pre-Requisites</h3><p>Before we begin with the steps of the experiment, let’s check the pre-requisites for performing this experiment:</p><ol><li>A GCP project containing the target Persistent Storage Disks attached to their respective VM instances</li><li>A GCP Service Account having project level Editor or Owner permissions</li><li>A Kubernetes cluster with Litmus 2.0 installed</li></ol><h3>STEP 1: Updating The Chaos Hub</h3><p>Browse and log in to your Chaos Center. You should be on the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzLBHmn3oBPVgI5h4Y2TPA.png" /></figure><p>Select ChaosHubs. Here you’d be able to see the default Chaos Hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sWZo_yfY7kXhe9trvel16w.png" /></figure><p>Choose to Edit the default Chaos Hub and instead of the v1.13.x branch, choose the master branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AfHG59P1SNOYqE5sFHUmIQ.png" /></figure><p>Click Submit Now. Now you’d be able to access all the experiments, even those under the technical preview. To confirm that the experiments have been added successfully, click on Chaos Hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sb5sIOS1NN0P96urC5rbGA.png" /></figure><p>You should see the GCP Experiments listed here. Now we are all set to begin the steps of the experiment.</p><h3>STEP 2: Setting Up the Chaos Experiment</h3><p>We’d be using the <a href="https://docs.litmuschaos.io/docs/next/gcp-vm-disk-loss/">experiment docs</a> to help us with a few steps.</p><p>In this demo, we will inject chaos into two non-boot persistent storage disks named test-disk and test-disk-1, attached to the VM instances named test-instance and test-instance-1 respectively, the disks are located in the zones us-central1-a and us-central1-b respectively, and belong to the GCP project “Litmus GCP Instance Delete” with the ID of litmus-gcp-instance-delete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBRTDWgbD90b8FEcPvbCPg.png" /></figure><p>Please notice that both the disks are initially attached to their respective VM instances, before the injection of the chaos. Now that we have our disks ready, we can set up our experiment. Before scheduling the chaos experiment, we need to make the GCP Service Account credentials available to Litmus, so that the instances can be shut down and later started as part of the experiment. To do that, we’ll make a Kubernetes secret named secret.yaml as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb4705fc5d57c09542465fbd222c94d3/href">https://medium.com/media/fb4705fc5d57c09542465fbd222c94d3/href</a></iframe><p>The format of this secret is also available in the experiment docs. Make sure the name of the secret is cloud-secret and replace the respective fields of the secret with your own service account credentials. Once done, apply the secret in the litmus namespace using the command:</p><pre>kubectl apply -f secret.yaml -n litmus</pre><p>Once the secret is applied, we’re all set to schedule our experiment from the Chaos . In Dashboard, click on the Schedule a Workflow button. In the workflow creation page, choose the self-agent and click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DdkclS0Y02bz1xjz8lMOA.png" /></figure><p>In the Choose a Workflow page, select “Create a new workflow using the experiments from MyHub” and select Chaos Hub in the dropdown. Then click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAjvh0O642_JMYPS-DZENQ.png" /></figure><p>In the Workflow Settings page, fill in the workflow name and description of your choice. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bi2b0I80dkeqOXt5U41s1A.png" /></figure><p>In the Tune Workflow page, click on “Add a new experiment” and choose gcp/gcp-vm-disk-loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kdtzLJI2m47GPOHI_7n1A.png" /></figure><p>Click Done. Notice that the experiment has been added to the experiment graph diagram. Now click on “Edit YAML”. Here we will edit the workflow manifest to specify the experiment resource details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZlVE5sJhUdJXsk7_oq61Rg.png" /></figure><p>Scroll down to the manifest of the ChaosExperiment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2BRfKJPwPffHD07dCxZsQA.png" /></figure><p>Notice that the name of the secret that we had previously created is being passed to the ChaosExperiment to be mounted at the path /tmp/.</p><p>Scroll further down and similarly fill in the relevant experiment details in the manifest of the ChaosEngine as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FcyyleBaKJ8eXVxQEdLCig.png" /></figure><p>Please take note that the zone for each target disk is to be mentioned in DISK_ZONES in the same order of the DISK_VOLUME_NAMES. Similarly, the device name for each target disk is to be mentioned in DEVICE_NAMES in the same order of the DISK_VOLUME_NAMES. If you like, feel free to modify the parameters of the experiment such as the RAMP_TIME, TOTAL_CHAOS_DURATION, etc. As you would have noticed, some of the experiment tunables are common for both the ChaosEngine and ChaosExperiment, and the values of ChaosExperiment get overridden by that of the values of the ChaosEngine if they differ in both the manifests. Once you have made the changes, click Save Changes. We’ve now specified all the experiment details and are ready to go to the next step. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jXXQ420X5fK2NmDitWI11Q.png" /></figure><p>In the Reliability Score, we will use the default score of 10. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zfbXioIzq1nGgyF0K-B-vA.png" /></figure><p>In Schedule, click Schedule Now. Click Next. On the Verify and Commit page verify all the details and once satisfied click on Finish. We’ve successfully scheduled our chaos experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZ5-XUjx8nZjpRNs67psGA.png" /></figure><h3>STEP 3: Observing the Chaos</h3><p>Click on Go to Workflow and choose the workflow that we just created. Here we can observe the different steps of the workflow execution including chaos experiment installation, chaos injection, and chaos revert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eMRH-6hpqbJ_ZlMgjqgxAg.png" /></figure><p>You can also determine if the chaos injection has taken place and as a result, the disks have detached from their respective VM instances or not from the GCP Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nb9qvAB1uTvS-GVTacpOdw.png" /></figure><p>We can also view the Table View for the experiment logs as the experiment proceeds through the various steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EBQSQjagHjap2C6l-YvRZA.png" /></figure><p>Once completed, the workflow graph should have executed all the steps successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZhvkkeL44CNfNO-mHugnkw.png" /></figure><p>We have got a 100% Resiliency Score. We can also check the ChaosResult verdict which should say the experiment has passed. The Probe Success Percentage should be 100% as all our disks re-attached successfully post their detachment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g9isFtuKIk9qfZYKAQbfSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWmNH990s7OSZYLR64lifw.png" /></figure><p>Again you can check in the GCP console if the disks have been re-attached or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TVypKu_2hSIciXq5WpSimQ.png" /></figure><p>We can also perform post chaos analysis for the experiment results in the Analytics section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WKX3vfjSJp3S-GuQCT1OmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFoI_6KZMePZRlG2LWbX1w.png" /></figure><p>In conclusion of this blog, we saw how we can perform the GCP VM Disk Loss chaos experiment using Litmus Chaos 2.0. This experiment is only one of the many experiments for the Non-Kubernetes experiments in LitmusChaos, including experiments for AWS, Azure, VMWare, and many more, which are targeted towards making Litmus an absolute Chaos Engineering toolset for every enterprise regardless of the technology stack used by them.</p><p>Come join me at the Litmus community to contribute your bit in developing chaos engineering for everyone. To join the Litmus community:<br><strong>Step 1:</strong> Join the Kubernetes slack using the following link: https://slack.k8s.io/<br><strong>Step 2:</strong> Join the #litmus channel on the Kubernetes slack or use this link after joining the Kubernetes slack: <a href="https://slack.litmuschaos.io/">https://slack.litmuschaos.io/</a></p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=881e8edcc4b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/gcp-vm-disk-loss-experiment-for-litmuschaos-881e8edcc4b5">GCP VM Disk Loss Experiment for LitmusChaos</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GCP VM Instance Stop Experiment for LitmusChaos]]></title>
            <link>https://medium.com/litmus-chaos/gcp-vm-instance-stop-experiment-for-litmuschaos-3ea5b58266b2?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/3ea5b58266b2</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[litmuschaos]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Neelanjan Manna]]></dc:creator>
            <pubDate>Sat, 24 Jul 2021 10:46:37 GMT</pubDate>
            <atom:updated>2021-08-13T11:51:06.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CP6mn8x8Jcozi1ssvID16w.png" /></figure><p>This blog is a beginner-friendly guide for the GCP VM Instance Stop chaos experiment for LitmusChaos. The experiment causes the shutdown of one or more GCP VM instances for a specified duration of time and later restarts them. The broad objective of this experiment is to extend the principles of cloud-native chaos engineering to non-Kubernetes targets while ensuring resiliency for all kinds of targets, be it Kubernetes or non-Kubernetes ones, as a part of a single chaos workflow for the entirety of a business.</p><p>At the time of writing this blog, the experiment is available only as a technical preview in the chaos hub, but in the upcoming releases, the experiment will surely become an integral part of the chaos hub. That being said, we can still access and execute the experiment without any problem, as I am about to show you in this blog.</p><h3>Pre-Requisites</h3><p>Before we begin with the steps of the experiment, let’s check the pre-requisites for performing this experiment:</p><ol><li>A GCP project containing the target VM instances</li><li>A GCP Service Account having sufficient permissions to stop or start the VM Instances</li><li>A Kubernetes cluster with Litmus 2.0 installed</li></ol><h3>STEP 1: Updating The Chaos Hub</h3><p>Browse and log in to your Litmus portal. You should be on the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UT3U9G55m954-R7zArDA4w.png" /></figure><p>Select ChaosHubs. Here you’d be able to see the default ChaosHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*elFfaTBr6HQsurUKzSS97A.png" /></figure><p>Choose to Edit the default Chaos Hub and instead of the v1.13.x branch, choose the master branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHx_njzV2zVPFSdUs58Kig.png" /></figure><p>Click Submit Now. Now you’d be able to access all the experiments, even those under the technical preview. To confirm that the experiments have been added successfully, click on Chaos Hub and view the Chaos Hub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRvEuqOBjPO9RhN42UaeTw.png" /></figure><p>You should see the GCP Experiments listed here. Now we are all set to begin the steps of the experiment.</p><h3>STEP 2: Setting Up the Chaos Experiment</h3><p>We’d be using the <a href="https://docs.litmuschaos.io/docs/next/gcp-vm-instance-stop/">experiment docs</a> to help us with a few steps.</p><p>In this demo, we will inject chaos into two VM instances named test-instance and test-instance-1, belonging to the zones us-central1-a and us-central1-b respectively, belonging to the GCP project “Litmus GCP Instance Delete” with the ID of litmus-gcp-instance-delete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZW_7AW1lkJmL_SBUud6hWg.png" /></figure><p>Please notice that the instances are in a running state initially, before the injection of the chaos. Now that we have our instances ready, we can set up our experiment. Before scheduling the chaos experiment, we need to make the GCP Service Account credentials available to Litmus, so that the instances can be shut down and later started as part of the experiment. To do that, we’d make a Kubernetes secret named secret.yaml as follows:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb4705fc5d57c09542465fbd222c94d3/href">https://medium.com/media/fb4705fc5d57c09542465fbd222c94d3/href</a></iframe><p>The format of this secret is also available in the experiment docs. Make sure the name of the secret is cloud-secret and replace the respective fields of the secret with your own service account credentials. Once done, apply the secret in the litmus namespace using the command:</p><pre>kubectl apply -f secret.yaml -n litmus</pre><p>Once the secret is applied, we’re all set to schedule our experiment from the Litmus portal. In Dashboard, click on the Schedule a Workflow button. In the workflow creation page, choose the self-agent and click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eCVsGdY8JROEB-IYVYVSXw.png" /></figure><p>In the Choose a Workflow page, select “Create a new workflow using the experiments from MyHub” and select Chaos Hub in the dropdown. Then click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6nni9DM8-2pqz7inMG47g.png" /></figure><p>In the Workflow Settings page, fill in the workflow name and description of your choice. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-UQS5xX90d92gc_8bka7g.png" /></figure><p>In the Tune Workflow page, click on “Add a new experiment” and choose gcp/gcp-vm-instance-stop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JCcExdUwirihZag-VLK_g.png" /></figure><p>Click Done. Notice that the experiment has been added to the experiment graph diagram. Now click on “Edit YAML”. Here we will edit the workflow manifest to specify the experiment resource details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_5K1OSQd8qaD4XIAdvL5Q.png" /></figure><p>Scroll down to the manifest of the ChaosExperiment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zZUP9MHRG7rwpYlCpPFzWg.png" /></figure><p>Notice that the name of the secret that we had previously created is being passed to the ChaosExperiment to be mounted at the path /tmp/.</p><p>Scroll further down and similarly fill in the relevant experiment details in the manifest of the ChaosEngine as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1KKPZpITbIIVBsb1KNnAw.png" /></figure><p>Please take note that the zone for each target instance is to be mentioned in INSTANCE_ZONES in the same order of the VM_INSTANCE_NAMES. If you like, feel free to modify the other parameters of the experiment such as the RAMP_TIME, TOTAL_CHAOS_DURATION, etc. As you would have noticed, some of the experiment tunables are common for both the ChaosEngine and ChaosExperiment, and the values of ChaosExperiment get overridden by that of the values of the ChaosEngine if they differ in both the manifests. Once done, click Save Changes. We’ve now specified all the experiment details and are ready to go to the next step. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3eGS4zuAPeKoFpQ_8oRvGQ.png" /></figure><p>In the Reliability Score, we will use the default score of 10. Click Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0bVb55ABK6yDB-Y6StswA.png" /></figure><p>In Schedule, click Schedule Now. Click Next. On the Verify and Commit page verify all the details and once satisfied click on Finish. We’ve successfully scheduled our chaos experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SPEcwOC1gxAgVwV0v_S_wQ.png" /></figure><h3>STEP 3: Observing the Chaos</h3><p>Click on Go to Workflow and choose the workflow that we just created. Here we can observe the different steps of the workflow execution including chaos experiment installation, chaos injection, and chaos revert.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*taXCcBA8SEL_hkag6JmxSQ.png" /></figure><p>You can also determine if the chaos injection has taken place and as a result, the instances have shutdown or not from the GCP Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cIvwN6J7tDpJn5RCuPGfNA.png" /></figure><p>We can also view the Table View for the experiment logs as the experiment proceeds through the various steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GMeQ_JdSEEi3SRDlLrfooA.png" /></figure><p>Once completed, the workflow graph should have executed all the steps successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wFb7HH-ipZ3uVdRI76ebTA.png" /></figure><p>We can also check the ChaosResult verdict which should say the experiment has passed. The Probe Success Percentage should be 100% as all our instances restarted successfully post their shutdown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5t5gUjMyQEnXn4gU6hRAA.png" /></figure><p>Again you can check in the GCP console if the instances have restarted or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CPdg-cOiVjpNwW0JsZDxqA.png" /></figure><p>We can also perform post chaos analysis for the experiment results in the Analytics section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8CV_uEUlWSr6-XTuBRn-4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*htQFa1oWJHtmPFHIU890Cg.png" /></figure><p>In conclusion of this blog, we saw how we can perform the GCP VM Instance Stop chaos experiment using Litmus Chaos 2.0. This experiment is only one of the many experiments for the Non-Kubernetes experiments in LitmusChaos, including experiments for AWS, Azure, VMWare, and many more, which are targeted towards making Litmus an absolute Chaos Engineering toolset for every enterprise regardless of the technology stack used by them.</p><p>Come join me at the Litmus community to contribute your bit in developing chaos engineering for everyone. To join the Litmus community:<br><strong>Step 1:</strong> Join the Kubernetes slack using the following link: https://slack.k8s.io/<br><strong>Step 2:</strong> Join the #litmus channel on the Kubernetes slack or use this link after joining the Kubernetes slack: <a href="https://slack.litmuschaos.io/">https://slack.litmuschaos.io/</a></p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ea5b58266b2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/gcp-vm-instance-stop-experiment-for-litmuschaos-3ea5b58266b2">GCP VM Instance Stop Experiment for LitmusChaos</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Litmus 2.0 in Azure Kubernetes Service]]></title>
            <link>https://medium.com/litmus-chaos/litmus-in-aks-f8838cfc551f?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/f8838cfc551f</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[litmuschaos]]></category>
            <dc:creator><![CDATA[Akash Shrivastava]]></dc:creator>
            <pubDate>Fri, 23 Jul 2021 06:55:02 GMT</pubDate>
            <atom:updated>2022-08-22T09:51:36.689Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with LitmusChaos 2.0 in Azure Kubernetes Service</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DlUcR3cUAasfsbsGZLXfGw.png" /></figure><p>This is a quick tutorial on how to get started with LitmusChaos 2.0 in Azure Kubernetes Services. We will first create an AKS Cluster, followed by Installing LitmusChaos 2.0 on the cluster and then executing a simple pre-defined chaos workflow using LitmusChaos.</p><h3>What is LitmusChaos</h3><p>LitmusChaos is a toolset to do cloud-native chaos engineering. It provides tools to orchestrate chaos on Kubernetes to help SREs find weaknesses in their deployments. SREs use Litmus to run chaos experiments initially in the staging environment and eventually in production to find bugs, vulnerabilities. Fixing the weaknesses leads to increased resilience of the system.</p><p>Litmus takes a cloud-native approach to create, manage and monitor chaos. Chaos is orchestrated using the following Kubernetes Custom Resource Definitions (CRDs):</p><ul><li>ChaosEngine: A resource to link a Kubernetes application or Kubernetes node to a ChaosExperiment. ChaosEngine is watched by Litmus’ Chaos-Operator which then invokes Chaos-Experiments</li><li>ChaosExperiment: A resource to group the configuration parameters of a chaos experiment. ChaosExperiment CRs are created by the operator when experiments are invoked by ChaosEngine.</li><li>ChaosResult: A resource to hold the results of a chaos experiment. The Chaos-exporter reads the results and exports the metrics into a configured Prometheus server.</li></ul><p>For more information, you can visit <a href="https://litmuschaos.io/">litmuschaos.io</a> or <a href="https://github.com/litmuschaos/litmus">github.com/litmuschaos/litmus</a></p><h3>Pre-Requisites</h3><ol><li>Azure CLI — <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt"><em>How to install on Linux/Debian</em></a></li><li>kubectl — <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt"><em>How to install on Linux</em></a></li></ol><p>If you feel lazy to install them, you can always use the Azure Cloud Shell, it already has the tools installed.</p><h3>Creating an AKS Cluster</h3><p>The first step to installing LitmusChaos on an AKS Cluster is to have an AKS Cluster. So let’s do that. Open <a href="http://portal.azure.com/">Azure Portal</a> and then log in with your account. You will be presented with the home screen. Now search for <strong>Kubernetes services </strong>and open it.</p><p>To create a cluster, click on create <strong>Create </strong>option in the menu and then select <strong>Create a Kubernetes cluster</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h9kw-ws6wDlHGtV7TkXRYg.png" /><figcaption>Creating an AKS Cluster</figcaption></figure><p>Now you have to fill in details about what kind of cluster you want to create. Since Azure doesn’t charge for cluster management, you will only have to pay for the Node Instance you will be running. Fill in the name of the cluster, it can be anything, also create a new <strong>Resource Group</strong> if you haven’t. You can keep other settings as it is, or if you know what they do, can change it according to your need. For the <strong>Node Pool</strong>, select a <strong>B2ms</strong> size that has 2 vCPUs and 8 GiB of RAM and set the <strong>Node Count</strong> to 1 as we only want to run LitmusChaos, this will suffice for it. Although you are free to choose your configuration, keeping a minimum of 2 vCPUs and 8 GiB of RAM will help in seamless running. Remember to check that the <strong>Scale Method</strong> is set to <strong>Manual</strong> to keep a check on the cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SzMPXjljSkLQzPSMHOcqbA.png" /><figcaption>Configuring AKS cluster</figcaption></figure><p>You can skip the rest of the configurations for now and directly click on <strong>Review+Create </strong>which will start the creation of Cluster. It will take around 5–10 minutes, so you can sit back for some time, grab a glass of water, also read about <a href="https://medium.com/litmus-chaos/a-beginners-practical-guide-to-containerisation-and-chaos-engineering-with-litmuschaos-2-0-5f4f3cf2a55d">ChaosEngineering </a>and <a href="https://medium.com/litmus-chaos/litmus-2-0-simplifying-chaos-engineering-for-enterprises-5c3d73ca98d6">LitmusChaos 2.0</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUNFk5h6zYawvAcI1DBY7w.png" /><figcaption>AKS Cluster Deployment in Progress</figcaption></figure><p>The cluster is ready and you can now install LitmusChaos on it. You can use the Azure Cloud Shell or your local system terminal to connect to the Cluster, the steps are the same for both. I personally prefer using my local system so I will use that for this tutorial.</p><h3>Connecting to AKS Cluster</h3><p>Open your cluster and click on the <strong>Connect</strong> button, this will show you two commands to run. Copy the two commands and run them one by one. The first command sets the account as per the subscription id provided, and the second command fetches the credentials for the specific resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxonYx2a6J5J9MLktD_gDg.png" /><figcaption>Connecting to AKS Cluster</figcaption></figure><h3>Installing LitmusChaos</h3><p>Now you have the credentials to access the Cluster, you can go ahead and install LitmusChaos 2.0 and do some chaos. For installation, I will be following their <a href="https://litmusdocs-beta.netlify.app/docs/litmus-install-namespace-mode"><em>docs</em></a><em>. </em>There are two ways to install, one is by using helm, other is by applying the manifest file. I will follow the helm repo procedure, you can follow the other one if you want by going through their docs.</p><p>Note: You will need to have Helm installed on your system. You can refer from <a href="https://helm.sh/docs/intro/install/"><em>here</em></a></p><p>First, you will add the LitmusChaos Helm repository and then confirm that litmuschaos is present in the helm repository</p><pre>helm repo add litmuschaos <a href="https://litmuschaos.github.io/litmus-helm/">https://litmuschaos.github.io/litmus-helm/</a><br>helm repo list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gm_0I5EqW6peY8pHvwjQ9g.png" /><figcaption>Adding litmus to helm repo</figcaption></figure><p>Next, you will create the namespace, by default we use <em>litmus </em>as the namespace name, you are allowed to use any name of your choice, just remember to change it in the following commands.</p><pre>kubectl create ns litmus </pre><p>Now, let’s install LitmusChaos using the helm repository you just added.</p><pre><em>helm install chaos litmuschaos/litmus-2–0–0-beta --namespace=litmus --devel --set portalScope=namespace</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkvbH9r8MY2i5fFrEpZgpQ.png" /><figcaption>Creating litmus namespace and installing LitmusChaos</figcaption></figure><p><strong>Note:</strong> If you are using helm2, you will have to run this command</p><pre>helm install --name chaos litmuschaos/litmus-2–0–0-beta --namespace=litmus --devel --set portalScope=namespace</pre><p><strong>The final step is to install the LitmusChaos CRDs</strong></p><pre>kubectl apply -f <a href="https://raw.githubusercontent.com/litmuschaos/litmus/master/litmus-portal/litmus-portal-crds.yml">https://raw.githubusercontent.com/litmuschaos/litmus/master/litmus-portal/litmus-portal-crds.yml</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fy84STDtY3dNoqtYZiwo3A.png" /><figcaption>Installing LitmusChaos CRDs</figcaption></figure><p>Let’s verify that all the services are running, and there has been no issue</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b84Y9wmPt7tagfYYtdCKTw.png" /><figcaption>LitmusChaos Services</figcaption></figure><p>The services are running properly but there is one more change that you need to do, since AKS doesn’t provide public-IP to nodes by default, we need to change the <strong>litmusportal-frontend-service</strong> to a LoadBalancer service. You can do that by editing the service.</p><pre>kubectl edit svc litmusportal-frontend-service -n litmus</pre><p>At the very end inside <strong>spec </strong>there is <strong>type: NodePort</strong>, you have to change it to <strong>type: LoadBalancer</strong></p><pre>spec:<br> clusterIP: xxxxxxx<br> externalTrafficPolicy: Cluster<br> ports:<br> — name: http<br> nodePort: xxxxx<br> port: 9091<br> protocol: TCP<br> targetPort: 8080<br> selector:<br> app.kubernetes.io/component: litmus-2–0–0-beta-frontend<br> sessionAffinity: None<br> <strong># Change the type here from NodePort to LoadBalancer</strong><br> <strong>type: LoadBalancer</strong></pre><p>Then save it, and list the services again. The External-IP might show pending for a minute, run the command again after a minute to get the IP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ob9_4b8bKYKuJcWkQadV1A.png" /><figcaption>LitmusChaos Services</figcaption></figure><pre>&lt;external-ip&gt;:9091</pre><p>Change the &lt;external-ip&gt; with what is showing to you for the <em>litmusportal-frontend-service</em> and then visit the address in your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XK14XCer0Qtl9c2tePIYrA.png" /><figcaption>LitmusChaos Portal sign-in page</figcaption></figure><p>Ta-da! We are done with the installation of LitmusChaos 2.0 and now you can run a workflow. Login to the portal, the default credentials are</p><pre>username: admin<br>password: litmus</pre><p>It will ask you to set a new password, and then log in to the dashboard.</p><p><strong>Note</strong>: Other than changing the frontend service to LoadBalancer, there is another way to make it work with NodePort by enabling public IP for individual nodes. I have not covered it in this article, but feel free to check it out <a href="https://docs.microsoft.com/en-in/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools"><em>here</em></a><em>.</em></p><h3>Running Chaos Workflows</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5KPAt6av4N2PnsODJGBSQw.png" /><figcaption>LitmusChaos Portal Dashboard Page</figcaption></figure><p>Let’s see some chaos happening now. LitmusChaos comes with few predefined workflows, which setups a service and then wreak havoc in them. We will be running a podtato-head workflow, which creates a simple deployment and then injects the pod-delete experiment into it.</p><p>On the dashboard select <strong>Schedule a Workflow</strong>. In the Workflows dashboard, select the <strong>Self-Agent </strong>and then click on <strong>Next</strong>. In the next screen, select <strong>Create a Workflow from Pre-defined Templates </strong>and then select <strong>podtato-head </strong>and then click on <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKXGW8MXmSyIyVAPdSeRLg.png" /><figcaption>Scheduling a podtato-head template-based workflow</figcaption></figure><p>On the next screen, you can define the <strong>Experiment name, description, and namespace,</strong> leave the default values and click on <strong>Next</strong>.</p><p>On this screen, you can tune the workflow by editing the experiment manifest and adding/removing or arranging the experiments in the workflow. The podtato-head template comes with its own defined workflow so simply click on <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E07spTCnDse0VO6t4lOd_g.png" /><figcaption>Tuning the Workflow</figcaption></figure><p>The next screen is to adjust the weights of the experiment on the reliability score since you are running only one experiment, you can keep any value, in the case where you have multiple experiments running, you can set the importance of each experiment according to your requirements to get a meaningful reliability score. For now, click on <strong>Next </strong>and select <strong>Schedule now</strong>, you can also create a recurring schedule if you want the experiment to keep running at certain intervals. The final screen is to confirm the workflow and schedule it. Click on <strong>Finish </strong>to run the workflow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L0kD_aMV1LnyGFjnqwiY3A.png" /><figcaption>Workflow created</figcaption></figure><p>Yay! The workflow is created and is running now. Click on <strong>Go to Workflow</strong>, which will take you to the workflow screen, here you can see all your scheduled workflows. Click on the workflow to see its status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtaormuGUIfTNQKu4sBLGQ.png" /><figcaption>Workflow Dashboard Page</figcaption></figure><p>The workflow will take some minutes to run, you can take a break until then. Meanwhile, you can join the <a href="https://www.notepadonline.org/wmtBaRICHQ">LitmusChaos community on slack</a> to stay updated with new releases and get help from the community.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wh-RJbU5tKcRIiLem-29Q.png" /><figcaption>Workflow Dashboard for the podtato-head workflow</figcaption></figure><p>The workflow run is now complete, you can access the workflow details using the graph view or the table view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EaKUgRHo_lTFfnvefTzGQ.png" /><figcaption>Workflow Completed Graph View</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-buEbomJwEcjbnvoCOkbA.png" /><figcaption>Workflow Completed Table View</figcaption></figure><p>Click on <strong>View Logs &amp; Results</strong> to check out the logs and chaos results for the experiment</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-xSomN9TqmTwu1qh1chZTA.png" /><figcaption>Experiment Logs and Results</figcaption></figure><p>And we are done. You were able to create an AKS Cluster, install LitmusChaos 2.0 on it, log in to the LitmusChaos Portal and then finally schedule a Workflow.</p><p>You can join the LitmusChaos community on <a href="https://github.com/litmuschaos/litmus"><em>Github</em></a><em> </em>and <a href="https://www.notepadonline.org/wmtBaRICHQ"><em>Slack</em></a>. The community is very active and tries to solve queries quickly.</p><p>I hope you enjoyed this journey and found the blog interesting. You can leave your queries or suggestions (appreciation as well) in the comments below.</p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! 🙏</p><p>Thank you for reading</p><p>Akash Shrivastava</p><p>Software Engineer at Harness</p><p><a href="https://www.linkedin.com/in/avaakash/">Linkedin </a>| <a href="https://github.com/avaakash">Github </a>| <a href="https://instagram.com/avaakash">Instagram </a>| <a href="https://twitter.com/_avaakash_">Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8838cfc551f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/litmus-in-aks-f8838cfc551f">Getting Started with Litmus 2.0 in Azure Kubernetes Service</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Litmus 2.0 in Google Kubernetes Engine]]></title>
            <link>https://medium.com/litmus-chaos/getting-started-with-litmus-2-0-in-google-kubernetes-engine-42dddb264a12?source=rss----2e2aae676db---4</link>
            <guid isPermaLink="false">https://medium.com/p/42dddb264a12</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[chaos-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Neelanjan Manna]]></dc:creator>
            <pubDate>Tue, 06 Jul 2021 13:24:52 GMT</pubDate>
            <atom:updated>2021-08-13T11:03:49.351Z</atom:updated>
            <content:encoded><![CDATA[<h3>Getting Started with LitmusChaos 2.0 in Google Kubernetes Engine</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jjV-3SHxwdzSamjcI4aEyg.png" /></figure><p>This is a quick tutorial on how to get started with Litmus 2.0 in Google Kubernetes Engine. We’ll first set up our basic GKE cluster throughout this blog, then install Litmus 2.0 in the cluster, and finally, execute a simple chaos workflow using Litmus.</p><p>But before we kick off the demonstration, let’s have a brief introduction to Litmus. <a href="https://litmuschaos.io/">Litmus</a> is a toolset to perform cloud-native Chaos Engineering. It provides tools to orchestrate chaos on Kubernetes to help developers and SREs find weaknesses in their application deployments. Litmus can be used to run chaos experiments initially in the staging environment and eventually in production to find bugs, vulnerabilities. Fixing the weaknesses leads to increased resilience of the system. Litmus adopts a “Kubernetes-native” approach to define chaos intent in a declarative manner via custom resources, although Litmus is not limited to only Kubernetes targets while injecting chaos and is able to target a plethora of non-Kubernetes targets as well, such as bare-metal infrastructure, public cloud infrastructure, hybrid cloud infrastructure, containerized services, etc. to fulfill the chaos engineering needs of an entire business, and not just a specific application microservice.</p><h3>Pre-Requisites to the Demo</h3><ol><li>A GCP project with sufficient permission for accessing GKE</li></ol><h3>Step-1: Setup the GKE Cluster</h3><p>To set up the GKE cluster, we first need to enable the Kubernetes Engine API in our GCP project. To do that, we can access the APIs &amp; Services Dashboard from the GCP console and search for the Kubernetes Engine API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2r4jdrIuLGsTW_xo1Ze5kg.png" /></figure><p>We can then enable the Kubernetes Engine API. Now we are all set to launch our GKE cluster. To do that, we will first go to the Kubernetes Engine dashboard in the GCP console and then choose to Create the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YKxtj85kPd6Xf7ew2j3ZFw.png" /></figure><p>Go for a standard cluster and choose to Configure it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivIqlysLZ3rP_2zy_reBtA.png" /></figure><p>Here you’d get all the options to configure your Kubernetes cluster. You can either choose to configure your own cluster as per your preference or you can simply go for My First Cluster option under the Cluster set-up Guide, which will set up a basic three-node cluster for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ER03wDAfQ9z4efTQ5s6g6g.png" /></figure><p>It will take a while for your cluster resources to set up and undergo a health check, after which it would finally be ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xCiLOzED8t9nEA3Tu-8nXA.png" /></figure><p>We can now connect to our cluster and proceed to install litmus. To do that, we need to choose our cluster and then choose the Connect option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVFVSZVfTMWMy2gaOnfi5A.png" /></figure><p>Next, choose the Run In Cloud Shell option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jq0Is2xIvn2eooe8oOZqrQ.png" /></figure><p>This will open up a cloud shell terminal in your console. A cloud SDK command would be already there in your terminal which you need to execute. This command will configure the Kubectl to configure itself for the cluster we just created. If prompted, choose accept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-zbtP9wSV7VcyvtXhoajQ.png" /></figure><p>Now we are all set to install Litmus.</p><h3>STEP 2: Install Litmus</h3><p>We’d follow the instructions given in the <a href="https://litmusdocs-beta.netlify.app/docs/introduction">Litmus 2.0 documentation</a> to install Litmus. Here we will be installing Litmus in namespace mode using Helm. To do that, the very first step is to add the litmus helm repository using the following command:</p><pre>helm repo add litmuschaos https://litmuschaos.github.io/litmus-helm/</pre><p>This will add litmuschaos repository to the list of Helm chart repositories. We can verify the repository using the command:</p><pre>helm repo list</pre><p>You should see litmuschaos repository listed here. Next, we will create the litmus namespace as all the litmus infra components will be placed in this namespace. We will do this using the command:</p><pre>kubectl create ns litmus</pre><p>Once this is done, we can proceed to install the Litmus control plane using the following command:</p><pre>helm install chaos litmuschaos/litmus-2-0-0-beta --namespace=litmus --devel --set portalScope=namespace</pre><p>You should get a similar message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMnOfsKCUcdTFwXEWjx_6Q.png" /></figure><p>Next, we can proceed to install the Litmus CRDs. Cluster-Admin or an equivalent user with the right permissions are required to install the CRDs. We’d use the following command to apply the CRDs:</p><pre>kubectl apply -f https://raw.githubusercontent.com/litmuschaos/litmus/master/litmus-portal/litmus-portal-crds.yml</pre><p>And we’re done with installing Litmus. Just one final step before we can access the Litmus portal. If we use the command kubectl get svc -n litmus we’ll be able to list down all the services running in the litmus namespace. Here you should be able to see the litmusportal-frontend-service and the litmusportal-server-service, both of which should be NodePort services, and their corresponding TCP ports should be something like 9091:xxxxx/TCP where xxxxx is the node port of the respective service. To access the portal, we need to expose both the node ports of the frontend service and the server service by applying a firewall rule. For the litmusportal-server-service we can expose only the first NodePort as there are two of them. We can do that using the following two commands:</p><pre>gcloud compute firewall-rules create frontend-service-rule --allow tcp:&lt;NODE_PORT&gt;</pre><pre>gcloud compute firewall-rules create server-service-rule --allow tcp:&lt;NODE_PORT&gt;</pre><p>Replace the &lt;NODE_PORT&gt; in the first command with your frontend service’s node port and similarly replace the &lt;NODE_PORT&gt; in the first command with your server service’s node port. Once done, we’re all set to access the Litmus portal. To do that, use the command kubectl get nodes -o wide to list all the pods in your cluster. You should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DOT0E1kS-kJ_aWX8Aj5j-A.png" /></figure><p>For any of the nodes, copy its external IP and paste it into your browser URL section, followed by a :xxxxx where xxxxx corresponds to your node port. You should then be directed to the Litmus home screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DKLkV01jnnjVilby6mtewA.png" /></figure><p>Log in using the username admin and password litmus. Then you’d be asked to set up a password, which you’d use for any subsequent login. Once done, you’d be able to access the Litmus portal dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WCvu2RffIvxO9tWc6ukELQ.png" /></figure><h3>Step 3: Run a Chaos Workflow</h3><p>For this demo, we’d see how do chaos workflows execute in Litmus with the help of a predefined chaos workflow template called podtato-head. <a href="https://github.com/cncf/podtato-head">podtato-head</a> is a simple microservice-based application that can be deployed in the default namespace for the purpose of this demo, in which we will try to inject pod-delete chaos.</p><p>Once the podtato-head application is deployed in the default namespace, choose Schedule a Workflow. In the workflows dashboard, choose the self agent and then choose Next. Choose the Create a Workflow option from pre-defined workflow templates and choose podtato-head.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bBmN0Fsmw5FamvJX7V7aTQ.png" /></figure><p>Choose Next. Here we can define the experiment name, description, and namespace. Leave the default values and choose Next. Here we can tune the workflow by editing the experiment manifest and adding/removing or arranging the experiments in the workflow. The podtato-head template comes with its own defined workflow so simply choose Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PZ8AkosqNIHESenfR5QAgw.png" /></figure><p>Now we can set a reliability score per chaos experiment in our workflow. Since this workflow has only pod-delete chaos experiment, we can set a score for that in between 1–10. Then choose Next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0NyrzqdjAbZsUuFPClNPw.png" /></figure><p>Here we can schedule our workflows to be executed in a determined frequency or we can simply schedule it to execute right away. Choose Schedule now. Choose Next. Here we can review the workflow details and make changes if required before finally executing the workflow. Choose Finish. You have successfully started the Chaos Workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1eiFUcOY1hnW84w5M_nnvw.png" /></figure><p>Choose Go to Workflow and you’d see the running workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fSRwcYfywGwkiCu0Kxy8Q.png" /></figure><p>Select the workflow and you’d be able to see the workflow execute in its various stages in the graphical chart:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdDu5Hxo4u7D7FgGDTBX4Q.png" /></figure><p>Wait for the workflow execution to complete, once completed the graph would appear as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Imn4mQYGRsHjHW__MLlLQ.png" /></figure><p>We can analyze the Table View tab for every step as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jQeLj-efOQ2oKn0Dy3Qfmw.png" /></figure><p>Choose View Logs &amp; Results to access the chaos result of the pod-delete experiment:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m3qvepJ0rmcSyHwjVLScFg.png" /></figure><p>You can also observe the analytics of the workflow from the workflow dashboard page which shows a graphical analysis of the workflow run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHKxARyWigg7vDnAefIH3Q.png" /></figure><p>In conclusion of this blog, we saw how to set up a Google Kubernetes Engine cluster, how to install Litmus 2.0, and finally how to execute a chaos workflow using the Litmus portal. Though this is only the tip of the iceberg, I really hope you learned something new today, which will be helpful for your further journey in chaos engineering.</p><p>Come join me at the Litmus community to contribute your bit in developing chaos engineering for everyone. To join the Litmus community: <br><strong>Step 1:</strong> Join the Kubernetes slack using the following link: <a href="https://slack.k8s.io/">https://slack.k8s.io/</a><br><strong>Step 2:</strong> Join the #litmus channel on the Kubernetes slack or use this link after joining the Kubernetes slack: <a href="https://slack.litmuschaos.io/">https://slack.litmuschaos.io/</a></p><p>Show your ❤️ with a ⭐ on our <a href="https://github.com/litmuschaos/litmus">Github</a>. To learn more about Litmus, check out the <a href="https://docs.litmuschaos.io/">Litmus documentation</a>. Thank you! <a href="https://emojipedia.org/folded-hands/">🙏</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42dddb264a12" width="1" height="1" alt=""><hr><p><a href="https://medium.com/litmus-chaos/getting-started-with-litmus-2-0-in-google-kubernetes-engine-42dddb264a12">Getting Started with Litmus 2.0 in Google Kubernetes Engine</a> was originally published in <a href="https://medium.com/litmus-chaos">Litmus-Chaos</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>