Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update what-is-litmus.md #255

Merged
merged 5 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cd litmus-docs

The docs website server can be setup manually or through docker compose

## Use embedmd command before commiting changes
## Use embedmd command before committing changes

The embedded code will be extracted from the file at `URL`, which can either be a relative path to a file in the local file system (using forward slashes as directory separator) or a URL starting with `http://` or `https://.`

Expand All @@ -45,7 +45,7 @@ _Installation:_
go install github.com/campoy/embedmd@latest
```

_Run embedmd (needs to be done before commiting the changes):_
_Run embedmd (needs to be done before committing the changes):_

- Follow the steps (from root directory) to run embedmd:

Expand All @@ -72,7 +72,7 @@ npm start

## Using Docker compose

### Install docker compose
### Install Docker compose

```bash
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
Expand Down
10 changes: 10 additions & 0 deletions website/docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ You need to Provide the correct socket path. By default in Portal `CONTAINER_RUN
If Your container runtime is `containerd` then you have to change the `CONTAINER_RUNTIME` to `containerd` and `SOCKET_PATH` to `/var/run/containerd/containerd.sock`.
You can find these in tune faults part of the tune chaos experiment page.

### The probe only accepts values in `ns, us, ms, m, s, or h`. But Why do experiments fail with `must be of type integer`?

In the logs of the Helper pod, you may face these error logs below.

```shell
{"mainLogs":"W1003 08:59:55.273647 1 client_config.go:552] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.\n2023/10/03 08:59:55 Error Creating Resource : ChaosEngine.litmuschaos.io 'pod-network-loss-h6srhrls' is invalid: [spec.experiments[0].spec.probe[0].runProperties.interval: Invalid value: 'string': spec.experiments[0].spec.probe[0].runProperties.interval in body must be of type integer: 'string', spec.experiments[0].spec.probe[0].runProperties.probeTimeout: Invalid value: 'string': spec.experiments[0].spec.probe[0].runProperties.probeTimeout in body must be of type integer: 'string']\n"}
```

It's because your cluster using old CRD manifest files. So you need to delete all Litmus' CRDs and reinstall them. The definition for CRDs can be found in the Chaos Infrastructure YAML file or at this [link](https://github.com/litmuschaos/litmus/blob/master/mkdocs/docs/<chaoscenter-version>/litmus-portal-crds-<chaoscenter-version>.yml).

## Chaoshub

### We have installed ChaosCenter successfully but the Litmus ChaosHub is in error state and manual cloning of a Git repository does not work.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/user-guides/gitops-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ It is also possible to account for the chaos experiments that are created and pu
- Once the chaos experiment is pushed to your repository, you’ll notice every chaos experiment has a `experiment_id`. You can get this from the chaos experiment YAML file. You need to copy the id and annotate the target application so that if there’s any change in the application, gitops will sync the chaos experiment using this experiment_id and run it on your target application. You can use the following command:

```
kubectl annotate deploy/target-application litmuschaos.io/workflow=${experiment_id}
kubectl annotate deploy/target-application litmuschaos.io/experimentId=${experiment_id}
```

```
Expand Down
13 changes: 13 additions & 0 deletions website/src/components/scarf/Scarf.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react'

const ScarfTag = () => {
return (
<img
alt="scarf"
referrerPolicy="no-referrer-when-downgrade"
src="https://static.scarf.sh/a.png?x-pxid=a56ed60e-6f2d-465c-ab2a-409f2086abc5"
/>
)
}

export { ScarfTag }
1 change: 1 addition & 0 deletions website/src/components/scarf/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Scarf'
167 changes: 167 additions & 0 deletions website/src/theme/Footer/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import React from 'react'
import clsx from 'clsx'
import Link from '@docusaurus/Link'
import { useThemeConfig } from '@docusaurus/theme-common'
import useBaseUrl from '@docusaurus/useBaseUrl'
import isInternalUrl from '@docusaurus/isInternalUrl'
import styles from './styles.module.css'
import ThemedImage from '@theme/ThemedImage'
import IconExternalLink from '@theme/IconExternalLink'
import { ScarfTag } from '../../components/scarf'

