-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
971 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## 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) | ||
``` | ||
kubectl apply -f manifests/latency.yaml | ||
``` | ||
Debug `ChaosMesh` using k9s, check daemon logs. | ||
|
||
Remove the environment | ||
``` | ||
devbox run down | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"$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", | ||
"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.yaml" | ||
], | ||
"down": [ | ||
"kind delete cluster --name cm-playground" | ||
], | ||
"context": [ | ||
"kubectl config set-context" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: ping-deployment | ||
spec: | ||
replicas: 4 | ||
selector: | ||
matchLabels: | ||
app: ping-app | ||
template: | ||
metadata: | ||
labels: | ||
app: ping-app | ||
spec: | ||
containers: | ||
- name: ping-container | ||
image: alpine:latest | ||
command: ["sh", "-c", "while true; do ping -c 1 google.com; sleep 1; done"] | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ping-service-1 | ||
spec: | ||
selector: | ||
app: ping-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ping-service-2 | ||
spec: | ||
selector: | ||
app: ping-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ping-service-3 | ||
spec: | ||
selector: | ||
app: ping-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: ping-service-4 | ||
spec: | ||
selector: | ||
app: ping-app | ||
ports: | ||
- protocol: TCP | ||
port: 80 | ||
targetPort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
image: kindest/node:v1.27.3 | ||
- role: worker | ||
image: kindest/node:v1.27.3 | ||
- role: worker | ||
image: kindest/node:v1.27.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: chaos-mesh.org/v1alpha1 | ||
kind: NetworkChaos | ||
metadata: | ||
name: introduce-latency-to-google | ||
namespace: default | ||
spec: | ||
action: delay | ||
mode: all | ||
selector: | ||
labelSelectors: | ||
app: ping-app | ||
delay: | ||
latency: "100ms" | ||
correlation: "100" | ||
jitter: "0ms" |
Oops, something went wrong.