Skip to content

Commit 83710b7

Browse files
authored
Local ChaosMesh (#1622)
* infra playground * docs
1 parent 6d6c1b2 commit 83710b7

File tree

16 files changed

+1048
-0
lines changed

16 files changed

+1048
-0
lines changed

book/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
- [Test Configuration](./framework/test_configuration_overrides.md)
2121
- [Exposing Components](framework/components/state.md)
2222
- [Debugging Tests](framework/components/debug.md)
23+
- [Debugging K8s Chaos Tests](framework/chaos/debug-k8s.md)
2324
- [Components Cleanup](framework/components/cleanup.md)
2425
- [Components Caching](framework/components/caching.md)
2526
- [Components Resources](framework/components/resources.md)

book/src/framework/chaos/chaos.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ We also offer a set of blockchain-specific experiments, which typically involve
5757
- Utilizing developer APIs (e.g., Anvil)
5858

5959
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.
60+
61+
## Debugging
62+
63+
To debug `Docker` applications you can just use `CTFv2` deployments.
64+
65+
To debug `K8s` please use our [simulator](../chaos/debug-k8s.md).
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Debugging K8s Chaos Tests
2+
3+
This deployment is used to debug various [ChaosMesh](https://chaos-mesh.org/) with [Kind](https://kind.sigs.k8s.io/)
4+
5+
Install [DevBox](https://www.jetify.com/devbox) and run your environment
6+
```
7+
devbox run up
8+
```
9+
10+
Overview the services
11+
```
12+
devbox shell
13+
k9s
14+
```
15+
Apply experiments (inside devbox shell)
16+
17+
If you running it from any other shell or using `Go` don't forget to apply `kubectl config set-context kind-cm-playground` before!
18+
```
19+
kubectl apply -f manifests/latency.yaml
20+
```
21+
Debug `ChaosMesh` using `k9s`, check daemon logs.
22+
23+
Remove the environment
24+
```
25+
devbox run down
26+
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## ChaosMesh Playground
2+
3+
This deployment is used to debug various [ChaosMesh](https://chaos-mesh.org/) with [Kind](https://kind.sigs.k8s.io/)
4+
5+
Install [DevBox](https://www.jetify.com/devbox) and run your environment
6+
```
7+
devbox run up
8+
```
9+
10+
Overview the services
11+
```
12+
devbox shell
13+
k9s
14+
```
15+
Apply experiments (inside devbox shell)
16+
17+
If you running it from any other shell or using `Go` don't forget to apply `kubectl config set-context kind-cm-playground` before!
18+
```
19+
kubectl apply -f manifests/latency.yaml
20+
```
21+
Debug `ChaosMesh` using `k9s`, check daemon logs.
22+
23+
Remove the environment
24+
```
25+
devbox run down
26+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.5/.schema/devbox.schema.json",
3+
"packages": [
4+
5+
6+
7+
8+
],
9+
"shell": {
10+
"init_hook": [
11+
"echo 'Welcome to devbox!' > /dev/null"
12+
],
13+
"scripts": {
14+
"up": [
15+
"kind create cluster --name cm-playground --config kind.yaml",
16+
"helm repo add chaos-mesh https://charts.chaos-mesh.org",
17+
"kubectl create ns chaos-mesh",
18+
"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",
19+
"kubectl apply -f dummy-cluster.yaml"
20+
],
21+
"down": [
22+
"kind delete cluster --name cm-playground"
23+
],
24+
"rm-chaos": [
25+
"kubectl delete networkchaos --all -A",
26+
"kubectl delete podchaos --all -A",
27+
"kubectl delete iochaos --all -A",
28+
"kubectl delete timechaos --all -A",
29+
"kubectl delete stresschaos --all -A",
30+
"kubectl delete dnschaos --all -A",
31+
"kubectl delete kernelchaos --all -A"
32+
],
33+
"context": [
34+
"kubectl config set-context"
35+
]
36+
}
37+
}
38+
}
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
{
2+
"lockfile_version": "1",
3+
"packages": {
4+
5+
"last_modified": "2025-01-19T08:16:51Z",
6+
"resolved": "github:NixOS/nixpkgs/50165c4f7eb48ce82bd063e1fb8047a0f515f8ce#k9s",
7+
"source": "devbox-search",
8+
"version": "0.32.7",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"outputs": [
12+
{
13+
"name": "out",
14+
"path": "/nix/store/davyazrjq67v3asr3c166xwh2q4q2wmj-k9s-0.32.7",
15+
"default": true
16+
}
17+
],
18+
"store_path": "/nix/store/davyazrjq67v3asr3c166xwh2q4q2wmj-k9s-0.32.7"
19+
},
20+
"aarch64-linux": {
21+
"outputs": [
22+
{
23+
"name": "out",
24+
"path": "/nix/store/jkibg8q4phcw1yj8lx5f5avshzbjjr8f-k9s-0.32.7",
25+
"default": true
26+
}
27+
],
28+
"store_path": "/nix/store/jkibg8q4phcw1yj8lx5f5avshzbjjr8f-k9s-0.32.7"
29+
},
30+
"x86_64-darwin": {
31+
"outputs": [
32+
{
33+
"name": "out",
34+
"path": "/nix/store/3j6m04knddvzgcq3xp0vr1551s6ii93s-k9s-0.32.7",
35+
"default": true
36+
}
37+
],
38+
"store_path": "/nix/store/3j6m04knddvzgcq3xp0vr1551s6ii93s-k9s-0.32.7"
39+
},
40+
"x86_64-linux": {
41+
"outputs": [
42+
{
43+
"name": "out",
44+
"path": "/nix/store/m8d3pcdzrcfvy3rzkjpgfr0v94a1pf4i-k9s-0.32.7",
45+
"default": true
46+
}
47+
],
48+
"store_path": "/nix/store/m8d3pcdzrcfvy3rzkjpgfr0v94a1pf4i-k9s-0.32.7"
49+
}
50+
}
51+
},
52+
53+
"last_modified": "2025-01-19T08:16:51Z",
54+
"resolved": "github:NixOS/nixpkgs/50165c4f7eb48ce82bd063e1fb8047a0f515f8ce#kind",
55+
"source": "devbox-search",
56+
"version": "0.26.0",
57+
"systems": {
58+
"aarch64-darwin": {
59+
"outputs": [
60+
{
61+
"name": "out",
62+
"path": "/nix/store/4j12j5zijvbcyafx85a2qh8jkv4m6lnz-kind-0.26.0",
63+
"default": true
64+
}
65+
],
66+
"store_path": "/nix/store/4j12j5zijvbcyafx85a2qh8jkv4m6lnz-kind-0.26.0"
67+
},
68+
"aarch64-linux": {
69+
"outputs": [
70+
{
71+
"name": "out",
72+
"path": "/nix/store/gkpan5sh4kmbxknrf79p9ssd1j024ydb-kind-0.26.0",
73+
"default": true
74+
}
75+
],
76+
"store_path": "/nix/store/gkpan5sh4kmbxknrf79p9ssd1j024ydb-kind-0.26.0"
77+
},
78+
"x86_64-darwin": {
79+
"outputs": [
80+
{
81+
"name": "out",
82+
"path": "/nix/store/2vsw8jyi2n4sm74sk1kbff6hq5v8nz6i-kind-0.26.0",
83+
"default": true
84+
}
85+
],
86+
"store_path": "/nix/store/2vsw8jyi2n4sm74sk1kbff6hq5v8nz6i-kind-0.26.0"
87+
},
88+
"x86_64-linux": {
89+
"outputs": [
90+
{
91+
"name": "out",
92+
"path": "/nix/store/hp80rb9dpsk2wj5db2zngh5b8hrgwy4k-kind-0.26.0",
93+
"default": true
94+
}
95+
],
96+
"store_path": "/nix/store/hp80rb9dpsk2wj5db2zngh5b8hrgwy4k-kind-0.26.0"
97+
}
98+
}
99+
},
100+
101+
"last_modified": "2025-01-22T06:06:04Z",
102+
"resolved": "github:NixOS/nixpkgs/5757bbb8bd7c0630a0cc4bb19c47e588db30b97c#kubectl",
103+
"source": "devbox-search",
104+
"version": "1.32.1",
105+
"systems": {
106+
"aarch64-darwin": {
107+
"outputs": [
108+
{
109+
"name": "out",
110+
"path": "/nix/store/18441nqn0dahiwn1rvwilqvrqwqvvknz-kubectl-1.32.1",
111+
"default": true
112+
},
113+
{
114+
"name": "man",
115+
"path": "/nix/store/7aqhrqy27487ph8gcqwl92lpn48zczlm-kubectl-1.32.1-man",
116+
"default": true
117+
},
118+
{
119+
"name": "convert",
120+
"path": "/nix/store/4ahm5rn4f326izlh8nh6zfcf066r0jp9-kubectl-1.32.1-convert"
121+
}
122+
],
123+
"store_path": "/nix/store/18441nqn0dahiwn1rvwilqvrqwqvvknz-kubectl-1.32.1"
124+
},
125+
"aarch64-linux": {
126+
"outputs": [
127+
{
128+
"name": "out",
129+
"path": "/nix/store/jylypnz6nddbqf85glbyhpmjsbgmlayj-kubectl-1.32.1",
130+
"default": true
131+
},
132+
{
133+
"name": "man",
134+
"path": "/nix/store/0f95qz0ynbilx8h0z350in0d8kc9aj1m-kubectl-1.32.1-man",
135+
"default": true
136+
},
137+
{
138+
"name": "convert",
139+
"path": "/nix/store/y9kx67c1h6sjr3l4vp7j200v640h32kr-kubectl-1.32.1-convert"
140+
}
141+
],
142+
"store_path": "/nix/store/jylypnz6nddbqf85glbyhpmjsbgmlayj-kubectl-1.32.1"
143+
},
144+
"x86_64-darwin": {
145+
"outputs": [
146+
{
147+
"name": "out",
148+
"path": "/nix/store/c4ha370mr37kzmr5d3k3x2f7ln51r9fz-kubectl-1.32.1",
149+
"default": true
150+
},
151+
{
152+
"name": "man",
153+
"path": "/nix/store/5p29mlkb5ywfn2znwb3pxbyr187585yy-kubectl-1.32.1-man",
154+
"default": true
155+
},
156+
{
157+
"name": "convert",
158+
"path": "/nix/store/83qij5g1wkrrwzjn1cwnkd342ifzw97x-kubectl-1.32.1-convert"
159+
}
160+
],
161+
"store_path": "/nix/store/c4ha370mr37kzmr5d3k3x2f7ln51r9fz-kubectl-1.32.1"
162+
},
163+
"x86_64-linux": {
164+
"outputs": [
165+
{
166+
"name": "out",
167+
"path": "/nix/store/v312kkwzk8mibc9z67n53hab6mcc7cn5-kubectl-1.32.1",
168+
"default": true
169+
},
170+
{
171+
"name": "man",
172+
"path": "/nix/store/jb9zc5f93z67xaldz5zmmnv8d5pzc94r-kubectl-1.32.1-man",
173+
"default": true
174+
},
175+
{
176+
"name": "convert",
177+
"path": "/nix/store/1lkaw0m4238bichjjl5jkkpqpvxahp43-kubectl-1.32.1-convert"
178+
}
179+
],
180+
"store_path": "/nix/store/v312kkwzk8mibc9z67n53hab6mcc7cn5-kubectl-1.32.1"
181+
}
182+
}
183+
},
184+
185+
"last_modified": "2025-01-22T06:06:04Z",
186+
"resolved": "github:NixOS/nixpkgs/5757bbb8bd7c0630a0cc4bb19c47e588db30b97c#kubernetes-helm",
187+
"source": "devbox-search",
188+
"version": "3.17.0",
189+
"systems": {
190+
"aarch64-darwin": {
191+
"outputs": [
192+
{
193+
"name": "out",
194+
"path": "/nix/store/kqb20496bhsi6wlggidm645ncch8lzxw-kubernetes-helm-3.17.0",
195+
"default": true
196+
}
197+
],
198+
"store_path": "/nix/store/kqb20496bhsi6wlggidm645ncch8lzxw-kubernetes-helm-3.17.0"
199+
},
200+
"aarch64-linux": {
201+
"outputs": [
202+
{
203+
"name": "out",
204+
"path": "/nix/store/d60427zv4gsskq2rsq6yfbzzwgr4xdz7-kubernetes-helm-3.17.0",
205+
"default": true
206+
}
207+
],
208+
"store_path": "/nix/store/d60427zv4gsskq2rsq6yfbzzwgr4xdz7-kubernetes-helm-3.17.0"
209+
},
210+
"x86_64-darwin": {
211+
"outputs": [
212+
{
213+
"name": "out",
214+
"path": "/nix/store/zak1xp04pcfm0b9gaap9jxp4bq0lawxq-kubernetes-helm-3.17.0",
215+
"default": true
216+
}
217+
],
218+
"store_path": "/nix/store/zak1xp04pcfm0b9gaap9jxp4bq0lawxq-kubernetes-helm-3.17.0"
219+
},
220+
"x86_64-linux": {
221+
"outputs": [
222+
{
223+
"name": "out",
224+
"path": "/nix/store/zidsngzm5lwyabaq9fy6m9h6sifk6pg8-kubernetes-helm-3.17.0",
225+
"default": true
226+
}
227+
],
228+
"store_path": "/nix/store/zidsngzm5lwyabaq9fy6m9h6sifk6pg8-kubernetes-helm-3.17.0"
229+
}
230+
}
231+
}
232+
}
233+
}

0 commit comments

Comments
 (0)