function FooterLink({ to, href, label, prependBaseUrlToHref, ...props }) {
const toUrl = useBaseUrl(to)
const normalizedHref = useBaseUrl(href, {
forcePrependBaseUrl: true
})
return (
<Link
className="footer__link-item"
{...(href
? {
href: prependBaseUrlToHref ? normalizedHref : href
}
: {
to: toUrl
})}
{...props}>
{href && !isInternalUrl(href) ? (
<span>
{label}
<IconExternalLink />
</span>
) : (
label
)}
</Link>
)
}

function FooterLogo({ sources, alt, width, height }) {
return <ThemedImage className="footer__logo" alt={alt} sources={sources} width={width} height={height} />
}

function MultiColumnLinks({ links }) {
return (
<>
{links.map((linkItem, i) => (
<div key={i} className="col footer__col">
<div className="footer__title">{linkItem.title}</div>
<ul className="footer__items">
{linkItem.items.map((item, key) =>
item.html ? (
<li
key={key}
className="footer__item" // Developer provided the HTML, so assume it's safe.
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: item.html
}}
/>
) : (
<li key={item.href || item.to} className="footer__item">
<FooterLink {...item} />
</li>
)
)}
</ul>
</div>
))}
</>
)
}

function SimpleLinks({ links }) {
return (
<div className="footer__links">
{links.map((item, key) => (
<>
{item.html ? (
<span
key={key}
className="footer__link-item" // Developer provided the HTML, so assume it's safe.
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: item.html
}}
/>
) : (
<FooterLink {...item} />
)}
{links.length !== key + 1 && <span className="footer__link-separator">·</span>}
</>
))}
</div>
)
}

function isMultiColumnFooterLinks(links) {
return 'title' in links[0]
}

function Footer() {
const { footer } = useThemeConfig()
const { copyright, links = [], logo = {} } = footer || {}
const sources = {
light: useBaseUrl(logo.src),
dark: useBaseUrl(logo.srcDark || logo.src)
}

if (!footer) {
return null
}

return (
<footer
className={clsx('footer', {
'footer--dark': footer.style === 'dark'
})}>
<div className="container container-fluid">
{links &&
links.length > 0 &&
(isMultiColumnFooterLinks(links) ? (
<div className="row footer__links">
<MultiColumnLinks links={links} />
</div>
) : (
<div className="footer__links text--center">
<SimpleLinks links={links} />
</div>
))}
{(logo || copyright) && (
<div className="footer__bottom text--center">
{logo && (logo.src || logo.srcDark) && (
<div className="margin-bottom--sm">
{logo.href ? (
<Link href={logo.href} className={styles.footerLogoLink}>
<FooterLogo alt={logo.alt} sources={sources} width={logo.width} height={logo.height} />
</Link>
) : (
<FooterLogo alt={logo.alt} sources={sources} />
)}
</div>
)}
{copyright ? (
<div
className="footer__copyright" // Developer provided the HTML, so assume it's safe.
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: copyright
}}
/>
) : null}
</div>
)}
</div>
<ScarfTag />
</footer>
)
}

export default React.memo(Footer)
15 changes: 15 additions & 0 deletions website/src/theme/Footer/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

.footerLogoLink {
opacity: 0.5;
transition: opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default);
}

