Chaos Engineering with Litmus-portal on Okteto cloud
Tags: kubernetes, litmuschaos, okteto, chaosengineering
Published: 2020-10-14 15:33:05

- *Developing Chaos Engineering Framework in a cloud-native way*.

Developing applications often require extensive programming whereas cloud-native applications specifically built atop Kubernetes facilitate declarative ways of creating deployments and services, enforcing role-based access control mechanisms, scaling and tuning systems and defining controls. Although they might seem miles apart for having something in common, still both are essential stages of SDLC and IT operations. Developing a robust application that is resilient to common outages and failures is the need of the hour. 

##LitmusChaos

[LitmusChaos](https://litmuschaos.io) is a framework that is widely used and accepted for cloud-native chaos engineering. It allows SREs to inject chaos based on a hypothesis, observe applications under test conditions and monitor changes in the environment’s state and the application’s behaviour during the chaos. Chaos is generally induced in pre-production or staging environments or as a continuous check in CI/CD and E2E pipelines of applications to validate and benchmark the performance and resiliency of individual components. A wide range of available experiments with sample engines and RBACs are available on the [ChaosHub.](https://hub.litmuschaos.io)


##Okteto cloud

[Okteto Cloud](https://okteto.com)  gives instant access to secure Kubernetes namespaces to enable developers to code, build, and run Kubernetes applications entirely in the cloud. Empowering developers to innovate and build cloud-native applications faster than ever. It gives developers the ability to get a live preview of any application under development, depicting how it would function as deployment in a production cluster or environment. Changes made while developing are always in sync with the development container running on the cloud. Developers can easily develop containerized applications or applications with microservices architecture with varying software design patterns.  


##Best of both worlds

Deploying LitmusChaos infrastructure directly to the cloud using Okteto pipeline brings together the best of both worlds. Unifying software development and IT operations to bring together SREs and developers and Practicalizing DevOps. Combined with ease of deployment and system observability the duo can surpass any cloud-native framework for an exemplary end-user experience. LitmusChaos plugin for Okteto is already available on the cloud. Litmus release 1.9 comes with litmus-portal as an integrated chaos engineering platform available on Okteto cloud with features like scheduling chaos workflows, enhanced configuration options, and in-place editing of the declarative chaos engines and detailed chaos workflow analytics with informative data visualizations. Enabling developers and SREs alike to easily inject chaos on an Application under Test (A.U.T.) being served as a deployment on the cloud. Contributing to the entire framework is now within the reach of both, the application developers and SREs.


##Litmus Portal on Okteto

Litmus Portal provides capabilities to orchestrate complex chaos workflows, monitor chaos events and metrics around chaos experiments. Workflows running on multiple Kubernetes clusters can be managed from this portal. Multiple team members can share workflows management. Cluster agent, server and frontend are the components which are required for running chaos workflows. Each of these components has separate deployments and services in production environments but in Okteto cloud, along with the portal, separate development containers can be spun up for each component to develop them individually. The section below gives a basic overview of the steps involved to achieve this and setup Litmus portal development environment on Okteto cloud.

![Litmus Portal](https://i.ibb.co/5Bgw4mk/Screenshot-2020-10-14-at-7-59-29-PM.png)


##The setup

Steps for setting up a development environment for litmus-portal on Okteto are provided with prerequisites, detailed instructions and debugging procedures here. https://github.com/litmuschaos/litmus/tree/master/litmus-portal/platforms/okteto

*Steps involved in setting up the development environment are:*

* Fork litmuschaos's [litmus repository] (https://github.com/litmuschaos/litmus) and create a feature branch ex- `dev` from `master` of your fork.

* Goto `litmus-portal/platforms/okteto` directory from GitHub UI and click on **Develop on Okteto** button to create an account on Okteto cloud and deploy Litmus portal on your Okteto cloud namespace.

* You can start scheduling chaos workflows and use the portal in production mode. To start developing, clone the forked repository, download the Okteto CLI and export the kubeconfig file from Okteto after downloading the same. Then follow the steps [here.] (https://github.com/litmuschaos/litmus/tree/master/litmus-portal/platforms/okteto)

![Okteto Development Environment](https://i.ibb.co/c2LWvN3/Screenshot-2020-10-14-at-7-39-09-PM.png)

A few step process to take the entire development setup to the cloud, enabling faster development and testing of the portal. With just an IDE, a developer can now contribute to the project without worrying about system or software requirements and limitations.


##Resources

Here is another article demonstrating how to use LitmusChaos on Okteto cloud for chaos engineering. [https://okteto.com/blog/chaos-engineering-with-litmus](https://okteto.com/blog/chaos-engineering-with-litmus) This repository holds a sample pipeline and setup to get started with the same. [https://github.com/okteto/litmus-on-okteto](https://github.com/okteto/litmus-on-okteto)


##Join the Community

*Are you an SRE or a Kubernetes enthusiast? Does Chaos Engineering excite you?*

Join our community on Slack for detailed discussion, feedback & regular updates On Chaos Engineering For Kubernetes,
To join, our slack please follow the following steps!

1. Join the Kubernetes slack using the following link: [https://slack.k8s.io](https://slack.k8s.io)

2. Join the #litmus channel on the Kubernetes slack or use this link after joining the Kubernetes slack: [https://slack.litmuschaos.io](https://slack.litmuschaos.io)

Check out the LitmusChaos GitHub repo and do share your feedback: [https://github.com/litmuschaos/litmus](https://github.com/litmuschaos/litmus)
Submit a pull request if you identify any necessary changes.