<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Best Practices on Krkn</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/categories/best-practices/</link><description>Recent content in Best Practices on Krkn</description><generator>Hugo</generator><language>en</language><atom:link href="https://deploy-preview-247--krkn-chaos.netlify.app/categories/best-practices/index.xml" rel="self" type="application/rss+xml"/><item><title>Getting Started</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/krkn_ai/getting-started-krkn-ai/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/krkn_ai/getting-started-krkn-ai/</guid><description>&lt;h2 id="getting-started-with-krkn-ai">
 Getting Started with Krkn-AI
 &lt;a class="td-heading-self-link" href="#getting-started-with-krkn-ai" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>This documentation details how to deploy a sample microservice application on Kubernetes Cluster and run Krkn-AI test.&lt;/p>
&lt;h3 id="prerequisites">
 Prerequisites
 &lt;a class="td-heading-self-link" href="#prerequisites" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;ul>
&lt;li>Follow this &lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/installation/krkn-ai/">guide&lt;/a> to install Krkn-AI CLI.&lt;/li>
&lt;li>Krkn-AI uses Thanos Querier to fetch SLO metrics by PromQL. You can easily install it by setting up &lt;a href="https://github.com/prometheus-operator/prometheus-operator">prometheus-operator&lt;/a> in your cluster.&lt;/li>
&lt;/ul>
&lt;h3 id="deploy-sample-microservice">
 Deploy Sample Microservice
 &lt;a class="td-heading-self-link" href="#deploy-sample-microservice" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;p>For demonstration purpose, we will deploy a sample microservice called &lt;a href="https://github.com/instana/robot-shop">robot-shop&lt;/a> on the cluster:&lt;/p></description></item><item><title>Adding New Scenario to Krkn-hub</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/editing-krkn-hub/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/editing-krkn-hub/</guid><description>&lt;h2 id="addingediting-a-new-scenario-to-krkn-hub">
 Adding/Editing a New Scenario to Krkn-hub
 &lt;a class="td-heading-self-link" href="#addingediting-a-new-scenario-to-krkn-hub" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>Create folder with scenario name under &lt;a href="https://github.com/krkn-chaos/krkn-hub/tree/main">krkn-hub&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Create generic scenario template with environment variables&lt;/p>
&lt;p>a. See &lt;a href="https://github.com/krkn-chaos/krkn-hub/blob/main/application-outages/app_outages.yaml.template">scenario.yaml&lt;/a> for example&lt;/p>
&lt;p>b. Almost all parameters should be set using a variable (these will be set in the env.sh file or through the command line environment variables)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Add defaults for any environment variables in an &amp;ldquo;env.sh&amp;rdquo; file&lt;/p>
&lt;p>a. See &lt;a href="https://github.com/krkn-chaos/krkn-hub/blob/main/application-outages/env.sh">env.sh&lt;/a> for example&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Create script to run.sh chaos scenario
a. See &lt;a href="https://github.com/krkn-chaos/krkn-hub/blob/main/application-outages/run.sh">run.sh&lt;/a> for example&lt;/p></description></item><item><title>Running a Chaos Scenario with Krkn</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/getting-started/getting-started-krkn/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/getting-started/getting-started-krkn/</guid><description>&lt;h2 id="getting-started-running-chaos-scenarios">
 Getting Started Running Chaos Scenarios
 &lt;a class="td-heading-self-link" href="#getting-started-running-chaos-scenarios" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;h2 id="config">
 Config
 &lt;a class="td-heading-self-link" href="#config" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>Instructions on how to setup the config and all the available options supported can be found at &lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/krkn/config/">Config&lt;/a>.&lt;/p>