.footerLogoLink:hover {
opacity: 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ sidebar_label: Litmus

<img align='right' src={require("../assets/litmus-logo.png").default} alt="Litmus Logo" width="120" />

LitmusChaos is a Cloud-Native Chaos Engineering Framework with cross-cloud support. It is a CNCF Incubating project with adoption across several organizations. Its mission is to help Kubernetes SREs and Developers to find weaknesses in both Non-Kubernetes as well as platforms and applications running on Kubernetes by providing a complete Chaos Engineering framework and associated Chaos Experiments.
LitmusChaos is a cloud-native chaos engineering framework with cross-cloud support. It is a CNCF-incubating project with adoption across several organizations. Its mission is to help Kubernetes SREs and developers find weaknesses in both non-Kubernetes as well as platforms and applications running on Kubernetes by providing a complete Chaos Engineering framework and associated Chaos Experiments.

Litmus can be used to run chaos experiments initially in the staging environment and eventually in production to find bugs and vulnerabilities, fixing which leads to an increased resilience of the system. Litmus adopts a "Kubernetes-native" approach to define chaos intent in a declarative manner via Kubernetes custom resources (CRs).
Litmus can be used to run chaos experiments initially in the staging environment and eventually in production to find bugs and vulnerabilities and fix them, which leads to an increased resilience of the system. Litmus adopts a "Kubernetes-native" approach to define chaos intent in a declarative manner via Kubernetes custom resources (CRs).

## Importance of Resilience
## Significance of Resilience

<img src={require("../assets/introduction/litmus/importance-of-resilience.png").default} alt="Importance Of Resilience" />

Kubernetes is being run on a variety of infrastructure, ranging from virtual machines to bare metal and a combination of them. The platform’s physical nature is a source of faults to the application that runs inside containers, as shown in the tip of the above diagram. The next layer of dependency is Kubernetes itself.
A variety of infrastructure, ranging from virtual machines to bare metal and a combination of them, uses Kubernetes. The platform’s physical nature is a source of faults for the application that runs inside containers, as shown in the tip of the above diagram. The next layer of dependency is Kubernetes itself.

Your application resilience really depends more on the underlying stack than your application itself. It is possible that once your application is stabilized, the resilience of your service that runs on Kubernetes depends on other components and infrastructure more than 90% of the time.
Your application's resilience really depends more on the underlying stack than on your application itself. Once your application is stable, the service resilience (which runs on Kubernetes) depends on other components and infrastructure more than 90% of the time.

Thus it is important to verify your application resilience whenever a change has happened in the underlying stack. **Keep verifying** is the key. Robust testing before upgrades is not good enough, mainly because you cannot possibly consider all sorts of faults during upgrade testing. This introduces the concept of Chaos Engineering. The process of "**continuously verifying** if your service is resilient against faults" is called Chaos Engineering.
Thus, it is important to verify your application's resilience whenever a change has happened in the underlying stack. **Keep verifying** is the key. Robust testing before upgrades is not good enough, mainly because you cannot possibly consider all sorts of faults during upgrade testing. This introduces the concept of chaos engineering. The process of "**continuously verifying** if your service is resilient against faults" is called chaos engineering.

## What is a Chaos Experiment
## What is a chaos experiment?

Chaos Experiments are fundamental units within the LitmusChaos architecture. Users can choose between readily available chaos experiments or create new ones to construct a required Chaos Scenario.
Chaos experiments are fundamental units within the LitmusChaos architecture. You can choose between readily available chaos experiments or create new ones to construct a required chaos scenario.

## What is a Chaos Scenarios
## What is a Chaos Scenario?

A chaos scenario is much more than a simple chaos experiment. It supports the user in defining the expected result, observing the result, analysing the overall system behaviour, and in the decision-making process if the system needs to be tuned for improving the resilience.
A chaos scenario is much more than a simple chaos experiment. It supports the user in defining the expected result, observing the result, analysing the overall system behaviour, and in the decision-making process if the system needs to be tuned for improving resilience.

## How to Contribute

Expand Down
10 changes: 10 additions & 0 deletions website/versioned_docs/version-3.0.0/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ You need to Provide the correct socket path. By default in Portal `CONTAINER_RUN
If Your container runtime is `containerd` then you have to change the `CONTAINER_RUNTIME` to `containerd` and `SOCKET_PATH` to `/var/run/containerd/containerd.sock`.
You can find these in tune faults part of the tune chaos experiment page.

### The probe only accepts values in `ns, us, ms, m, s, or h`. But Why do experiments fail with `must be of type integer`?

In the logs of the Helper pod, you may face these error logs below.

```shell
{"mainLogs":"W1003 08:59:55.273647 1 client_config.go:552] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.\n2023/10/03 08:59:55 Error Creating Resource : ChaosEngine.litmuschaos.io 'pod-network-loss-h6srhrls' is invalid: [spec.experiments[0].spec.probe[0].runProperties.interval: Invalid value: 'string': spec.experiments[0].spec.probe[0].runProperties.interval in body must be of type integer: 'string', spec.experiments[0].spec.probe[0].runProperties.probeTimeout: Invalid value: 'string': spec.experiments[0].spec.probe[0].runProperties.probeTimeout in body must be of type integer: 'string']\n"}
```

It's because your cluster using old CRD manifest files. So you need to delete all Litmus' CRDs and reinstall them. The definition for CRDs can be found in the Chaos Infrastructure YAML file or at this [link](https://github.com/litmuschaos/litmus/blob/master/mkdocs/docs/3.0.0/litmus-portal-crds-3.0.0.yml).

## Chaoshub

### We have installed ChaosCenter successfully but the Litmus ChaosHub is in error state and manual cloning of a Git repository does not work.
Expand Down
Loading