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

Local ChaosMesh #1622

Merged
merged 2 commits into from
Feb 7, 2025
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
1 change: 1 addition & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [Test Configuration](./framework/test_configuration_overrides.md)
- [Exposing Components](framework/components/state.md)
- [Debugging Tests](framework/components/debug.md)
- [Debugging K8s Chaos Tests](framework/chaos/debug-k8s.md)
- [Components Cleanup](framework/components/cleanup.md)
- [Components Caching](framework/components/caching.md)
- [Components Resources](framework/components/resources.md)
Expand Down
6 changes: 6 additions & 0 deletions book/src/framework/chaos/chaos.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ We also offer a set of blockchain-specific experiments, which typically involve
- Utilizing developer APIs (e.g., Anvil)

Check [gas](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/chaos/chaos_blockchain_evm_gas_test.go) and [reorg](https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/framework/examples/myproject/chaos/chaos_blockchain_evm_reorg_test.go) examples.

## Debugging

To debug `Docker` applications you can just use `CTFv2` deployments.

To debug `K8s` please use our [simulator](../chaos/debug-k8s.md).
26 changes: 26 additions & 0 deletions book/src/framework/chaos/debug-k8s.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Debugging K8s Chaos Tests

This deployment is used to debug various [ChaosMesh](https://chaos-mesh.org/) with [Kind](https://kind.sigs.k8s.io/)

Install [DevBox](https://www.jetify.com/devbox) and run your environment
```
devbox run up
```

Overview the services
```
devbox shell
k9s
```
Apply experiments (inside devbox shell)

If you running it from any other shell or using `Go` don't forget to apply `kubectl config set-context kind-cm-playground` before!
```
kubectl apply -f manifests/latency.yaml
```
Debug `ChaosMesh` using `k9s`, check daemon logs.

Remove the environment
```
devbox run down
```
26 changes: 26 additions & 0 deletions infra/chaosmesh-playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## ChaosMesh Playground

This deployment is used to debug various [ChaosMesh](https://chaos-mesh.org/) with [Kind](https://kind.sigs.k8s.io/)

Install [DevBox](https://www.jetify.com/devbox) and run your environment
```
devbox run up
```

Overview the services
```
devbox shell
k9s
```
Apply experiments (inside devbox shell)

If you running it from any other shell or using `Go` don't forget to apply `kubectl config set-context kind-cm-playground` before!
```
kubectl apply -f manifests/latency.yaml
```
Debug `ChaosMesh` using `k9s`, check daemon logs.

Remove the environment
```
devbox run down
```
38 changes: 38 additions & 0 deletions infra/chaosmesh-playground/devbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.5/.schema/devbox.schema.json",
"packages": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
],
"shell": {
"init_hook": [
"echo 'Welcome to devbox!' > /dev/null"
],
"scripts": {
"up": [
"kind create cluster --name cm-playground --config kind.yaml",
"helm repo add chaos-mesh https://charts.chaos-mesh.org",
"kubectl create ns chaos-mesh",
"helm install chaos-mesh chaos-mesh/chaos-mesh -n=chaos-mesh --set chaosDaemon.runtime=containerd --set chaosDaemon.socketPath=/run/containerd/containerd.sock --version 2.7.0",
"kubectl apply -f dummy-cluster.yaml"
],
"down": [
"kind delete cluster --name cm-playground"
],
"rm-chaos": [
"kubectl delete networkchaos --all -A",
"kubectl delete podchaos --all -A",
"kubectl delete iochaos --all -A",
"kubectl delete timechaos --all -A",
"kubectl delete stresschaos --all -A",
"kubectl delete dnschaos --all -A",
"kubectl delete kernelchaos --all -A"
],
"context": [
"kubectl config set-context"
]
}
}
}
233 changes: 233 additions & 0 deletions infra/chaosmesh-playground/devbox.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
{
"lockfile_version": "1",
"packages": {
"[email protected]": {
"last_modified": "2025-01-19T08:16:51Z",
"resolved": "github:NixOS/nixpkgs/50165c4f7eb48ce82bd063e1fb8047a0f515f8ce#k9s",
"source": "devbox-search",
"version": "0.32.7",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/davyazrjq67v3asr3c166xwh2q4q2wmj-k9s-0.32.7",
"default": true
}
],
"store_path": "/nix/store/davyazrjq67v3asr3c166xwh2q4q2wmj-k9s-0.32.7"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/jkibg8q4phcw1yj8lx5f5avshzbjjr8f-k9s-0.32.7",
"default": true
}
],
"store_path": "/nix/store/jkibg8q4phcw1yj8lx5f5avshzbjjr8f-k9s-0.32.7"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/3j6m04knddvzgcq3xp0vr1551s6ii93s-k9s-0.32.7",
"default": true
}
],
"store_path": "/nix/store/3j6m04knddvzgcq3xp0vr1551s6ii93s-k9s-0.32.7"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/m8d3pcdzrcfvy3rzkjpgfr0v94a1pf4i-k9s-0.32.7",
"default": true
}
],
"store_path": "/nix/store/m8d3pcdzrcfvy3rzkjpgfr0v94a1pf4i-k9s-0.32.7"
}
}
},
"[email protected]": {
"last_modified": "2025-01-19T08:16:51Z",
"resolved": "github:NixOS/nixpkgs/50165c4f7eb48ce82bd063e1fb8047a0f515f8ce#kind",
"source": "devbox-search",
"version": "0.26.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/4j12j5zijvbcyafx85a2qh8jkv4m6lnz-kind-0.26.0",
"default": true
}
],
"store_path": "/nix/store/4j12j5zijvbcyafx85a2qh8jkv4m6lnz-kind-0.26.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/gkpan5sh4kmbxknrf79p9ssd1j024ydb-kind-0.26.0",
"default": true
}
],
"store_path": "/nix/store/gkpan5sh4kmbxknrf79p9ssd1j024ydb-kind-0.26.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/2vsw8jyi2n4sm74sk1kbff6hq5v8nz6i-kind-0.26.0",
"default": true
}
],
"store_path": "/nix/store/2vsw8jyi2n4sm74sk1kbff6hq5v8nz6i-kind-0.26.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/hp80rb9dpsk2wj5db2zngh5b8hrgwy4k-kind-0.26.0",
"default": true
}
],
"store_path": "/nix/store/hp80rb9dpsk2wj5db2zngh5b8hrgwy4k-kind-0.26.0"
}
}
},
"[email protected]": {
"last_modified": "2025-01-22T06:06:04Z",
"resolved": "github:NixOS/nixpkgs/5757bbb8bd7c0630a0cc4bb19c47e588db30b97c#kubectl",
"source": "devbox-search",
"version": "1.32.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/18441nqn0dahiwn1rvwilqvrqwqvvknz-kubectl-1.32.1",
"default": true
},
{
"name": "man",
"path": "/nix/store/7aqhrqy27487ph8gcqwl92lpn48zczlm-kubectl-1.32.1-man",
"default": true
},
{
"name": "convert",
"path": "/nix/store/4ahm5rn4f326izlh8nh6zfcf066r0jp9-kubectl-1.32.1-convert"
}
],
"store_path": "/nix/store/18441nqn0dahiwn1rvwilqvrqwqvvknz-kubectl-1.32.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/jylypnz6nddbqf85glbyhpmjsbgmlayj-kubectl-1.32.1",
"default": true
},
{
"name": "man",
"path": "/nix/store/0f95qz0ynbilx8h0z350in0d8kc9aj1m-kubectl-1.32.1-man",
"default": true
},
{
"name": "convert",
"path": "/nix/store/y9kx67c1h6sjr3l4vp7j200v640h32kr-kubectl-1.32.1-convert"
}
],
"store_path": "/nix/store/jylypnz6nddbqf85glbyhpmjsbgmlayj-kubectl-1.32.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/c4ha370mr37kzmr5d3k3x2f7ln51r9fz-kubectl-1.32.1",
"default": true
},
{
"name": "man",
"path": "/nix/store/5p29mlkb5ywfn2znwb3pxbyr187585yy-kubectl-1.32.1-man",
"default": true
},
{
"name": "convert",
"path": "/nix/store/83qij5g1wkrrwzjn1cwnkd342ifzw97x-kubectl-1.32.1-convert"
}
],
"store_path": "/nix/store/c4ha370mr37kzmr5d3k3x2f7ln51r9fz-kubectl-1.32.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/v312kkwzk8mibc9z67n53hab6mcc7cn5-kubectl-1.32.1",
"default": true
},
{
"name": "man",
"path": "/nix/store/jb9zc5f93z67xaldz5zmmnv8d5pzc94r-kubectl-1.32.1-man",
"default": true
},
{
"name": "convert",
"path": "/nix/store/1lkaw0m4238bichjjl5jkkpqpvxahp43-kubectl-1.32.1-convert"
}
],
"store_path": "/nix/store/v312kkwzk8mibc9z67n53hab6mcc7cn5-kubectl-1.32.1"
}
}
},
"[email protected]": {
"last_modified": "2025-01-22T06:06:04Z",
"resolved": "github:NixOS/nixpkgs/5757bbb8bd7c0630a0cc4bb19c47e588db30b97c#kubernetes-helm",
"source": "devbox-search",
"version": "3.17.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/kqb20496bhsi6wlggidm645ncch8lzxw-kubernetes-helm-3.17.0",
"default": true
}
],
"store_path": "/nix/store/kqb20496bhsi6wlggidm645ncch8lzxw-kubernetes-helm-3.17.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/d60427zv4gsskq2rsq6yfbzzwgr4xdz7-kubernetes-helm-3.17.0",
"default": true
}
],
"store_path": "/nix/store/d60427zv4gsskq2rsq6yfbzzwgr4xdz7-kubernetes-helm-3.17.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/zak1xp04pcfm0b9gaap9jxp4bq0lawxq-kubernetes-helm-3.17.0",
"default": true
}
],
"store_path": "/nix/store/zak1xp04pcfm0b9gaap9jxp4bq0lawxq-kubernetes-helm-3.17.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/zidsngzm5lwyabaq9fy6m9h6sifk6pg8-kubernetes-helm-3.17.0",
"default": true
}
],
"store_path": "/nix/store/zidsngzm5lwyabaq9fy6m9h6sifk6pg8-kubernetes-helm-3.17.0"
}
}
}
}
}
Loading
Loading