&lt;p>In all the examples below you&amp;rsquo;ll replace the &lt;code>scenario_type&lt;/code> with the scenario plugin type that can be found in the &lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/scenarios/">second column here&lt;/a>&lt;/p>
&lt;h3 id="running-a-single-scenario">
 Running a Single Scenario
 &lt;a class="td-heading-self-link" href="#running-a-single-scenario" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;p>To run a single scenario, you&amp;rsquo;ll edit the krkn config file and only have 1 item in the list of chaos_scenarios&lt;/p></description></item><item><title>Setting Up Disconnected Enviornment</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/installation/disconnected-env/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/installation/disconnected-env/</guid><description>&lt;h2 id="getting-started-running-chaos-scenarios-in-a-disconnected-enviornment">
 Getting Started Running Chaos Scenarios in a Disconnected Enviornment
 &lt;a class="td-heading-self-link" href="#getting-started-running-chaos-scenarios-in-a-disconnected-enviornment" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;h3 id="mirror-following-images-on-the-bastion-host">
 Mirror following images on the bastion host
 &lt;a class="td-heading-self-link" href="#mirror-following-images-on-the-bastion-host" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:node-scenarios-bm&lt;/strong> - Master/worker node disruptions on baremetal&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:network-chaos&lt;/strong> - Network disruptions/traffic shaping&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:pod-scenarios&lt;/strong> - Pod level disruptions and evaluating recovery time/availability&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:syn-flood&lt;/strong> - Generates substantial amount of traffic/half open connections targeting a service&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:node-cpu-hog&lt;/strong> - Hogs CPU on the target nodes&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:node-io-hog&lt;/strong> - Hogs IO on the target nodes&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:node-memory-hog&lt;/strong> - Hogs memory on the target nodes&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:pvc-scenarios&lt;/strong> - Fills up a given PersistentVolumeClaim&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:service-hijacking&lt;/strong> - Simulates fake HTTP response for a service&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:power-outages&lt;/strong> - Shuts down the cluster and turns it back on&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:container-scenarios&lt;/strong> - Kills a container via provided kill signal&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:application-outages&lt;/strong> - Isolates application Ingress/Egress traffic&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:time-scenarios&lt;/strong> - Tweaks time/date on the nodes&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:pod-network-chaos&lt;/strong> - Introduces network chaos at pod level&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:node-network-filter&lt;/strong> - Node ip traffic filtering&lt;/li>
&lt;li>&lt;strong>quay.io/krkn-chaos/krkn-hub:pod-network-filter&lt;/strong> - DNS, internal/external service outages&lt;/li>
&lt;/ul>
&lt;h3 id="will-also-need-these-mirrored-images-inside-the-cluster">
 Will also need these mirrored images inside the cluster
 &lt;a class="td-heading-self-link" href="#will-also-need-these-mirrored-images-inside-the-cluster" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;ul>
&lt;li>Network disruptions - &lt;strong>quay.io/krkn-chaos/krkn:tools&lt;/strong>&lt;/li>
&lt;li>Hog scenarios ( CPU, Memory and IO ) - &lt;strong>quay.io/krkn-chaos/krkn-hog&lt;/strong>&lt;/li>
&lt;li>SYN flood - &lt;strong>quay.io/krkn-chaos/krkn-syn-flood:latest&lt;/strong>&lt;/li>
&lt;li>Pod network filter scenarios - &lt;strong>quay.io/krkn-chaos/krkn-network-chaos:latest&lt;/strong>&lt;/li>
&lt;li>Service hijacking scenarios - &lt;strong>quay.io/krkn-chaos/krkn-service-hijacking:v0.1.3&lt;/strong>&lt;/li>
&lt;/ul>
&lt;h2 id="how-to-mirror">
 How to Mirror
 &lt;a class="td-heading-self-link" href="#how-to-mirror" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>The strategy is simple:&lt;/p></description></item><item><title>Git Help For Contributions</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/contribution-guidelines/git-pointers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/contribution-guidelines/git-pointers/</guid><description>&lt;h1 id="how-to-contribute">
 How to contribute
 &lt;a class="td-heading-self-link" href="#how-to-contribute" aria-label="Heading self-link">&lt;/a>
&lt;/h1>
&lt;p>Contributions are always appreciated.&lt;/p>
&lt;p>How to:&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/contribution-guidelines/git-pointers/#pull-request">Submit Pull Request&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/contribution-guidelines/git-pointers/#squash-commits">Squash Commits&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/contribution-guidelines/git-pointers/#rebase-with-upstream">Rebase with Upstream&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/contribution-guidelines/git-pointers/#developers-certificate-of-origin">Certificate of Origin&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="pull-request">
 Pull request
 &lt;a class="td-heading-self-link" href="#pull-request" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>In order to submit a change or a PR, please fork the project and follow instructions:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">$ git clone http://github.com/&amp;lt;me&amp;gt;/krkn-hub
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ &lt;span class="nb">cd&lt;/span> krkn-hub
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ git checkout -b &amp;lt;branch_name&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ &amp;lt;make change&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ git add &amp;lt;changes&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ git commit -a
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ &amp;lt;insert good message&amp;gt;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">$ git push
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="squash-commits">
 Squash Commits
 &lt;a class="td-heading-self-link" href="#squash-commits" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>If there are multiple commits, please rebase/squash multiple commits
before creating the PR by following:&lt;/p></description></item><item><title>Adding to Krkn Test Suite</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/add-tests-krkn/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/add-tests-krkn/</guid><description>&lt;p>This guide covers how to add both unit tests and functional tests to the krkn project. Tests are essential for ensuring code quality and preventing regressions.&lt;/p>
&lt;h1 id="unit-tests">
 Unit Tests
 &lt;a class="td-heading-self-link" href="#unit-tests" aria-label="Heading self-link">&lt;/a>
&lt;/h1>
&lt;p>Unit tests in krkn are located in the &lt;code>tests/&lt;/code> directory and use Python&amp;rsquo;s &lt;code>unittest&lt;/code> framework with comprehensive mocking to avoid requiring external dependencies like cloud providers or Kubernetes clusters.&lt;/p>
&lt;h2 id="creating-a-unit-test">
 Creating a Unit Test
 &lt;a class="td-heading-self-link" href="#creating-a-unit-test" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;h3 id="1-file-location-and-naming">
 1. File Location and Naming
 &lt;a class="td-heading-self-link" href="#1-file-location-and-naming" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;p>Place your test file in the &lt;code>tests/&lt;/code> directory with the naming pattern &lt;code>test_&amp;lt;feature&amp;gt;.py&lt;/code>:&lt;/p></description></item><item><title>Getting Started with Running Scenarios</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/getting-started/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/getting-started/</guid><description>&lt;h2 id="quick-start-with-krknctl-recommended">
 Quick Start with krknctl (Recommended)
 &lt;a class="td-heading-self-link" href="#quick-start-with-krknctl-recommended" aria-label="Heading self-link">&lt;/a>
&lt;/h2>


&lt;div class="alert alert-success" role="alert">
&lt;h4 class="alert-heading">Recommended Approach&lt;/h4>

 &lt;strong>krknctl is the recommended and easiest way to run krkn scenarios.&lt;/strong> It provides command auto-completion, input validation, and abstracts the complexities of the container environment so you can focus on chaos engineering.

&lt;/div>

&lt;h3 id="why-krknctl">
 Why krknctl?
 &lt;a class="td-heading-self-link" href="#why-krknctl" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;p>krknctl is a dedicated CLI tool that streamlines running chaos scenarios by providing:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Command auto-completion&lt;/strong> - Quick access to all available commands&lt;/li>
&lt;li>&lt;strong>Input validation&lt;/strong> - Catch errors before they happen&lt;/li>
&lt;li>&lt;strong>Scenario descriptions&lt;/strong> - Built-in documentation and instructions&lt;/li>
&lt;li>&lt;strong>Simple workflow&lt;/strong> - No need to manage config files or containers&lt;/li>
&lt;/ul>
&lt;h3 id="get-started-in-3-steps">
 Get Started in 3 Steps:
 &lt;a class="td-heading-self-link" href="#get-started-in-3-steps" aria-label="Heading self-link">&lt;/a>
&lt;/h3>
&lt;ol>
&lt;li>&lt;strong>Install krknctl&lt;/strong> - Follow the &lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/installation/krknctl/">installation guide&lt;/a>&lt;/li>
&lt;li>&lt;strong>Explore features&lt;/strong> - Learn about &lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/krknctl/usage/">krknctl usage&lt;/a> and how to execute chaos scenarios&lt;/li>
&lt;li>&lt;strong>Run scenarios&lt;/strong> - Check out each &lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/scenarios/">scenario&amp;rsquo;s documentation&lt;/a> for krknctl examples&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="alternative-methods">
 Alternative Methods
 &lt;a class="td-heading-self-link" href="#alternative-methods" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;p>The following alternative methods are available for advanced use cases:&lt;/p></description></item><item><title>Testing your changes</title><link>https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/#configure-kind-testing-environment">Configure Kind environment&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/#testing-changes-in-krkn-lib">Testing Changes in Krkn-lib&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/#testing-changes-in-krkn">Testing Changes in Krkn&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/#testing-changes-for-krkn-hub">Testing Changes in Krkn-hub&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://deploy-preview-247--krkn-chaos.netlify.app/docs/developers-guide/testing-changes/#testing-changes-in-krknctl">Testing Changes in Krknctl&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>This page gives details about how you can get a kind cluster configured to be able to run on krkn-lib (the lowest level of krkn-chaos repos) up through krknctl (our easiest way to run and highest level repo)&lt;/p>
&lt;h2 id="configure-kind-testing-environment">
 Configure Kind Testing Environment
 &lt;a class="td-heading-self-link" href="#configure-kind-testing-environment" aria-label="Heading self-link">&lt;/a>
&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;a href="https://kind.sigs.k8s.io/docs/user/quick-start/#installation">Install kind&lt;/a>&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Create cluster using &lt;a href="https://github.com/krkn-chaos/krkn-lib/blob/main/kind-config.yml">kind-config.yml&lt;/a> under &lt;em>krkn-lib&lt;/em> base folder&lt;/p></description></item></channel></rss>