From 05676af723be289213dd48d0615904be0d5c07aa Mon Sep 17 00:00:00 2001 From: g1eny0ung Date: Wed, 11 Sep 2024 08:34:28 +0000 Subject: [PATCH] Deploy website - based on 08b51f2b5732e27fada6f85cba73bc8bbca632cf --- 404.html | 2 +- assets/js/{02ac8add.1afd52de.js => 02ac8add.7f185f48.js} | 2 +- assets/js/06a15cdf.0aeda7fd.js | 1 - assets/js/06a15cdf.65afaa9c.js | 1 + assets/js/11b43341.490d9ea0.js | 1 - assets/js/11b43341.a6adf343.js | 1 + assets/js/{3116f78b.0b1a7631.js => 3116f78b.7182acc4.js} | 2 +- assets/js/349ca830.b8d8a21a.js | 1 + assets/js/349ca830.dbb8e693.js | 1 - assets/js/3d960ce6.8a1cc7bc.js | 1 + assets/js/3d960ce6.b84076ac.js | 1 - assets/js/{4965e7cb.db939d84.js => 4965e7cb.a8972dd3.js} | 2 +- assets/js/{562c697b.e6b81eb3.js => 562c697b.590e65bf.js} | 2 +- assets/js/5957e61f.5253e8ab.js | 1 + assets/js/5957e61f.94db3277.js | 1 - assets/js/601d4a49.244058d7.js | 1 - assets/js/601d4a49.2443b106.js | 1 + assets/js/{64a5caf2.568e8f28.js => 64a5caf2.1ca274de.js} | 2 +- assets/js/66d02352.bb93fa24.js | 1 + assets/js/66d02352.cb9e3c25.js | 1 - assets/js/{70329d25.3ece62e3.js => 70329d25.5e2a5308.js} | 2 +- assets/js/{70f04d34.02767032.js => 70f04d34.d2ca0803.js} | 2 +- assets/js/{73ba8788.e5efde6c.js => 73ba8788.68e69870.js} | 2 +- assets/js/8eb0ea08.3ffd40a4.js | 1 + assets/js/8eb0ea08.9007d712.js | 1 - assets/js/95e0ec25.3df64af7.js | 1 - assets/js/95e0ec25.a5e23818.js | 1 + assets/js/aa5a177c.d02d13e9.js | 1 - assets/js/aa5a177c.f9c33358.js | 1 + assets/js/{ac2bc92e.5583d1dd.js => ac2bc92e.93f8feda.js} | 2 +- assets/js/{ac400e52.afc2bad9.js => ac400e52.c663705e.js} | 2 +- assets/js/b14d964f.ac1ca1e6.js | 1 - assets/js/b14d964f.be35c3ea.js | 1 + assets/js/b60c2781.28c8fa79.js | 1 + assets/js/b60c2781.5bdc6f99.js | 1 - assets/js/{bc0eadd3.82bf308f.js => bc0eadd3.056e1aa3.js} | 2 +- assets/js/bda40383.8efb3d1f.js | 1 + assets/js/bda40383.c4a48734.js | 1 - assets/js/c143539c.0a08ab3a.js | 1 + assets/js/c143539c.b870f0d1.js | 1 - assets/js/{c44d6f6a.d2751cb9.js => c44d6f6a.4f6883d2.js} | 2 +- assets/js/ca94432f.6dc596e5.js | 1 - assets/js/ca94432f.ee175ffd.js | 1 + assets/js/d4b8d191.5077229f.js | 1 + assets/js/d4b8d191.57bb04fe.js | 1 - assets/js/{e0508589.52686267.js => e0508589.87880677.js} | 2 +- assets/js/{e84af1dc.20a86aa3.js => e84af1dc.23a0ff3c.js} | 2 +- assets/js/{e86885f1.dd8fb11a.js => e86885f1.7339d991.js} | 2 +- assets/js/{ea4c8659.9d441468.js => ea4c8659.c0415969.js} | 2 +- assets/js/ef21a7a0.520bc558.js | 1 - assets/js/ef21a7a0.b88f7ae6.js | 1 + assets/js/{efa120a1.cdead96d.js => efa120a1.d97a7b05.js} | 2 +- assets/js/{f25d6f58.d2dc3eb9.js => f25d6f58.b6279740.js} | 2 +- assets/js/f7309d15.400cff5c.js | 1 - assets/js/f7309d15.dea33b92.js | 1 + assets/js/fb790a05.19de27ad.js | 1 - assets/js/fb790a05.7f8c4ca7.js | 1 + ...{runtime~main.ed361a13.js => runtime~main.ee7b8624.js} | 2 +- .../index.html | 2 +- .../index.html | 2 +- blog/archive/index.html | 2 +- blog/authors/index.html | 2 +- .../better-observability-for-chaos-engineering/index.html | 2 +- blog/building_automated_testing_framework/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- blog/chaos-mesh-celebrates-100th-contributor/index.html | 2 +- blog/chaos-mesh-hacktoberfest-2021/index.html | 2 +- blog/chaos-mesh-join-cncf-sandbox-project/index.html | 2 +- blog/chaos-mesh-q&a/index.html | 2 +- blog/chaos-mesh-qa-at-kubecon-eu-2022/index.html | 2 +- .../index.html | 2 +- blog/chaos-mesh-x-hacktoberfest-2020/index.html | 2 +- .../chaos_mesh_your_chaos_engineering_solution/index.html | 2 +- blog/deploy-chaos-mesh-on-kubesphere/index.html | 2 +- blog/develop-a-daily-reporting-system/index.html | 2 +- blog/experience-as-a-chaos-mesh-lfx-mentee/index.html | 2 +- .../index.html | 2 +- blog/how-to-efficiently-stress-test-pod-memory/index.html | 2 +- blog/how-to-simulate-io-faults-at-runtime/index.html | 2 +- blog/implement-chaos-engineering-in-k8s/index.html | 2 +- blog/index.html | 2 +- blog/lfx-mentorship-enriching-awschaos/index.html | 2 +- blog/page/2/index.html | 2 +- blog/page/3/index.html | 2 +- .../run-chaos-experiments-on-physical-machines/index.html | 2 +- blog/run_your_first_chaos_experiment/index.html | 2 +- .../index.html | 2 +- blog/share-your-chaos-mesh-story/index.html | 2 +- .../index.html | 2 +- blog/tags/announcement/index.html | 2 +- blog/tags/aws-chaos/index.html | 2 +- blog/tags/chaos-engineering/index.html | 2 +- blog/tags/chaos-engineering/page/2/index.html | 2 +- blog/tags/chaos-engineering/page/3/index.html | 2 +- blog/tags/chaos-mesh/index.html | 2 +- blog/tags/chaos-mesh/page/2/index.html | 2 +- blog/tags/chaos-mesh/page/3/index.html | 2 +- blog/tags/chaosd/index.html | 2 +- blog/tags/ci/index.html | 2 +- blog/tags/cloud-native-con/index.html | 2 +- blog/tags/cloud-native/index.html | 2 +- blog/tags/cncf/index.html | 2 +- blog/tags/community/index.html | 2 +- blog/tags/distributed-system/index.html | 2 +- blog/tags/fault-injection/index.html | 2 +- blog/tags/git-hub-actions/index.html | 2 +- blog/tags/index.html | 2 +- blog/tags/kube-con/index.html | 2 +- blog/tags/kubernetes/index.html | 2 +- blog/tags/lfx-mentorship/index.html | 2 +- blog/tags/monitoring-metrics/index.html | 2 +- blog/tags/open-source/index.html | 2 +- blog/tags/stress-chaos/index.html | 2 +- blog/tags/stress-testing/index.html | 2 +- blog/tags/test-automation/index.html | 2 +- blog/tags/tutorials/index.html | 2 +- blog/tags/use-cases/index.html | 2 +- docs/2.4.3/add-new-chaos-experiment-type/index.html | 2 +- docs/2.4.3/basic-features/index.html | 4 ++-- docs/2.4.3/chaos-engineering-principles/index.html | 2 +- docs/2.4.3/chaosctl-tool/index.html | 2 +- docs/2.4.3/chaosd-overview/index.html | 2 +- docs/2.4.3/chaosd-search-recover/index.html | 6 +++--- docs/2.4.3/check-workflow-status/index.html | 2 +- docs/2.4.3/clean-up-chaos-experiments/index.html | 2 +- docs/2.4.3/configure-development-environment/index.html | 2 +- docs/2.4.3/configure-enabled-namespace/index.html | 2 +- docs/2.4.3/create-chaos-mesh-workflow/index.html | 2 +- docs/2.4.3/define-chaos-experiment-scope/index.html | 8 ++++---- docs/2.4.3/define-scheduling-rules/index.html | 2 +- docs/2.4.3/define-workflow-scheduling-rules/index.html | 2 +- docs/2.4.3/developer-guide-overview/index.html | 2 +- docs/2.4.3/extend-chaos-daemon-interface/index.html | 2 +- docs/2.4.3/extend-chaosd/index.html | 2 +- docs/2.4.3/faqs/index.html | 2 +- docs/2.4.3/gcp-authentication/index.html | 2 +- docs/2.4.3/glossary/index.html | 2 +- docs/2.4.3/go-client/index.html | 2 +- docs/2.4.3/index.html | 2 +- docs/2.4.3/inspect-chaos-experiments/index.html | 4 ++-- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- docs/2.4.3/java-client/index.html | 2 +- docs/2.4.3/manage-user-permissions/index.html | 2 +- docs/2.4.3/multi-data-center-scenario/index.html | 2 +- docs/2.4.3/offline-installation/index.html | 2 +- docs/2.4.3/persistence-dashboard/index.html | 2 +- docs/2.4.3/production-installation-using-helm/index.html | 2 +- docs/2.4.3/python-client/index.html | 2 +- docs/2.4.3/quick-start/index.html | 2 +- docs/2.4.3/release-0.0.8/index.html | 2 +- docs/2.4.3/release-0.0.9/index.html | 2 +- docs/2.4.3/release-1.0.0/index.html | 2 +- docs/2.4.3/release-2.0.0/index.html | 2 +- docs/2.4.3/release-2.4-tracking/index.html | 2 +- docs/2.4.3/release-cycle/index.html | 2 +- docs/2.4.3/run-a-chaos-experiment/index.html | 2 +- docs/2.4.3/run-serial-or-parallel-experiments/index.html | 2 +- docs/2.4.3/rust-client/index.html | 2 +- docs/2.4.3/send-http-request-on-workflow/index.html | 2 +- docs/2.4.3/simulate-aws-chaos/index.html | 2 +- docs/2.4.3/simulate-azure-chaos/index.html | 2 +- docs/2.4.3/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- docs/2.4.3/simulate-dns-chaos-on-kubernetes/index.html | 2 +- .../simulate-file-chaos-in-physical-nodes/index.html | 2 +- docs/2.4.3/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- docs/2.4.3/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- docs/2.4.3/simulate-http-chaos-on-kubernetes/index.html | 2 +- docs/2.4.3/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 8 ++++---- docs/2.4.3/simulate-jvm-application-chaos/index.html | 6 +++--- docs/2.4.3/simulate-kernel-chaos-on-kubernetes/index.html | 4 ++-- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- .../2.4.3/simulate-network-chaos-on-kubernetes/index.html | 4 ++-- docs/2.4.3/simulate-physical-machine-chaos/index.html | 2 +- docs/2.4.3/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- .../simulate-redis-chaos-on-physical-nodes/index.html | 2 +- docs/2.4.3/simulate-time-chaos-on-kubernetes/index.html | 2 +- .../simulate-time-chaos-on-physical-nodes/index.html | 2 +- docs/2.4.3/status-check-in-workflow/index.html | 2 +- docs/2.4.3/troubleshooting-guide/index.html | 2 +- docs/2.4.3/uninstallation/index.html | 2 +- docs/2.4.3/upgrade-from-2.1-to-2.2/index.html | 2 +- docs/2.4.3/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- docs/2.4.3/use-grafana-data-source/index.html | 2 +- docs/2.5.2/add-new-chaos-experiment-type/index.html | 2 +- docs/2.5.2/basic-features/index.html | 2 +- docs/2.5.2/chaos-engineering-principles/index.html | 2 +- docs/2.5.2/chaosctl-tool/index.html | 2 +- docs/2.5.2/chaosd-overview/index.html | 2 +- docs/2.5.2/chaosd-search-recover/index.html | 6 +++--- docs/2.5.2/check-workflow-status/index.html | 2 +- docs/2.5.2/clean-up-chaos-experiments/index.html | 2 +- docs/2.5.2/configure-development-environment/index.html | 2 +- docs/2.5.2/configure-enabled-namespace/index.html | 2 +- docs/2.5.2/create-chaos-mesh-workflow/index.html | 2 +- docs/2.5.2/define-chaos-experiment-scope/index.html | 8 ++++---- docs/2.5.2/define-scheduling-rules/index.html | 2 +- docs/2.5.2/define-workflow-scheduling-rules/index.html | 2 +- docs/2.5.2/developer-guide-overview/index.html | 2 +- docs/2.5.2/extend-chaos-daemon-interface/index.html | 2 +- docs/2.5.2/extend-chaosd/index.html | 2 +- docs/2.5.2/faqs/index.html | 2 +- docs/2.5.2/gcp-authentication/index.html | 2 +- docs/2.5.2/glossary/index.html | 2 +- docs/2.5.2/go-client/index.html | 2 +- docs/2.5.2/index.html | 2 +- docs/2.5.2/inspect-chaos-experiments/index.html | 4 ++-- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- docs/2.5.2/java-client/index.html | 2 +- docs/2.5.2/manage-user-permissions/index.html | 2 +- docs/2.5.2/multi-data-center-scenario/index.html | 2 +- docs/2.5.2/offline-installation/index.html | 2 +- docs/2.5.2/persistence-dashboard/index.html | 2 +- docs/2.5.2/production-installation-using-helm/index.html | 2 +- docs/2.5.2/python-client/index.html | 2 +- docs/2.5.2/quick-start/index.html | 2 +- docs/2.5.2/release-0.0.8/index.html | 2 +- docs/2.5.2/release-0.0.9/index.html | 2 +- docs/2.5.2/release-1.0.0/index.html | 2 +- docs/2.5.2/release-2.0.0/index.html | 2 +- docs/2.5.2/release-2.5-tracking/index.html | 2 +- docs/2.5.2/release-cycle/index.html | 2 +- docs/2.5.2/remote-cluster-management/index.html | 2 +- docs/2.5.2/run-a-chaos-experiment/index.html | 2 +- docs/2.5.2/run-serial-or-parallel-experiments/index.html | 2 +- docs/2.5.2/rust-client/index.html | 2 +- docs/2.5.2/send-http-request-on-workflow/index.html | 2 +- docs/2.5.2/simulate-aws-chaos/index.html | 2 +- docs/2.5.2/simulate-azure-chaos/index.html | 2 +- docs/2.5.2/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- docs/2.5.2/simulate-dns-chaos-on-kubernetes/index.html | 2 +- .../simulate-file-chaos-in-physical-nodes/index.html | 2 +- docs/2.5.2/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- docs/2.5.2/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- docs/2.5.2/simulate-http-chaos-on-kubernetes/index.html | 2 +- docs/2.5.2/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 8 ++++---- docs/2.5.2/simulate-jvm-application-chaos/index.html | 6 +++--- docs/2.5.2/simulate-kernel-chaos-on-kubernetes/index.html | 4 ++-- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- .../2.5.2/simulate-network-chaos-on-kubernetes/index.html | 4 ++-- docs/2.5.2/simulate-physical-machine-chaos/index.html | 2 +- docs/2.5.2/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- .../simulate-redis-chaos-on-physical-nodes/index.html | 2 +- docs/2.5.2/simulate-time-chaos-on-kubernetes/index.html | 2 +- .../simulate-time-chaos-on-physical-nodes/index.html | 2 +- docs/2.5.2/status-check-in-workflow/index.html | 2 +- docs/2.5.2/troubleshooting-guide/index.html | 2 +- docs/2.5.2/uninstallation/index.html | 2 +- docs/2.5.2/upgrade-from-2.1-to-2.2/index.html | 2 +- docs/2.5.2/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- docs/2.5.2/use-grafana-data-source/index.html | 2 +- docs/add-new-chaos-experiment-type/index.html | 2 +- docs/basic-features/index.html | 4 ++-- docs/chaos-engineering-principles/index.html | 2 +- docs/chaosctl-tool/index.html | 2 +- docs/chaosd-overview/index.html | 2 +- docs/chaosd-search-recover/index.html | 6 +++--- docs/check-workflow-status/index.html | 2 +- docs/clean-up-chaos-experiments/index.html | 2 +- docs/configure-development-environment/index.html | 2 +- docs/configure-enabled-namespace/index.html | 2 +- docs/create-chaos-mesh-workflow/index.html | 2 +- docs/define-chaos-experiment-scope/index.html | 8 ++++---- docs/define-scheduling-rules/index.html | 2 +- docs/define-workflow-scheduling-rules/index.html | 2 +- docs/developer-guide-overview/index.html | 2 +- docs/expose-dashboard-with-ingress/index.html | 2 +- docs/extend-chaos-daemon-interface/index.html | 2 +- docs/extend-chaosd/index.html | 2 +- docs/faqs/index.html | 2 +- docs/gcp-authentication/index.html | 2 +- docs/glossary/index.html | 2 +- docs/go-client/index.html | 2 +- docs/index.html | 2 +- docs/inspect-chaos-experiments/index.html | 4 ++-- docs/integrate-chaos-mesh-into-github-actions/index.html | 2 +- docs/java-client/index.html | 2 +- docs/manage-user-permissions/index.html | 2 +- docs/multi-data-center-scenario/index.html | 2 +- docs/next/add-new-chaos-experiment-type/index.html | 2 +- docs/next/basic-features/index.html | 4 ++-- docs/next/chaos-engineering-principles/index.html | 2 +- docs/next/chaosctl-tool/index.html | 2 +- docs/next/chaosd-overview/index.html | 2 +- docs/next/chaosd-search-recover/index.html | 6 +++--- docs/next/check-workflow-status/index.html | 2 +- docs/next/clean-up-chaos-experiments/index.html | 2 +- docs/next/configure-development-environment/index.html | 2 +- docs/next/configure-enabled-namespace/index.html | 2 +- docs/next/create-chaos-mesh-workflow/index.html | 2 +- docs/next/define-chaos-experiment-scope/index.html | 8 ++++---- docs/next/define-scheduling-rules/index.html | 2 +- docs/next/define-workflow-scheduling-rules/index.html | 2 +- docs/next/developer-guide-overview/index.html | 2 +- docs/next/expose-dashboard-with-ingress/index.html | 2 +- docs/next/extend-chaos-daemon-interface/index.html | 2 +- docs/next/extend-chaosd/index.html | 2 +- docs/next/faqs/index.html | 2 +- docs/next/gcp-authentication/index.html | 2 +- docs/next/glossary/index.html | 2 +- docs/next/go-client/index.html | 2 +- docs/next/index.html | 2 +- docs/next/inspect-chaos-experiments/index.html | 4 ++-- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- docs/next/java-client/index.html | 2 +- docs/next/manage-user-permissions/index.html | 2 +- docs/next/multi-data-center-scenario/index.html | 2 +- docs/next/offline-installation/index.html | 2 +- docs/next/persistence-dashboard/index.html | 2 +- docs/next/production-installation-using-helm/index.html | 2 +- docs/next/python-client/index.html | 2 +- docs/next/quick-start/index.html | 2 +- docs/next/release-0.0.8/index.html | 2 +- docs/next/release-0.0.9/index.html | 2 +- docs/next/release-1.0.0/index.html | 2 +- docs/next/release-2.0.0/index.html | 2 +- docs/next/release-2.5-tracking/index.html | 2 +- docs/next/release-cycle/index.html | 2 +- docs/next/remote-cluster-management/index.html | 2 +- docs/next/run-a-chaos-experiment/index.html | 2 +- docs/next/run-serial-or-parallel-experiments/index.html | 2 +- docs/next/rust-client/index.html | 2 +- docs/next/send-http-request-on-workflow/index.html | 2 +- docs/next/simulate-aws-chaos/index.html | 2 +- docs/next/simulate-azure-chaos/index.html | 2 +- docs/next/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- docs/next/simulate-dns-chaos-on-kubernetes/index.html | 4 ++-- .../next/simulate-file-chaos-in-physical-nodes/index.html | 2 +- docs/next/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- docs/next/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- docs/next/simulate-http-chaos-on-kubernetes/index.html | 2 +- docs/next/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 8 ++++---- docs/next/simulate-jvm-application-chaos/index.html | 6 +++--- docs/next/simulate-kernel-chaos-on-kubernetes/index.html | 4 ++-- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- docs/next/simulate-network-chaos-on-kubernetes/index.html | 4 ++-- docs/next/simulate-physical-machine-chaos/index.html | 2 +- docs/next/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- .../simulate-redis-chaos-on-physical-nodes/index.html | 2 +- docs/next/simulate-time-chaos-on-kubernetes/index.html | 2 +- .../next/simulate-time-chaos-on-physical-nodes/index.html | 2 +- docs/next/status-check-in-workflow/index.html | 2 +- docs/next/troubleshooting-guide/index.html | 2 +- docs/next/uninstallation/index.html | 2 +- docs/next/upgrade-from-2.1-to-2.2/index.html | 2 +- docs/next/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- docs/next/use-grafana-data-source/index.html | 2 +- docs/offline-installation/index.html | 2 +- docs/persistence-dashboard/index.html | 2 +- docs/production-installation-using-helm/index.html | 2 +- docs/python-client/index.html | 2 +- docs/quick-start/index.html | 2 +- docs/release-0.0.8/index.html | 2 +- docs/release-0.0.9/index.html | 2 +- docs/release-1.0.0/index.html | 2 +- docs/release-2.0.0/index.html | 2 +- docs/release-2.5-tracking/index.html | 2 +- docs/release-cycle/index.html | 2 +- docs/remote-cluster-management/index.html | 2 +- docs/run-a-chaos-experiment/index.html | 2 +- docs/run-serial-or-parallel-experiments/index.html | 2 +- docs/rust-client/index.html | 2 +- docs/send-http-request-on-workflow/index.html | 2 +- docs/simulate-aws-chaos/index.html | 2 +- docs/simulate-azure-chaos/index.html | 2 +- docs/simulate-block-chaos-on-kubernetes/index.html | 2 +- docs/simulate-disk-pressure-in-physical-nodes/index.html | 2 +- docs/simulate-dns-chaos-on-kubernetes/index.html | 4 ++-- docs/simulate-file-chaos-in-physical-nodes/index.html | 2 +- docs/simulate-gcp-chaos/index.html | 2 +- docs/simulate-heavy-stress-in-physical-nodes/index.html | 2 +- docs/simulate-heavy-stress-on-kubernetes/index.html | 2 +- docs/simulate-host-console-in-physical-nodes/index.html | 2 +- docs/simulate-http-chaos-on-kubernetes/index.html | 2 +- docs/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 8 ++++---- docs/simulate-jvm-application-chaos/index.html | 6 +++--- docs/simulate-kernel-chaos-on-kubernetes/index.html | 4 ++-- docs/simulate-network-chaos-in-physical-nodes/index.html | 2 +- docs/simulate-network-chaos-on-kubernetes/index.html | 4 ++-- docs/simulate-physical-machine-chaos/index.html | 2 +- docs/simulate-pod-chaos-on-kubernetes/index.html | 2 +- docs/simulate-process-chaos-in-physical-nodes/index.html | 2 +- docs/simulate-redis-chaos-on-physical-nodes/index.html | 2 +- docs/simulate-time-chaos-on-kubernetes/index.html | 2 +- docs/simulate-time-chaos-on-physical-nodes/index.html | 2 +- docs/status-check-in-workflow/index.html | 2 +- docs/troubleshooting-guide/index.html | 2 +- docs/uninstallation/index.html | 2 +- docs/upgrade-from-2.1-to-2.2/index.html | 2 +- docs/upgrade-to-2.0/index.html | 2 +- docs/use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- docs/use-grafana-data-source/index.html | 2 +- index.html | 2 +- search/index.html | 2 +- supported-releases/index.html | 2 +- versions/index.html | 2 +- zh/404.html | 2 +- .../js/{06d9ea2e.b25fe3c0.js => 06d9ea2e.9fe71376.js} | 2 +- .../js/{13a68f72.8d405040.js => 13a68f72.9139a0a2.js} | 2 +- .../js/{1532a764.1c826c4f.js => 1532a764.063aaacc.js} | 2 +- .../js/{340d9b9b.472bf492.js => 340d9b9b.fb47cf25.js} | 2 +- .../js/{39fd6d68.9a513201.js => 39fd6d68.bba96812.js} | 2 +- .../js/{7840d956.de3010ea.js => 7840d956.90166f16.js} | 2 +- .../js/{8048466c.c5e6fd62.js => 8048466c.e86a5133.js} | 2 +- .../js/{a0397745.85d6bd5d.js => a0397745.c60b490f.js} | 2 +- ...{runtime~main.7ecb5ab0.js => runtime~main.59bcb3b7.js} | 2 +- .../index.html | 2 +- .../index.html | 2 +- zh/blog/archive/index.html | 2 +- zh/blog/authors/index.html | 2 +- .../better-observability-for-chaos-engineering/index.html | 2 +- zh/blog/building_automated_testing_framework/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../chaos-mesh-celebrates-100th-contributor/index.html | 2 +- zh/blog/chaos-mesh-hacktoberfest-2021/index.html | 2 +- zh/blog/chaos-mesh-join-cncf-sandbox-project/index.html | 2 +- zh/blog/chaos-mesh-q&a/index.html | 2 +- zh/blog/chaos-mesh-qa-at-kubecon-eu-2022/index.html | 2 +- .../index.html | 2 +- zh/blog/chaos-mesh-x-hacktoberfest-2020/index.html | 2 +- .../chaos_mesh_your_chaos_engineering_solution/index.html | 2 +- zh/blog/deploy-chaos-mesh-on-kubesphere/index.html | 2 +- zh/blog/develop-a-daily-reporting-system/index.html | 2 +- zh/blog/experience-as-a-chaos-mesh-lfx-mentee/index.html | 2 +- .../index.html | 2 +- .../how-to-efficiently-stress-test-pod-memory/index.html | 2 +- zh/blog/how-to-simulate-io-faults-at-runtime/index.html | 2 +- zh/blog/implement-chaos-engineering-in-k8s/index.html | 2 +- zh/blog/index.html | 2 +- zh/blog/lfx-mentorship-enriching-awschaos/index.html | 2 +- zh/blog/page/2/index.html | 2 +- zh/blog/page/3/index.html | 2 +- .../run-chaos-experiments-on-physical-machines/index.html | 2 +- zh/blog/run_your_first_chaos_experiment/index.html | 2 +- .../index.html | 2 +- zh/blog/share-your-chaos-mesh-story/index.html | 2 +- .../index.html | 2 +- zh/blog/tags/announcement/index.html | 2 +- zh/blog/tags/aws-chaos/index.html | 2 +- zh/blog/tags/chaos-engineering/index.html | 2 +- zh/blog/tags/chaos-engineering/page/2/index.html | 2 +- zh/blog/tags/chaos-engineering/page/3/index.html | 2 +- zh/blog/tags/chaos-mesh/index.html | 2 +- zh/blog/tags/chaos-mesh/page/2/index.html | 2 +- zh/blog/tags/chaos-mesh/page/3/index.html | 2 +- zh/blog/tags/chaosd/index.html | 2 +- zh/blog/tags/ci/index.html | 2 +- zh/blog/tags/cloud-native-con/index.html | 2 +- zh/blog/tags/cloud-native/index.html | 2 +- zh/blog/tags/cncf/index.html | 2 +- zh/blog/tags/community/index.html | 2 +- zh/blog/tags/distributed-system/index.html | 2 +- zh/blog/tags/fault-injection/index.html | 2 +- zh/blog/tags/git-hub-actions/index.html | 2 +- zh/blog/tags/index.html | 2 +- zh/blog/tags/kube-con/index.html | 2 +- zh/blog/tags/kubernetes/index.html | 2 +- zh/blog/tags/lfx-mentorship/index.html | 2 +- zh/blog/tags/monitoring-metrics/index.html | 2 +- zh/blog/tags/open-source/index.html | 2 +- zh/blog/tags/stress-chaos/index.html | 2 +- zh/blog/tags/stress-testing/index.html | 2 +- zh/blog/tags/test-automation/index.html | 2 +- zh/blog/tags/tutorials/index.html | 2 +- zh/blog/tags/use-cases/index.html | 2 +- zh/docs/2.4.3/add-new-chaos-experiment-type/index.html | 2 +- zh/docs/2.4.3/basic-features/index.html | 2 +- zh/docs/2.4.3/chaos-engineering-principles/index.html | 2 +- zh/docs/2.4.3/chaosctl-tool/index.html | 2 +- zh/docs/2.4.3/chaosd-overview/index.html | 2 +- zh/docs/2.4.3/chaosd-search-recover/index.html | 2 +- zh/docs/2.4.3/check-workflow-status/index.html | 2 +- zh/docs/2.4.3/clean-up-chaos-experiments/index.html | 2 +- .../2.4.3/configure-development-environment/index.html | 2 +- zh/docs/2.4.3/configure-enabled-namespace/index.html | 2 +- zh/docs/2.4.3/create-chaos-mesh-workflow/index.html | 2 +- zh/docs/2.4.3/define-chaos-experiment-scope/index.html | 4 ++-- zh/docs/2.4.3/define-scheduling-rules/index.html | 2 +- zh/docs/2.4.3/define-workflow-scheduling-rules/index.html | 2 +- zh/docs/2.4.3/developer-guide-overview/index.html | 2 +- zh/docs/2.4.3/extend-chaos-daemon-interface/index.html | 2 +- zh/docs/2.4.3/extend-chaosd/index.html | 2 +- zh/docs/2.4.3/faqs/index.html | 2 +- zh/docs/2.4.3/gcp-authentication/index.html | 2 +- zh/docs/2.4.3/glossary/index.html | 2 +- zh/docs/2.4.3/go-client/index.html | 2 +- zh/docs/2.4.3/index.html | 2 +- zh/docs/2.4.3/inspect-chaos-experiments/index.html | 2 +- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- zh/docs/2.4.3/java-client/index.html | 2 +- zh/docs/2.4.3/manage-user-permissions/index.html | 2 +- zh/docs/2.4.3/multi-data-center-scenario/index.html | 2 +- zh/docs/2.4.3/offline-installation/index.html | 2 +- zh/docs/2.4.3/persistence-dashboard/index.html | 2 +- .../2.4.3/production-installation-using-helm/index.html | 2 +- zh/docs/2.4.3/python-client/index.html | 2 +- zh/docs/2.4.3/quick-start/index.html | 2 +- zh/docs/2.4.3/release-0.0.8/index.html | 2 +- zh/docs/2.4.3/release-0.0.9/index.html | 2 +- zh/docs/2.4.3/release-1.0.0/index.html | 2 +- zh/docs/2.4.3/release-2.0.0/index.html | 2 +- zh/docs/2.4.3/release-2.4-tracking/index.html | 2 +- zh/docs/2.4.3/release-cycle/index.html | 2 +- zh/docs/2.4.3/run-a-chaos-experiment/index.html | 2 +- .../2.4.3/run-serial-or-parallel-experiments/index.html | 2 +- zh/docs/2.4.3/rust-client/index.html | 2 +- zh/docs/2.4.3/send-http-request-on-workflow/index.html | 2 +- zh/docs/2.4.3/simulate-aws-chaos/index.html | 2 +- zh/docs/2.4.3/simulate-azure-chaos/index.html | 2 +- .../2.4.3/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- zh/docs/2.4.3/simulate-dns-chaos-on-kubernetes/index.html | 2 +- .../simulate-file-chaos-in-physical-nodes/index.html | 2 +- zh/docs/2.4.3/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- .../2.4.3/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- .../2.4.3/simulate-http-chaos-on-kubernetes/index.html | 2 +- zh/docs/2.4.3/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 2 +- zh/docs/2.4.3/simulate-jvm-application-chaos/index.html | 4 ++-- .../2.4.3/simulate-kernel-chaos-on-kubernetes/index.html | 2 +- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- .../2.4.3/simulate-network-chaos-on-kubernetes/index.html | 2 +- zh/docs/2.4.3/simulate-physical-machine-chaos/index.html | 2 +- zh/docs/2.4.3/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- .../simulate-redis-chaos-on-physical-nodes/index.html | 2 +- .../2.4.3/simulate-time-chaos-on-kubernetes/index.html | 2 +- .../simulate-time-chaos-on-physical-nodes/index.html | 2 +- zh/docs/2.4.3/status-check-in-workflow/index.html | 2 +- zh/docs/2.4.3/troubleshooting-guide/index.html | 2 +- zh/docs/2.4.3/uninstallation/index.html | 2 +- zh/docs/2.4.3/upgrade-from-2.1-to-2.2/index.html | 2 +- zh/docs/2.4.3/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- zh/docs/2.4.3/use-grafana-data-source/index.html | 2 +- zh/docs/2.5.2/add-new-chaos-experiment-type/index.html | 2 +- zh/docs/2.5.2/basic-features/index.html | 2 +- zh/docs/2.5.2/chaos-engineering-principles/index.html | 2 +- zh/docs/2.5.2/chaosctl-tool/index.html | 2 +- zh/docs/2.5.2/chaosd-overview/index.html | 2 +- zh/docs/2.5.2/chaosd-search-recover/index.html | 2 +- zh/docs/2.5.2/check-workflow-status/index.html | 2 +- zh/docs/2.5.2/clean-up-chaos-experiments/index.html | 2 +- .../2.5.2/configure-development-environment/index.html | 2 +- zh/docs/2.5.2/configure-enabled-namespace/index.html | 2 +- zh/docs/2.5.2/create-chaos-mesh-workflow/index.html | 2 +- zh/docs/2.5.2/define-chaos-experiment-scope/index.html | 4 ++-- zh/docs/2.5.2/define-scheduling-rules/index.html | 2 +- zh/docs/2.5.2/define-workflow-scheduling-rules/index.html | 2 +- zh/docs/2.5.2/developer-guide-overview/index.html | 2 +- zh/docs/2.5.2/extend-chaos-daemon-interface/index.html | 2 +- zh/docs/2.5.2/extend-chaosd/index.html | 2 +- zh/docs/2.5.2/faqs/index.html | 2 +- zh/docs/2.5.2/gcp-authentication/index.html | 2 +- zh/docs/2.5.2/glossary/index.html | 2 +- zh/docs/2.5.2/go-client/index.html | 2 +- zh/docs/2.5.2/index.html | 2 +- zh/docs/2.5.2/inspect-chaos-experiments/index.html | 2 +- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- zh/docs/2.5.2/java-client/index.html | 2 +- zh/docs/2.5.2/manage-user-permissions/index.html | 2 +- zh/docs/2.5.2/multi-data-center-scenario/index.html | 2 +- zh/docs/2.5.2/offline-installation/index.html | 2 +- zh/docs/2.5.2/persistence-dashboard/index.html | 2 +- .../2.5.2/production-installation-using-helm/index.html | 2 +- zh/docs/2.5.2/python-client/index.html | 2 +- zh/docs/2.5.2/quick-start/index.html | 2 +- zh/docs/2.5.2/release-0.0.8/index.html | 2 +- zh/docs/2.5.2/release-0.0.9/index.html | 2 +- zh/docs/2.5.2/release-1.0.0/index.html | 2 +- zh/docs/2.5.2/release-2.0.0/index.html | 2 +- zh/docs/2.5.2/release-2.5-tracking/index.html | 2 +- zh/docs/2.5.2/release-cycle/index.html | 2 +- zh/docs/2.5.2/remote-cluster-management/index.html | 2 +- zh/docs/2.5.2/run-a-chaos-experiment/index.html | 2 +- .../2.5.2/run-serial-or-parallel-experiments/index.html | 2 +- zh/docs/2.5.2/rust-client/index.html | 2 +- zh/docs/2.5.2/send-http-request-on-workflow/index.html | 2 +- zh/docs/2.5.2/simulate-aws-chaos/index.html | 2 +- zh/docs/2.5.2/simulate-azure-chaos/index.html | 2 +- .../2.5.2/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- zh/docs/2.5.2/simulate-dns-chaos-on-kubernetes/index.html | 2 +- .../simulate-file-chaos-in-physical-nodes/index.html | 2 +- zh/docs/2.5.2/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- .../2.5.2/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- .../2.5.2/simulate-http-chaos-on-kubernetes/index.html | 2 +- zh/docs/2.5.2/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 2 +- zh/docs/2.5.2/simulate-jvm-application-chaos/index.html | 4 ++-- .../2.5.2/simulate-kernel-chaos-on-kubernetes/index.html | 2 +- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- .../2.5.2/simulate-network-chaos-on-kubernetes/index.html | 2 +- zh/docs/2.5.2/simulate-physical-machine-chaos/index.html | 2 +- zh/docs/2.5.2/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- .../simulate-redis-chaos-on-physical-nodes/index.html | 2 +- .../2.5.2/simulate-time-chaos-on-kubernetes/index.html | 2 +- .../simulate-time-chaos-on-physical-nodes/index.html | 2 +- zh/docs/2.5.2/status-check-in-workflow/index.html | 2 +- zh/docs/2.5.2/troubleshooting-guide/index.html | 2 +- zh/docs/2.5.2/uninstallation/index.html | 2 +- zh/docs/2.5.2/upgrade-from-2.1-to-2.2/index.html | 2 +- zh/docs/2.5.2/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- zh/docs/2.5.2/use-grafana-data-source/index.html | 2 +- zh/docs/add-new-chaos-experiment-type/index.html | 2 +- zh/docs/basic-features/index.html | 2 +- zh/docs/chaos-engineering-principles/index.html | 2 +- zh/docs/chaosctl-tool/index.html | 2 +- zh/docs/chaosd-overview/index.html | 2 +- zh/docs/chaosd-search-recover/index.html | 2 +- zh/docs/check-workflow-status/index.html | 2 +- zh/docs/clean-up-chaos-experiments/index.html | 2 +- zh/docs/configure-development-environment/index.html | 2 +- zh/docs/configure-enabled-namespace/index.html | 2 +- zh/docs/create-chaos-mesh-workflow/index.html | 2 +- zh/docs/define-chaos-experiment-scope/index.html | 4 ++-- zh/docs/define-scheduling-rules/index.html | 2 +- zh/docs/define-workflow-scheduling-rules/index.html | 2 +- zh/docs/developer-guide-overview/index.html | 2 +- zh/docs/expose-dashboard-with-ingress/index.html | 2 +- zh/docs/extend-chaos-daemon-interface/index.html | 2 +- zh/docs/extend-chaosd/index.html | 2 +- zh/docs/faqs/index.html | 2 +- zh/docs/gcp-authentication/index.html | 2 +- zh/docs/glossary/index.html | 2 +- zh/docs/go-client/index.html | 2 +- zh/docs/index.html | 2 +- zh/docs/inspect-chaos-experiments/index.html | 2 +- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- zh/docs/java-client/index.html | 2 +- zh/docs/manage-user-permissions/index.html | 2 +- zh/docs/multi-data-center-scenario/index.html | 2 +- zh/docs/next/add-new-chaos-experiment-type/index.html | 2 +- zh/docs/next/basic-features/index.html | 2 +- zh/docs/next/chaos-engineering-principles/index.html | 2 +- zh/docs/next/chaosctl-tool/index.html | 2 +- zh/docs/next/chaosd-overview/index.html | 2 +- zh/docs/next/chaosd-search-recover/index.html | 2 +- zh/docs/next/check-workflow-status/index.html | 2 +- zh/docs/next/clean-up-chaos-experiments/index.html | 2 +- zh/docs/next/configure-development-environment/index.html | 2 +- zh/docs/next/configure-enabled-namespace/index.html | 2 +- zh/docs/next/create-chaos-mesh-workflow/index.html | 2 +- zh/docs/next/define-chaos-experiment-scope/index.html | 4 ++-- zh/docs/next/define-scheduling-rules/index.html | 2 +- zh/docs/next/define-workflow-scheduling-rules/index.html | 2 +- zh/docs/next/developer-guide-overview/index.html | 2 +- zh/docs/next/expose-dashboard-with-ingress/index.html | 2 +- zh/docs/next/extend-chaos-daemon-interface/index.html | 2 +- zh/docs/next/extend-chaosd/index.html | 2 +- zh/docs/next/faqs/index.html | 2 +- zh/docs/next/gcp-authentication/index.html | 2 +- zh/docs/next/glossary/index.html | 2 +- zh/docs/next/go-client/index.html | 2 +- zh/docs/next/index.html | 2 +- zh/docs/next/inspect-chaos-experiments/index.html | 2 +- .../integrate-chaos-mesh-into-github-actions/index.html | 2 +- zh/docs/next/java-client/index.html | 2 +- zh/docs/next/manage-user-permissions/index.html | 2 +- zh/docs/next/multi-data-center-scenario/index.html | 2 +- zh/docs/next/offline-installation/index.html | 2 +- zh/docs/next/persistence-dashboard/index.html | 2 +- .../next/production-installation-using-helm/index.html | 2 +- zh/docs/next/python-client/index.html | 2 +- zh/docs/next/quick-start/index.html | 2 +- zh/docs/next/release-0.0.8/index.html | 2 +- zh/docs/next/release-0.0.9/index.html | 2 +- zh/docs/next/release-1.0.0/index.html | 2 +- zh/docs/next/release-2.0.0/index.html | 2 +- zh/docs/next/release-2.5-tracking/index.html | 2 +- zh/docs/next/release-cycle/index.html | 2 +- zh/docs/next/remote-cluster-management/index.html | 2 +- zh/docs/next/run-a-chaos-experiment/index.html | 2 +- .../next/run-serial-or-parallel-experiments/index.html | 2 +- zh/docs/next/rust-client/index.html | 2 +- zh/docs/next/send-http-request-on-workflow/index.html | 2 +- zh/docs/next/simulate-aws-chaos/index.html | 2 +- zh/docs/next/simulate-azure-chaos/index.html | 2 +- .../next/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- zh/docs/next/simulate-dns-chaos-on-kubernetes/index.html | 2 +- .../next/simulate-file-chaos-in-physical-nodes/index.html | 2 +- zh/docs/next/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- .../next/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- zh/docs/next/simulate-http-chaos-on-kubernetes/index.html | 2 +- zh/docs/next/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 2 +- zh/docs/next/simulate-jvm-application-chaos/index.html | 4 ++-- .../next/simulate-kernel-chaos-on-kubernetes/index.html | 2 +- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- .../next/simulate-network-chaos-on-kubernetes/index.html | 2 +- zh/docs/next/simulate-physical-machine-chaos/index.html | 2 +- zh/docs/next/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- .../simulate-redis-chaos-on-physical-nodes/index.html | 2 +- zh/docs/next/simulate-time-chaos-on-kubernetes/index.html | 2 +- .../next/simulate-time-chaos-on-physical-nodes/index.html | 2 +- zh/docs/next/status-check-in-workflow/index.html | 2 +- zh/docs/next/troubleshooting-guide/index.html | 2 +- zh/docs/next/uninstallation/index.html | 2 +- zh/docs/next/upgrade-from-2.1-to-2.2/index.html | 2 +- zh/docs/next/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- zh/docs/next/use-grafana-data-source/index.html | 2 +- zh/docs/offline-installation/index.html | 2 +- zh/docs/persistence-dashboard/index.html | 2 +- zh/docs/production-installation-using-helm/index.html | 2 +- zh/docs/python-client/index.html | 2 +- zh/docs/quick-start/index.html | 2 +- zh/docs/release-0.0.8/index.html | 2 +- zh/docs/release-0.0.9/index.html | 2 +- zh/docs/release-1.0.0/index.html | 2 +- zh/docs/release-2.0.0/index.html | 2 +- zh/docs/release-2.5-tracking/index.html | 2 +- zh/docs/release-cycle/index.html | 2 +- zh/docs/remote-cluster-management/index.html | 2 +- zh/docs/run-a-chaos-experiment/index.html | 2 +- zh/docs/run-serial-or-parallel-experiments/index.html | 2 +- zh/docs/rust-client/index.html | 2 +- zh/docs/send-http-request-on-workflow/index.html | 2 +- zh/docs/simulate-aws-chaos/index.html | 2 +- zh/docs/simulate-azure-chaos/index.html | 2 +- zh/docs/simulate-block-chaos-on-kubernetes/index.html | 2 +- .../simulate-disk-pressure-in-physical-nodes/index.html | 2 +- zh/docs/simulate-dns-chaos-on-kubernetes/index.html | 2 +- zh/docs/simulate-file-chaos-in-physical-nodes/index.html | 2 +- zh/docs/simulate-gcp-chaos/index.html | 2 +- .../simulate-heavy-stress-in-physical-nodes/index.html | 2 +- zh/docs/simulate-heavy-stress-on-kubernetes/index.html | 2 +- .../simulate-host-console-in-physical-nodes/index.html | 2 +- zh/docs/simulate-http-chaos-on-kubernetes/index.html | 2 +- zh/docs/simulate-io-chaos-on-kubernetes/index.html | 2 +- .../index.html | 2 +- zh/docs/simulate-jvm-application-chaos/index.html | 4 ++-- zh/docs/simulate-kernel-chaos-on-kubernetes/index.html | 2 +- .../simulate-network-chaos-in-physical-nodes/index.html | 2 +- zh/docs/simulate-network-chaos-on-kubernetes/index.html | 2 +- zh/docs/simulate-physical-machine-chaos/index.html | 2 +- zh/docs/simulate-pod-chaos-on-kubernetes/index.html | 2 +- .../simulate-process-chaos-in-physical-nodes/index.html | 2 +- zh/docs/simulate-redis-chaos-on-physical-nodes/index.html | 2 +- zh/docs/simulate-time-chaos-on-kubernetes/index.html | 2 +- zh/docs/simulate-time-chaos-on-physical-nodes/index.html | 2 +- zh/docs/status-check-in-workflow/index.html | 2 +- zh/docs/troubleshooting-guide/index.html | 2 +- zh/docs/uninstallation/index.html | 2 +- zh/docs/upgrade-from-2.1-to-2.2/index.html | 2 +- zh/docs/upgrade-to-2.0/index.html | 2 +- .../use-argo-to-orchestrate-chaos-experiments/index.html | 2 +- zh/docs/use-grafana-data-source/index.html | 2 +- zh/index.html | 2 +- zh/search/index.html | 2 +- zh/supported-releases/index.html | 2 +- zh/versions/index.html | 2 +- 788 files changed, 834 insertions(+), 834 deletions(-) rename assets/js/{02ac8add.1afd52de.js => 02ac8add.7f185f48.js} (99%) delete mode 100644 assets/js/06a15cdf.0aeda7fd.js create mode 100644 assets/js/06a15cdf.65afaa9c.js delete mode 100644 assets/js/11b43341.490d9ea0.js create mode 100644 assets/js/11b43341.a6adf343.js rename assets/js/{3116f78b.0b1a7631.js => 3116f78b.7182acc4.js} (99%) create mode 100644 assets/js/349ca830.b8d8a21a.js delete mode 100644 assets/js/349ca830.dbb8e693.js create mode 100644 assets/js/3d960ce6.8a1cc7bc.js delete mode 100644 assets/js/3d960ce6.b84076ac.js rename assets/js/{4965e7cb.db939d84.js => 4965e7cb.a8972dd3.js} (65%) rename assets/js/{562c697b.e6b81eb3.js => 562c697b.590e65bf.js} (64%) create mode 100644 assets/js/5957e61f.5253e8ab.js delete mode 100644 assets/js/5957e61f.94db3277.js delete mode 100644 assets/js/601d4a49.244058d7.js create mode 100644 assets/js/601d4a49.2443b106.js rename assets/js/{64a5caf2.568e8f28.js => 64a5caf2.1ca274de.js} (99%) create mode 100644 assets/js/66d02352.bb93fa24.js delete mode 100644 assets/js/66d02352.cb9e3c25.js rename assets/js/{70329d25.3ece62e3.js => 70329d25.5e2a5308.js} (64%) rename assets/js/{70f04d34.02767032.js => 70f04d34.d2ca0803.js} (99%) rename assets/js/{73ba8788.e5efde6c.js => 73ba8788.68e69870.js} (74%) create mode 100644 assets/js/8eb0ea08.3ffd40a4.js delete mode 100644 assets/js/8eb0ea08.9007d712.js delete mode 100644 assets/js/95e0ec25.3df64af7.js create mode 100644 assets/js/95e0ec25.a5e23818.js delete mode 100644 assets/js/aa5a177c.d02d13e9.js create mode 100644 assets/js/aa5a177c.f9c33358.js rename assets/js/{ac2bc92e.5583d1dd.js => ac2bc92e.93f8feda.js} (99%) rename assets/js/{ac400e52.afc2bad9.js => ac400e52.c663705e.js} (64%) delete mode 100644 assets/js/b14d964f.ac1ca1e6.js create mode 100644 assets/js/b14d964f.be35c3ea.js create mode 100644 assets/js/b60c2781.28c8fa79.js delete mode 100644 assets/js/b60c2781.5bdc6f99.js rename assets/js/{bc0eadd3.82bf308f.js => bc0eadd3.056e1aa3.js} (74%) create mode 100644 assets/js/bda40383.8efb3d1f.js delete mode 100644 assets/js/bda40383.c4a48734.js create mode 100644 assets/js/c143539c.0a08ab3a.js delete mode 100644 assets/js/c143539c.b870f0d1.js rename assets/js/{c44d6f6a.d2751cb9.js => c44d6f6a.4f6883d2.js} (74%) delete mode 100644 assets/js/ca94432f.6dc596e5.js create mode 100644 assets/js/ca94432f.ee175ffd.js create mode 100644 assets/js/d4b8d191.5077229f.js delete mode 100644 assets/js/d4b8d191.57bb04fe.js rename assets/js/{e0508589.52686267.js => e0508589.87880677.js} (99%) rename assets/js/{e84af1dc.20a86aa3.js => e84af1dc.23a0ff3c.js} (99%) rename assets/js/{e86885f1.dd8fb11a.js => e86885f1.7339d991.js} (99%) rename assets/js/{ea4c8659.9d441468.js => ea4c8659.c0415969.js} (99%) delete mode 100644 assets/js/ef21a7a0.520bc558.js create mode 100644 assets/js/ef21a7a0.b88f7ae6.js rename assets/js/{efa120a1.cdead96d.js => efa120a1.d97a7b05.js} (99%) rename assets/js/{f25d6f58.d2dc3eb9.js => f25d6f58.b6279740.js} (74%) delete mode 100644 assets/js/f7309d15.400cff5c.js create mode 100644 assets/js/f7309d15.dea33b92.js delete mode 100644 assets/js/fb790a05.19de27ad.js create mode 100644 assets/js/fb790a05.7f8c4ca7.js rename assets/js/{runtime~main.ed361a13.js => runtime~main.ee7b8624.js} (89%) rename zh/assets/js/{06d9ea2e.b25fe3c0.js => 06d9ea2e.9fe71376.js} (99%) rename zh/assets/js/{13a68f72.8d405040.js => 13a68f72.9139a0a2.js} (99%) rename zh/assets/js/{1532a764.1c826c4f.js => 1532a764.063aaacc.js} (99%) rename zh/assets/js/{340d9b9b.472bf492.js => 340d9b9b.fb47cf25.js} (99%) rename zh/assets/js/{39fd6d68.9a513201.js => 39fd6d68.bba96812.js} (99%) rename zh/assets/js/{7840d956.de3010ea.js => 7840d956.90166f16.js} (99%) rename zh/assets/js/{8048466c.c5e6fd62.js => 8048466c.e86a5133.js} (99%) rename zh/assets/js/{a0397745.85d6bd5d.js => a0397745.c60b490f.js} (99%) rename zh/assets/js/{runtime~main.7ecb5ab0.js => runtime~main.59bcb3b7.js} (97%) diff --git a/404.html b/404.html index edd4c55e66..a35216d4ae 100644 --- a/404.html +++ b/404.html @@ -16,7 +16,7 @@ - + diff --git a/assets/js/02ac8add.1afd52de.js b/assets/js/02ac8add.7f185f48.js similarity index 99% rename from assets/js/02ac8add.1afd52de.js rename to assets/js/02ac8add.7f185f48.js index dd4ce0982d..14902cea02 100644 --- a/assets/js/02ac8add.1afd52de.js +++ b/assets/js/02ac8add.7f185f48.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[184],{57120:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/docs/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/next/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-network-chaos-on-kubernetes.md",tags:[],version:"current",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/next/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/next/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Delay example",id:"delay-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Network Emulation example",id:"network-emulation-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"rate",id:"rate",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(43088).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(94027).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(733).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"delay-example",children:"Delay example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"network-emulation-example",children:"Network Emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"netem.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: network-emulation\nspec:\n action: netem\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n rate:\n rate: '10mbps'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds and a bandwidth limit of 10mbps in the network connections of the target Pods. In addition to latency and rate, the ",(0,i.jsx)(n.code,{children:"netem"})," action also supports packet loss, reorder and corruption."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./netem.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available vaules include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/next/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"}),", ",(0,i.jsx)(n.code,{children:"rate"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"rate",children:"rate"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"rate"})," means simulating bandwidth rate fault. This action is similar to ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth/rate"})," below, however, ",(0,i.jsxs)(n.strong,{children:["the key distinction is that this action can combine with other ",(0,i.jsx)(n.code,{children:"netem"})," actions listed above"]}),". However, if you require more control over the bandwidth simulation such as limiting the buffer size, check the ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth"})," action."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["This action is mutually exclusive with any ",(0,i.jsx)(n.code,{children:"netem"})," action defined above. If you need to inject bandwidth rate along with other network failures such as corruption, use the ",(0,i.jsx)(n.a,{href:"#rate",children:"rate"})," action instead."]})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},43088:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},733:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},94027:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[184],{57120:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/docs/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/next/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-network-chaos-on-kubernetes.md",tags:[],version:"current",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/next/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/next/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Delay example",id:"delay-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Network Emulation example",id:"network-emulation-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"rate",id:"rate",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(43088).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(94027).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(733).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"delay-example",children:"Delay example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"network-emulation-example",children:"Network Emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"netem.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: network-emulation\nspec:\n action: netem\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n rate:\n rate: '10mbps'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds and a bandwidth limit of 10mbps in the network connections of the target Pods. In addition to latency and rate, the ",(0,i.jsx)(n.code,{children:"netem"})," action also supports packet loss, reorder and corruption."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./netem.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available values include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/next/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"}),", ",(0,i.jsx)(n.code,{children:"rate"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"rate",children:"rate"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"rate"})," means simulating bandwidth rate fault. This action is similar to ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth/rate"})," below, however, ",(0,i.jsxs)(n.strong,{children:["the key distinction is that this action can combine with other ",(0,i.jsx)(n.code,{children:"netem"})," actions listed above"]}),". However, if you require more control over the bandwidth simulation such as limiting the buffer size, check the ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth"})," action."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["This action is mutually exclusive with any ",(0,i.jsx)(n.code,{children:"netem"})," action defined above. If you need to inject bandwidth rate along with other network failures such as corruption, use the ",(0,i.jsx)(n.a,{href:"#rate",children:"rate"})," action instead."]})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},43088:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},733:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},94027:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/06a15cdf.0aeda7fd.js b/assets/js/06a15cdf.0aeda7fd.js deleted file mode 100644 index 848f632c58..0000000000 --- a/assets/js/06a15cdf.0aeda7fd.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[9073],{22793:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/docs/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/next/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"current",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/next/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/next/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. Regarding to the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/06a15cdf.65afaa9c.js b/assets/js/06a15cdf.65afaa9c.js new file mode 100644 index 0000000000..3b608dafa8 --- /dev/null +++ b/assets/js/06a15cdf.65afaa9c.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[9073],{22793:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/docs/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/next/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"current",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/next/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/next/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. For more information about the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/11b43341.490d9ea0.js b/assets/js/11b43341.490d9ea0.js deleted file mode 100644 index 7517aebfa9..0000000000 --- a/assets/js/11b43341.490d9ea0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2256],{15293:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"2.6.4","label":"2.6.4","banner":null,"badge":true,"noIndex":false,"className":"docs-version-2.6.4","isLast":true,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Expose Chaos Dashboard with Ingress","href":"/docs/expose-dashboard-with-ingress","docId":"expose-dashboard-with-ingress","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"link","label":"Remote Cluster Management","href":"/docs/remote-cluster-management","docId":"remote-cluster-management","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Incidents","href":"/docs/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add a New Chaos Experiment Type","href":"/docs/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.5.0 Tracking","href":"/docs/release-2.5-tracking","docId":"release-2.5-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add a New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"The developer manual section may be out of date. If you find any problems or have any questions, please create an issue and let us know. Thank you for your contribution!","sidebar":"docs"},"expose-dashboard-with-ingress":{"id":"expose-dashboard-with-ingress","title":"Expose Chaos Dashboard with Ingress","description":"At times, you may need to make the Chaos Dashboard accessible to external users, while placing it under the subpath of your current monitoring dashboard.","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add a new chaos experiment type, you have added HelloWorldChaos, which can print Hello world! in the logs of Chaos Controller Manager.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.5-tracking":{"id":"release-2.5-tracking","title":"Chaos Mesh v2.5.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"remote-cluster-management":{"id":"remote-cluster-management","title":"Remote Cluster Management","description":"Remote Cluster Introduction","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Incidents","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and setup the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/11b43341.a6adf343.js b/assets/js/11b43341.a6adf343.js new file mode 100644 index 0000000000..449d9edf1e --- /dev/null +++ b/assets/js/11b43341.a6adf343.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2256],{15293:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"2.6.4","label":"2.6.4","banner":null,"badge":true,"noIndex":false,"className":"docs-version-2.6.4","isLast":true,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Expose Chaos Dashboard with Ingress","href":"/docs/expose-dashboard-with-ingress","docId":"expose-dashboard-with-ingress","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"link","label":"Remote Cluster Management","href":"/docs/remote-cluster-management","docId":"remote-cluster-management","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Incidents","href":"/docs/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add a New Chaos Experiment Type","href":"/docs/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.5.0 Tracking","href":"/docs/release-2.5-tracking","docId":"release-2.5-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add a New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"The developer manual section may be out of date. If you find any problems or have any questions, please create an issue and let us know. Thank you for your contribution!","sidebar":"docs"},"expose-dashboard-with-ingress":{"id":"expose-dashboard-with-ingress","title":"Expose Chaos Dashboard with Ingress","description":"At times, you may need to make the Chaos Dashboard accessible to external users, while placing it under the subpath of your current monitoring dashboard.","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add a new chaos experiment type, you have added HelloWorldChaos, which can print Hello world! in the logs of Chaos Controller Manager.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.5-tracking":{"id":"release-2.5-tracking","title":"Chaos Mesh v2.5.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"remote-cluster-management":{"id":"remote-cluster-management","title":"Remote Cluster Management","description":"Remote Cluster Introduction","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Incidents","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and setup the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/3116f78b.0b1a7631.js b/assets/js/3116f78b.7182acc4.js similarity index 99% rename from assets/js/3116f78b.0b1a7631.js rename to assets/js/3116f78b.7182acc4.js index 6fc828d5ba..59e1c68b84 100644 --- a/assets/js/3116f78b.0b1a7631.js +++ b/assets/js/3116f78b.7182acc4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[5017],{41213:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,a={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/docs/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/next/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"current",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/next/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/next/simulate-aws-chaos"}},o={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFOG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>a});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[5017],{41213:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>a,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,a={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/docs/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/next/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"current",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/next/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/next/simulate-aws-chaos"}},o={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFIG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>a});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/349ca830.b8d8a21a.js b/assets/js/349ca830.b8d8a21a.js new file mode 100644 index 0000000000..28a7a0adf4 --- /dev/null +++ b/assets/js/349ca830.b8d8a21a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[1196],{17118:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/versioned_docs/version-2.6.4/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/define-chaos-experiment-scope.md",tags:[],version:"2.6.4",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Remote Cluster Management",permalink:"/docs/remote-cluster-management"},next:{title:"Define Scheduling Rules",permalink:"/docs/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specify the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physical-machine-a\n - physical-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(56560).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},56560:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/349ca830.dbb8e693.js b/assets/js/349ca830.dbb8e693.js deleted file mode 100644 index 7100ef6a18..0000000000 --- a/assets/js/349ca830.dbb8e693.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[1196],{17118:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/versioned_docs/version-2.6.4/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/define-chaos-experiment-scope.md",tags:[],version:"2.6.4",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Remote Cluster Management",permalink:"/docs/remote-cluster-management"},next:{title:"Define Scheduling Rules",permalink:"/docs/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specifiy the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physcial-machine-a\n - physcial-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(56560).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},56560:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3d960ce6.8a1cc7bc.js b/assets/js/3d960ce6.8a1cc7bc.js new file mode 100644 index 0000000000..0e8c100f5a --- /dev/null +++ b/assets/js/3d960ce6.8a1cc7bc.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7821],{30381:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.6.4/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. For more information about the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/3d960ce6.b84076ac.js b/assets/js/3d960ce6.b84076ac.js deleted file mode 100644 index 391b2ba53e..0000000000 --- a/assets/js/3d960ce6.b84076ac.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7821],{30381:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.6.4/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. Regarding to the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/4965e7cb.db939d84.js b/assets/js/4965e7cb.a8972dd3.js similarity index 65% rename from assets/js/4965e7cb.db939d84.js rename to assets/js/4965e7cb.a8972dd3.js index ad99a8442c..c4614ff632 100644 --- a/assets/js/4965e7cb.db939d84.js +++ b/assets/js/4965e7cb.a8972dd3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[8530],{39727:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/docs/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/next/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-jvm-application-chaos.md",tags:[],version:"current",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/next/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/next/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(43088).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(67262).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(733).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is milisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"srting"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},43088:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},733:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},67262:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[8530],{39727:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/docs/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/next/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-jvm-application-chaos.md",tags:[],version:"current",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/next/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/next/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(43088).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(67262).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(733).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is millisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},43088:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},733:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},67262:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/562c697b.e6b81eb3.js b/assets/js/562c697b.590e65bf.js similarity index 64% rename from assets/js/562c697b.e6b81eb3.js rename to assets/js/562c697b.590e65bf.js index e51ceb50bf..27b2d481ba 100644 --- a/assets/js/562c697b.e6b81eb3.js +++ b/assets/js/562c697b.590e65bf.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2891],{75050:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.4.3/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/2.4.3/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-jvm-application-chaos.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/2.4.3/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(34747).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(62145).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(37198).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is milisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"srting"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},34747:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},37198:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},62145:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2891],{75050:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.4.3/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/2.4.3/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-jvm-application-chaos.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/2.4.3/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(34747).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(62145).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(37198).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is millisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},34747:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},37198:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},62145:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5957e61f.5253e8ab.js b/assets/js/5957e61f.5253e8ab.js new file mode 100644 index 0000000000..a5fe7b8a0f --- /dev/null +++ b/assets/js/5957e61f.5253e8ab.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7549],{29071:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>t,metadata:()=>r,toc:()=>c});var a=n(86070),i=n(6383);const t={title:"Basic Features"},o=void 0,r={id:"basic-features",title:"Basic Features",description:"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.",source:"@site/versioned_docs/version-2.6.4/basic-features.md",sourceDirName:".",slug:"/basic-features",permalink:"/docs/basic-features",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/basic-features.md",tags:[],version:"2.6.4",frontMatter:{title:"Basic Features"},sidebar:"docs",previous:{title:"Chaos Mesh Overview",permalink:"/docs/"},next:{title:"Quick Start",permalink:"/docs/quick-start"}},l={},c=[{value:"Fault injection",id:"fault-injection",level:2},{value:"Chaos workflows",id:"chaos-workflows",level:2},{value:"Visualized operations",id:"visualized-operations",level:2},{value:"Security guarantee",id:"security-guarantee",level:2}];function h(e){const s={a:"a",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["This document describes the basic features of Chaos Mesh, including ",(0,a.jsx)(s.a,{href:"#fault-injection",children:"fault injection"}),", ",(0,a.jsx)(s.a,{href:"#chaos-workflows",children:"Chaos workflows"}),", ",(0,a.jsx)(s.a,{href:"#visualized-operations",children:"visualized operations"}),", and ",(0,a.jsx)(s.a,{href:"#security-guarantees",children:"security guarantees"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"fault-injection",children:"Fault injection"}),"\n",(0,a.jsx)(s.p,{children:"Fault injection is the key of Chaos experiments. Chaos Mesh covers a full range of faults that might occur in a distributed system, and provides three comprehensive and fine-grained fault types: basic resource faults, platform faults, and application-layer faults."}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["Basic resource faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-pod-chaos-on-kubernetes",children:"PodChaos"}),": simulates Pod failures, such as Pod node restart, Pod's persistent unavailability, and certain container failures in a specific Pod."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-network-chaos-on-kubernetes",children:"NetworkChaos"}),": simulates network failures, such as network latency, packet loss, packet disorder, and network partitions."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-dns-chaos-on-kubernetes",children:"DNSChaos"}),": simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-http-chaos-on-kubernetes",children:"HTTPChaos"}),": simulates HTTP communication failures, such as HTTP communication latency."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-heavy-stress-on-kubernetes",children:"StressChaos"}),": simulates CPU race or memory race."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-io-chaos-on-kubernetes",children:"IOChaos"}),": simulates the I/O failure of an application file, such as I/O delays, read and write failures."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-time-chaos-on-kubernetes",children:"TimeChaos"}),": simulates the time jump exception."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-kernel-chaos-on-kubernetes",children:"KernelChaos"}),": simulates kernel failures, such as an exception of the application memory allocation."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Platform faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-aws-chaos",children:"AWSChaos"}),": simulates AWS platform failures, such as the AWS node restart."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-gcp-chaos",children:"GCPChaos"}),": simulates GCP platform failures, such as the GCP node restart."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Application faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-jvm-application-chaos",children:"JVMChaos"}),": simulates JVM application failures, such as the function call delay."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"chaos-workflows",children:"Chaos workflows"}),"\n",(0,a.jsx)(s.p,{children:"A Chaos workflow includes a set of Chaos experiments and an application status check, so you can complete the entire process of a Chaos engineering project on the platform."}),"\n",(0,a.jsx)(s.p,{children:"Chaos workflows enable you to perform a series of Chaos experiments, keep expanding the explosion radius (including the scope of attacks), and increase the failure types. After running a Chaos workflow, you can easily view the current state of the application using Chaos Mesh and determine whether to perform follow-up experiments.At the same time, to reduce the cost of maintaining Chaos workflows, you can keep updating and accumulating the Chaos experiment workflows, and apply the existing experiments to other workflows."}),"\n",(0,a.jsx)(s.p,{children:"Currently, Chaos workflows provide the following features:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Orchestrate serial Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Orchestrate parallel Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Support checking experimental status and results"}),"\n",(0,a.jsx)(s.li,{children:"Support pausing a Chaos experiment"}),"\n",(0,a.jsx)(s.li,{children:"Support using YAML files to define and manage Chaos workflows"}),"\n",(0,a.jsx)(s.li,{children:"Support using the web UI to define and manage Chaos workflows"}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["For the configuration of a specific workflow, see ",(0,a.jsx)(s.a,{href:"/docs/create-chaos-mesh-workflow",children:"Create Chaos Mesh workflow"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"visualized-operations",children:"Visualized operations"}),"\n",(0,a.jsx)(s.p,{children:"Chaos Mesh provides the Chaos Dashboard component for visualized operations, which greatly simplifies Chaos experiments.You can manage and monitor a Chaos experiment directly through the visualization interface. For example, with a few clicks on the interface, you can define the scope of a Chaos experiment, specify the type of Chaos injection, define scheduling rules, and get the results of the Chaos experiment."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Chaos workflow",src:n(53687).A+"",width:"1892",height:"859"})}),"\n",(0,a.jsx)(s.h2,{id:"security-guarantee",children:"Security guarantee"}),"\n",(0,a.jsxs)(s.p,{children:["Chaos Mesh manages permissions using the native ",(0,a.jsx)(s.a,{href:"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",children:"RBAC"})," feature in Kubernetes."]}),"\n",(0,a.jsx)(s.p,{children:"You can freely create multiple roles based on your actual permission requirements, bind the roles to the username service account, and then generate the token corresponding to the service account.When you log into the Dashboard using this token, you can only perform Chaos experiments within the permissions given by the service account."}),"\n",(0,a.jsx)(s.p,{children:"In addition, you can specify the namespaces that allow Chaos experiments by setting the namespace annotations, which further safeguards the control of Chaos experiments."})]})}function u(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},53687:(e,s,n)=>{n.d(s,{A:()=>a});const a=n.p+"assets/images/dashboard-overview-445b086ab6dbbdf6525405e17c12782b.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var a=n(30758);const i={},t=a.createContext(i);function o(e){const s=a.useContext(t);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/5957e61f.94db3277.js b/assets/js/5957e61f.94db3277.js deleted file mode 100644 index 31933584f2..0000000000 --- a/assets/js/5957e61f.94db3277.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7549],{29071:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>t,metadata:()=>r,toc:()=>c});var a=n(86070),i=n(6383);const t={title:"Basic Features"},o=void 0,r={id:"basic-features",title:"Basic Features",description:"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.",source:"@site/versioned_docs/version-2.6.4/basic-features.md",sourceDirName:".",slug:"/basic-features",permalink:"/docs/basic-features",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/basic-features.md",tags:[],version:"2.6.4",frontMatter:{title:"Basic Features"},sidebar:"docs",previous:{title:"Chaos Mesh Overview",permalink:"/docs/"},next:{title:"Quick Start",permalink:"/docs/quick-start"}},l={},c=[{value:"Fault injection",id:"fault-injection",level:2},{value:"Chaos workflows",id:"chaos-workflows",level:2},{value:"Visualized operations",id:"visualized-operations",level:2},{value:"Security guarantee",id:"security-guarantee",level:2}];function h(e){const s={a:"a",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["This document describes the basic features of Chaos Mesh, including ",(0,a.jsx)(s.a,{href:"#fault-injection",children:"fault injection"}),", ",(0,a.jsx)(s.a,{href:"#chaos-workflows",children:"Chaos workflows"}),", ",(0,a.jsx)(s.a,{href:"#visualized-operations",children:"visualized operations"}),", and ",(0,a.jsx)(s.a,{href:"#security-guarantees",children:"security guarantees"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"fault-injection",children:"Fault injection"}),"\n",(0,a.jsx)(s.p,{children:"Fault injection is the key of Chaos experiments. Chaos Mesh covers a full range of faults that might occur in a distributed system, and provides three comprehensive and fine-grained fault types: basic resource faults, platform faults, and application-layer faults."}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["Basic resource faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-pod-chaos-on-kubernetes",children:"PodChaos"}),": simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-network-chaos-on-kubernetes",children:"NetworkChaos"}),": simulates network failures, such as network latency, packet loss, packet disorder, and network partitions."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-dns-chaos-on-kubernetes",children:"DNSChaos"}),": simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-http-chaos-on-kubernetes",children:"HTTPChaos"}),": simulates HTTP communication failures, such as HTTP communication latency."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-heavy-stress-on-kubernetes",children:"StressChaos"}),": simulates CPU race or memory race."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-io-chaos-on-kubernetes",children:"IOChaos"}),": simulates the I/O failure of an application file, such as I/O delays, read and write failures."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-time-chaos-on-kubernetes",children:"TimeChaos"}),": simulates the time jump exception."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-kernel-chaos-on-kubernetes",children:"KernelChaos"}),": simulates kernel failures, such as an exception of the application memory allocation."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Platform faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-aws-chaos",children:"AWSChaos"}),": simulates AWS platform failures, such as the AWS node restart."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-gcp-chaos",children:"GCPChaos"}),": simulates GCP platform failures, such as the GCP node restart."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Application faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/simulate-jvm-application-chaos",children:"JVMChaos"}),": simulates JVM application failures, such as the function call delay."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"chaos-workflows",children:"Chaos workflows"}),"\n",(0,a.jsx)(s.p,{children:"A Chaos workflow includes a set of Chaos experiments and an application status check, so you can complete the entire process of a Chaos engineering project on the platform."}),"\n",(0,a.jsx)(s.p,{children:"Chaos workflows enable you to perform a series of Chaos experiments, keep expanding the explosion radius (including the scope of attacks), and increase the failure types. After running a Chaos workflow, you can easily view the current state of the application using Chaos Mesh and determine whether to perform follow-up experiments.At the same time, to reduce the cost of maintaining Chaos workflows, you can keep updating and accumulating the Chaos experiment workflows, and apply the existing experiments to other workflows."}),"\n",(0,a.jsx)(s.p,{children:"Currently, Chaos workflows provide the following features:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Orchestrate serial Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Orchestrate parallel Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Support checking experimental status and results"}),"\n",(0,a.jsx)(s.li,{children:"Support pausing a Chaos experiment"}),"\n",(0,a.jsx)(s.li,{children:"Support using YAML files to define and manage Chaos workflows"}),"\n",(0,a.jsx)(s.li,{children:"Support using the web UI to define and manage Chaos workflows"}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["For the configuration of a specific workflow, see ",(0,a.jsx)(s.a,{href:"/docs/create-chaos-mesh-workflow",children:"Create Chaos Mesh workflow"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"visualized-operations",children:"Visualized operations"}),"\n",(0,a.jsx)(s.p,{children:"Chaos Mesh provides the Chaos Dashboard component for visualized operations, which greatly simplifies Chaos experiments.You can manage and monitor a Chaos experiment directly through the visualization interface. For example, with a few clicks on the interface, you can define the scope of a Chaos experiment, specify the type of Chaos injection, define scheduling rules, and get the results of the Chaos experiment."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Chaos workflow",src:n(53687).A+"",width:"1892",height:"859"})}),"\n",(0,a.jsx)(s.h2,{id:"security-guarantee",children:"Security guarantee"}),"\n",(0,a.jsxs)(s.p,{children:["Chaos Mesh manages permissions using the native ",(0,a.jsx)(s.a,{href:"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",children:"RBAC"})," feature in Kubernetes."]}),"\n",(0,a.jsx)(s.p,{children:"You can freely create multiple roles based on your actual permission requirements, bind the roles to the username service account, and then generate the token corresponding to the service account.When you log into the Dashboard using this token, you can only perform Chaos experiments within the permissions given by the service account."}),"\n",(0,a.jsx)(s.p,{children:"In addition, you can specify the namespaces that allow Chaos experiments by setting the namespace annotations, which further safeguards the control of Chaos experiments."})]})}function u(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},53687:(e,s,n)=>{n.d(s,{A:()=>a});const a=n.p+"assets/images/dashboard-overview-445b086ab6dbbdf6525405e17c12782b.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var a=n(30758);const i={},t=a.createContext(i);function o(e){const s=a.useContext(t);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/601d4a49.244058d7.js b/assets/js/601d4a49.244058d7.js deleted file mode 100644 index e3f5820aca..0000000000 --- a/assets/js/601d4a49.244058d7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7234],{57101:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/versioned_docs/version-2.4.3/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/2.4.3/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/define-chaos-experiment-scope.md",tags:[],version:"2.4.3",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Configure namespace for Chaos experiments",permalink:"/docs/2.4.3/configure-enabled-namespace"},next:{title:"Define Scheduling Rules",permalink:"/docs/2.4.3/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specifiy the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/2.4.3/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physcial-machine-a\n - physcial-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(53059).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},53059:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/601d4a49.2443b106.js b/assets/js/601d4a49.2443b106.js new file mode 100644 index 0000000000..f9b37d3fa7 --- /dev/null +++ b/assets/js/601d4a49.2443b106.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7234],{57101:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/versioned_docs/version-2.4.3/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/2.4.3/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/define-chaos-experiment-scope.md",tags:[],version:"2.4.3",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Configure namespace for Chaos experiments",permalink:"/docs/2.4.3/configure-enabled-namespace"},next:{title:"Define Scheduling Rules",permalink:"/docs/2.4.3/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specify the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/2.4.3/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physical-machine-a\n - physical-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(53059).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},53059:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/64a5caf2.568e8f28.js b/assets/js/64a5caf2.1ca274de.js similarity index 99% rename from assets/js/64a5caf2.568e8f28.js rename to assets/js/64a5caf2.1ca274de.js index 4625df5588..971e45453f 100644 --- a/assets/js/64a5caf2.568e8f28.js +++ b/assets/js/64a5caf2.1ca274de.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4311],{59162:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,o={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/versioned_docs/version-2.4.3/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/2.4.3/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/2.4.3/simulate-aws-chaos"}},a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFOG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4311],{59162:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,o={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/versioned_docs/version-2.4.3/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/2.4.3/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/2.4.3/simulate-aws-chaos"}},a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFIG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/66d02352.bb93fa24.js b/assets/js/66d02352.bb93fa24.js new file mode 100644 index 0000000000..38b2addcb2 --- /dev/null +++ b/assets/js/66d02352.bb93fa24.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[6747],{54636:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"2.5.2","label":"2.5.2","banner":"unmaintained","badge":true,"noIndex":false,"className":"docs-version-2.5.2","isLast":false,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/2.5.2/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/2.5.2/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/2.5.2/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/2.5.2/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/2.5.2/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/2.5.2/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/2.5.2/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/2.5.2/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/2.5.2/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"link","label":"Remote Cluster Management","href":"/docs/2.5.2/remote-cluster-management","docId":"remote-cluster-management","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/2.5.2/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/2.5.2/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/2.5.2/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/2.5.2/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/2.5.2/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/2.5.2/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/2.5.2/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/2.5.2/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/2.5.2/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/2.5.2/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.5.2/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.5.2/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/2.5.2/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/2.5.2/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.5.2/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.5.2/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/2.5.2/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/2.5.2/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/2.5.2/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/2.5.2/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/2.5.2/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Latency","href":"/docs/2.5.2/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/2.5.2/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/2.5.2/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/2.5.2/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.5.2/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/2.5.2/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.5.2/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/2.5.2/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.5.2/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.5.2/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/2.5.2/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/2.5.2/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/2.5.2/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/2.5.2/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/2.5.2/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/2.5.2/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/2.5.2/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/2.5.2/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/2.5.2/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add New Chaos Experiment Type","href":"/docs/2.5.2/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/2.5.2/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/2.5.2/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/2.5.2/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/2.5.2/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/2.5.2/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/2.5.2/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.5.0 Tracking","href":"/docs/2.5.2/release-2.5-tracking","docId":"release-2.5-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"This document describes how to develop Chaos Mesh. Before you start, it is recommended to first read the following documents:","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add new chaos experiment type, you have added HelloWorldChaos, which can print Hello World! in the logs of Chaos Controller Manager. To enable the HelloWorldChaos to inject some faults into the target Pod, you need to extend interface for Chaos Daemon.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.5-tracking":{"id":"release-2.5-tracking","title":"Chaos Mesh v2.5.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"remote-cluster-management":{"id":"remote-cluster-management","title":"Remote Cluster Management","description":"Remote Cluster Introduction","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Latency","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and set up the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/66d02352.cb9e3c25.js b/assets/js/66d02352.cb9e3c25.js deleted file mode 100644 index 878841bf31..0000000000 --- a/assets/js/66d02352.cb9e3c25.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[6747],{54636:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"2.5.2","label":"2.5.2","banner":"unmaintained","badge":true,"noIndex":false,"className":"docs-version-2.5.2","isLast":false,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/2.5.2/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/2.5.2/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/2.5.2/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/2.5.2/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/2.5.2/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/2.5.2/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/2.5.2/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/2.5.2/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/2.5.2/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"link","label":"Remote Cluster Management","href":"/docs/2.5.2/remote-cluster-management","docId":"remote-cluster-management","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/2.5.2/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/2.5.2/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/2.5.2/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/2.5.2/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/2.5.2/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/2.5.2/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/2.5.2/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/2.5.2/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/2.5.2/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/2.5.2/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.5.2/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.5.2/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/2.5.2/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/2.5.2/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.5.2/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.5.2/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/2.5.2/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/2.5.2/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/2.5.2/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/2.5.2/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/2.5.2/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Latency","href":"/docs/2.5.2/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/2.5.2/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/2.5.2/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/2.5.2/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.5.2/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/2.5.2/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.5.2/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/2.5.2/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.5.2/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.5.2/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/2.5.2/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/2.5.2/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/2.5.2/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/2.5.2/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/2.5.2/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/2.5.2/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/2.5.2/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/2.5.2/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/2.5.2/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add New Chaos Experiment Type","href":"/docs/2.5.2/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/2.5.2/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/2.5.2/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/2.5.2/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/2.5.2/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/2.5.2/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/2.5.2/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.5.0 Tracking","href":"/docs/2.5.2/release-2.5-tracking","docId":"release-2.5-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"This document describes how to develop Chaos Mesh. Before you start, it is recommended to first read the following documents:","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add new chaos experiment type, you have added HelloWorldChaos, which can print Hello World! in the logs of Chaos Controller Manager. To enable the HelloWorldChaos to inject some faults into the target Pod, you need to extend interface for Chaos Daemon.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.5-tracking":{"id":"release-2.5-tracking","title":"Chaos Mesh v2.5.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"remote-cluster-management":{"id":"remote-cluster-management","title":"Remote Cluster Management","description":"Remote Cluster Introduction","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Latency","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and set up the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/70329d25.3ece62e3.js b/assets/js/70329d25.5e2a5308.js similarity index 64% rename from assets/js/70329d25.3ece62e3.js rename to assets/js/70329d25.5e2a5308.js index 02cc8ca450..18142fdb24 100644 --- a/assets/js/70329d25.3ece62e3.js +++ b/assets/js/70329d25.5e2a5308.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[3129],{89078:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.5.2/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/2.5.2/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-jvm-application-chaos.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/2.5.2/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/2.5.2/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(60503).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(54173).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(34778).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is milisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"srting"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},60503:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},34778:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},54173:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[3129],{89078:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.5.2/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/2.5.2/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-jvm-application-chaos.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/2.5.2/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/2.5.2/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(60503).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(54173).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(34778).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is millisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},60503:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},34778:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},54173:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/70f04d34.02767032.js b/assets/js/70f04d34.d2ca0803.js similarity index 99% rename from assets/js/70f04d34.02767032.js rename to assets/js/70f04d34.d2ca0803.js index 9213d45a62..bc4ede1ea7 100644 --- a/assets/js/70f04d34.02767032.js +++ b/assets/js/70f04d34.d2ca0803.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7793],{91868:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/versioned_docs/version-2.6.4/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-network-chaos-on-kubernetes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Delay example",id:"delay-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Network Emulation example",id:"network-emulation-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"rate",id:"rate",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(10476).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(74895).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(21785).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"delay-example",children:"Delay example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"network-emulation-example",children:"Network Emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"netem.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: network-emulation\nspec:\n action: netem\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n rate:\n rate: '10mbps'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds and a bandwidth limit of 10mbps in the network connections of the target Pods. In addition to latency and rate, the ",(0,i.jsx)(n.code,{children:"netem"})," action also supports packet loss, reorder and corruption."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./netem.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available vaules include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"}),", ",(0,i.jsx)(n.code,{children:"rate"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"rate",children:"rate"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"rate"})," means simulating bandwidth rate fault. This action is similar to ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth/rate"})," below, however, ",(0,i.jsxs)(n.strong,{children:["the key distinction is that this action can combine with other ",(0,i.jsx)(n.code,{children:"netem"})," actions listed above"]}),". However, if you require more control over the bandwidth simulation such as limiting the buffer size, check the ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth"})," action."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["This action is mutually exclusive with any ",(0,i.jsx)(n.code,{children:"netem"})," action defined above. If you need to inject bandwidth rate along with other network failures such as corruption, use the ",(0,i.jsx)(n.a,{href:"#rate",children:"rate"})," action instead."]})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},10476:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},21785:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},74895:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7793],{91868:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/versioned_docs/version-2.6.4/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-network-chaos-on-kubernetes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Delay example",id:"delay-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Network Emulation example",id:"network-emulation-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"rate",id:"rate",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(10476).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(74895).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(21785).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"delay-example",children:"Delay example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"network-emulation-example",children:"Network Emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"netem.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: network-emulation\nspec:\n action: netem\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n rate:\n rate: '10mbps'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds and a bandwidth limit of 10mbps in the network connections of the target Pods. In addition to latency and rate, the ",(0,i.jsx)(n.code,{children:"netem"})," action also supports packet loss, reorder and corruption."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./netem.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available values include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"}),", ",(0,i.jsx)(n.code,{children:"rate"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"rate",children:"rate"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"rate"})," means simulating bandwidth rate fault. This action is similar to ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth/rate"})," below, however, ",(0,i.jsxs)(n.strong,{children:["the key distinction is that this action can combine with other ",(0,i.jsx)(n.code,{children:"netem"})," actions listed above"]}),". However, if you require more control over the bandwidth simulation such as limiting the buffer size, check the ",(0,i.jsx)(n.a,{href:"#bandwidth",children:"bandwidth"})," action."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsx)(n.tbody,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsx)(n.admonition,{type:"info",children:(0,i.jsxs)(n.p,{children:["This action is mutually exclusive with any ",(0,i.jsx)(n.code,{children:"netem"})," action defined above. If you need to inject bandwidth rate along with other network failures such as corruption, use the ",(0,i.jsx)(n.a,{href:"#rate",children:"rate"})," action instead."]})}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit. Allows bit, kbit, mbit, gbit, tbit, bps, kbps, mbps, gbps, tbps unit. bps means bytes per second"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},10476:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},21785:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},74895:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/73ba8788.e5efde6c.js b/assets/js/73ba8788.68e69870.js similarity index 74% rename from assets/js/73ba8788.e5efde6c.js rename to assets/js/73ba8788.68e69870.js index a6db167398..36f7c97252 100644 --- a/assets/js/73ba8788.e5efde6c.js +++ b/assets/js/73ba8788.68e69870.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7993],{2146:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/versioned_docs/version-2.4.3/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/2.4.3/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/inspect-chaos-experiments.md",tags:[],version:"2.4.3",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/2.4.3/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/2.4.3/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/2.4.3/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(47404).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(86547).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been succesfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},86547:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},47404:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7993],{2146:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/versioned_docs/version-2.4.3/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/2.4.3/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/inspect-chaos-experiments.md",tags:[],version:"2.4.3",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/2.4.3/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/2.4.3/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/2.4.3/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(47404).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(86547).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been successfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},86547:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},47404:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8eb0ea08.3ffd40a4.js b/assets/js/8eb0ea08.3ffd40a4.js new file mode 100644 index 0000000000..01ff1c8090 --- /dev/null +++ b/assets/js/8eb0ea08.3ffd40a4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[922],{61224:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.4.3/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/2.4.3/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/2.4.3/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/2.4.3/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. For more information about the Byteman rule configuration,, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/8eb0ea08.9007d712.js b/assets/js/8eb0ea08.9007d712.js deleted file mode 100644 index ac74b3261f..0000000000 --- a/assets/js/8eb0ea08.9007d712.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[922],{61224:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.4.3/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/2.4.3/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/2.4.3/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/2.4.3/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. Regarding to the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/95e0ec25.3df64af7.js b/assets/js/95e0ec25.3df64af7.js deleted file mode 100644 index f05bd66afe..0000000000 --- a/assets/js/95e0ec25.3df64af7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[1449],{47467:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>r,toc:()=>c});var a=n(86070),t=n(6383);const i={title:"Basic Features"},o=void 0,r={id:"basic-features",title:"Basic Features",description:"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.",source:"@site/docs/basic-features.md",sourceDirName:".",slug:"/basic-features",permalink:"/docs/next/basic-features",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/basic-features.md",tags:[],version:"current",frontMatter:{title:"Basic Features"},sidebar:"docs",previous:{title:"Chaos Mesh Overview",permalink:"/docs/next/"},next:{title:"Quick Start",permalink:"/docs/next/quick-start"}},l={},c=[{value:"Fault injection",id:"fault-injection",level:2},{value:"Chaos workflows",id:"chaos-workflows",level:2},{value:"Visualized operations",id:"visualized-operations",level:2},{value:"Security guarantee",id:"security-guarantee",level:2}];function h(e){const s={a:"a",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["This document describes the basic features of Chaos Mesh, including ",(0,a.jsx)(s.a,{href:"#fault-injection",children:"fault injection"}),", ",(0,a.jsx)(s.a,{href:"#chaos-workflows",children:"Chaos workflows"}),", ",(0,a.jsx)(s.a,{href:"#visualized-operations",children:"visualized operations"}),", and ",(0,a.jsx)(s.a,{href:"#security-guarantees",children:"security guarantees"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"fault-injection",children:"Fault injection"}),"\n",(0,a.jsx)(s.p,{children:"Fault injection is the key of Chaos experiments. Chaos Mesh covers a full range of faults that might occur in a distributed system, and provides three comprehensive and fine-grained fault types: basic resource faults, platform faults, and application-layer faults."}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["Basic resource faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-pod-chaos-on-kubernetes",children:"PodChaos"}),": simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-network-chaos-on-kubernetes",children:"NetworkChaos"}),": simulates network failures, such as network latency, packet loss, packet disorder, and network partitions."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-dns-chaos-on-kubernetes",children:"DNSChaos"}),": simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-http-chaos-on-kubernetes",children:"HTTPChaos"}),": simulates HTTP communication failures, such as HTTP communication latency."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-heavy-stress-on-kubernetes",children:"StressChaos"}),": simulates CPU race or memory race."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-io-chaos-on-kubernetes",children:"IOChaos"}),": simulates the I/O failure of an application file, such as I/O delays, read and write failures."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-time-chaos-on-kubernetes",children:"TimeChaos"}),": simulates the time jump exception."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-kernel-chaos-on-kubernetes",children:"KernelChaos"}),": simulates kernel failures, such as an exception of the application memory allocation."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Platform faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-aws-chaos",children:"AWSChaos"}),": simulates AWS platform failures, such as the AWS node restart."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-gcp-chaos",children:"GCPChaos"}),": simulates GCP platform failures, such as the GCP node restart."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Application faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-jvm-application-chaos",children:"JVMChaos"}),": simulates JVM application failures, such as the function call delay."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"chaos-workflows",children:"Chaos workflows"}),"\n",(0,a.jsx)(s.p,{children:"A Chaos workflow includes a set of Chaos experiments and an application status check, so you can complete the entire process of a Chaos engineering project on the platform."}),"\n",(0,a.jsx)(s.p,{children:"Chaos workflows enable you to perform a series of Chaos experiments, keep expanding the explosion radius (including the scope of attacks), and increase the failure types. After running a Chaos workflow, you can easily view the current state of the application using Chaos Mesh and determine whether to perform follow-up experiments.At the same time, to reduce the cost of maintaining Chaos workflows, you can keep updating and accumulating the Chaos experiment workflows, and apply the existing experiments to other workflows."}),"\n",(0,a.jsx)(s.p,{children:"Currently, Chaos workflows provide the following features:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Orchestrate serial Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Orchestrate parallel Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Support checking experimental status and results"}),"\n",(0,a.jsx)(s.li,{children:"Support pausing a Chaos experiment"}),"\n",(0,a.jsx)(s.li,{children:"Support using YAML files to define and manage Chaos workflows"}),"\n",(0,a.jsx)(s.li,{children:"Support using the web UI to define and manage Chaos workflows"}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["For the configuration of a specific workflow, see ",(0,a.jsx)(s.a,{href:"/docs/next/create-chaos-mesh-workflow",children:"Create Chaos Mesh workflow"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"visualized-operations",children:"Visualized operations"}),"\n",(0,a.jsx)(s.p,{children:"Chaos Mesh provides the Chaos Dashboard component for visualized operations, which greatly simplifies Chaos experiments.You can manage and monitor a Chaos experiment directly through the visualization interface. For example, with a few clicks on the interface, you can define the scope of a Chaos experiment, specify the type of Chaos injection, define scheduling rules, and get the results of the Chaos experiment."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Chaos workflow",src:n(56179).A+"",width:"1892",height:"859"})}),"\n",(0,a.jsx)(s.h2,{id:"security-guarantee",children:"Security guarantee"}),"\n",(0,a.jsxs)(s.p,{children:["Chaos Mesh manages permissions using the native ",(0,a.jsx)(s.a,{href:"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",children:"RBAC"})," feature in Kubernetes."]}),"\n",(0,a.jsx)(s.p,{children:"You can freely create multiple roles based on your actual permission requirements, bind the roles to the username service account, and then generate the token corresponding to the service account.When you log into the Dashboard using this token, you can only perform Chaos experiments within the permissions given by the service account."}),"\n",(0,a.jsx)(s.p,{children:"In addition, you can specify the namespaces that allow Chaos experiments by setting the namespace annotations, which further safeguards the control of Chaos experiments."})]})}function u(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},56179:(e,s,n)=>{n.d(s,{A:()=>a});const a=n.p+"assets/images/dashboard-overview-445b086ab6dbbdf6525405e17c12782b.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var a=n(30758);const t={},i=a.createContext(t);function o(e){const s=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),a.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/95e0ec25.a5e23818.js b/assets/js/95e0ec25.a5e23818.js new file mode 100644 index 0000000000..dac7c7e3e7 --- /dev/null +++ b/assets/js/95e0ec25.a5e23818.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[1449],{47467:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>r,toc:()=>c});var a=n(86070),t=n(6383);const i={title:"Basic Features"},o=void 0,r={id:"basic-features",title:"Basic Features",description:"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.",source:"@site/docs/basic-features.md",sourceDirName:".",slug:"/basic-features",permalink:"/docs/next/basic-features",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/basic-features.md",tags:[],version:"current",frontMatter:{title:"Basic Features"},sidebar:"docs",previous:{title:"Chaos Mesh Overview",permalink:"/docs/next/"},next:{title:"Quick Start",permalink:"/docs/next/quick-start"}},l={},c=[{value:"Fault injection",id:"fault-injection",level:2},{value:"Chaos workflows",id:"chaos-workflows",level:2},{value:"Visualized operations",id:"visualized-operations",level:2},{value:"Security guarantee",id:"security-guarantee",level:2}];function h(e){const s={a:"a",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,t.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["This document describes the basic features of Chaos Mesh, including ",(0,a.jsx)(s.a,{href:"#fault-injection",children:"fault injection"}),", ",(0,a.jsx)(s.a,{href:"#chaos-workflows",children:"Chaos workflows"}),", ",(0,a.jsx)(s.a,{href:"#visualized-operations",children:"visualized operations"}),", and ",(0,a.jsx)(s.a,{href:"#security-guarantees",children:"security guarantees"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"fault-injection",children:"Fault injection"}),"\n",(0,a.jsx)(s.p,{children:"Fault injection is the key of Chaos experiments. Chaos Mesh covers a full range of faults that might occur in a distributed system, and provides three comprehensive and fine-grained fault types: basic resource faults, platform faults, and application-layer faults."}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["Basic resource faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-pod-chaos-on-kubernetes",children:"PodChaos"}),": simulates Pod failures, such as Pod node restart, Pod's persistent unavailability, and certain container failures in a specific Pod."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-network-chaos-on-kubernetes",children:"NetworkChaos"}),": simulates network failures, such as network latency, packet loss, packet disorder, and network partitions."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-dns-chaos-on-kubernetes",children:"DNSChaos"}),": simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-http-chaos-on-kubernetes",children:"HTTPChaos"}),": simulates HTTP communication failures, such as HTTP communication latency."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-heavy-stress-on-kubernetes",children:"StressChaos"}),": simulates CPU race or memory race."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-io-chaos-on-kubernetes",children:"IOChaos"}),": simulates the I/O failure of an application file, such as I/O delays, read and write failures."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-time-chaos-on-kubernetes",children:"TimeChaos"}),": simulates the time jump exception."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-kernel-chaos-on-kubernetes",children:"KernelChaos"}),": simulates kernel failures, such as an exception of the application memory allocation."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Platform faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-aws-chaos",children:"AWSChaos"}),": simulates AWS platform failures, such as the AWS node restart."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-gcp-chaos",children:"GCPChaos"}),": simulates GCP platform failures, such as the GCP node restart."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Application faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/next/simulate-jvm-application-chaos",children:"JVMChaos"}),": simulates JVM application failures, such as the function call delay."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"chaos-workflows",children:"Chaos workflows"}),"\n",(0,a.jsx)(s.p,{children:"A Chaos workflow includes a set of Chaos experiments and an application status check, so you can complete the entire process of a Chaos engineering project on the platform."}),"\n",(0,a.jsx)(s.p,{children:"Chaos workflows enable you to perform a series of Chaos experiments, keep expanding the explosion radius (including the scope of attacks), and increase the failure types. After running a Chaos workflow, you can easily view the current state of the application using Chaos Mesh and determine whether to perform follow-up experiments.At the same time, to reduce the cost of maintaining Chaos workflows, you can keep updating and accumulating the Chaos experiment workflows, and apply the existing experiments to other workflows."}),"\n",(0,a.jsx)(s.p,{children:"Currently, Chaos workflows provide the following features:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Orchestrate serial Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Orchestrate parallel Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Support checking experimental status and results"}),"\n",(0,a.jsx)(s.li,{children:"Support pausing a Chaos experiment"}),"\n",(0,a.jsx)(s.li,{children:"Support using YAML files to define and manage Chaos workflows"}),"\n",(0,a.jsx)(s.li,{children:"Support using the web UI to define and manage Chaos workflows"}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["For the configuration of a specific workflow, see ",(0,a.jsx)(s.a,{href:"/docs/next/create-chaos-mesh-workflow",children:"Create Chaos Mesh workflow"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"visualized-operations",children:"Visualized operations"}),"\n",(0,a.jsx)(s.p,{children:"Chaos Mesh provides the Chaos Dashboard component for visualized operations, which greatly simplifies Chaos experiments.You can manage and monitor a Chaos experiment directly through the visualization interface. For example, with a few clicks on the interface, you can define the scope of a Chaos experiment, specify the type of Chaos injection, define scheduling rules, and get the results of the Chaos experiment."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Chaos workflow",src:n(56179).A+"",width:"1892",height:"859"})}),"\n",(0,a.jsx)(s.h2,{id:"security-guarantee",children:"Security guarantee"}),"\n",(0,a.jsxs)(s.p,{children:["Chaos Mesh manages permissions using the native ",(0,a.jsx)(s.a,{href:"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",children:"RBAC"})," feature in Kubernetes."]}),"\n",(0,a.jsx)(s.p,{children:"You can freely create multiple roles based on your actual permission requirements, bind the roles to the username service account, and then generate the token corresponding to the service account.When you log into the Dashboard using this token, you can only perform Chaos experiments within the permissions given by the service account."}),"\n",(0,a.jsx)(s.p,{children:"In addition, you can specify the namespaces that allow Chaos experiments by setting the namespace annotations, which further safeguards the control of Chaos experiments."})]})}function u(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},56179:(e,s,n)=>{n.d(s,{A:()=>a});const a=n.p+"assets/images/dashboard-overview-445b086ab6dbbdf6525405e17c12782b.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var a=n(30758);const t={},i=a.createContext(t);function o(e){const s=a.useContext(i);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),a.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/aa5a177c.d02d13e9.js b/assets/js/aa5a177c.d02d13e9.js deleted file mode 100644 index c5d06534aa..0000000000 --- a/assets/js/aa5a177c.d02d13e9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[569],{57978:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/docs/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/next/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/define-chaos-experiment-scope.md",tags:[],version:"current",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Remote Cluster Management",permalink:"/docs/next/remote-cluster-management"},next:{title:"Define Scheduling Rules",permalink:"/docs/next/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specifiy the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/next/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physcial-machine-a\n - physcial-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(61868).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},61868:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/aa5a177c.f9c33358.js b/assets/js/aa5a177c.f9c33358.js new file mode 100644 index 0000000000..d9f5650fc6 --- /dev/null +++ b/assets/js/aa5a177c.f9c33358.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[569],{57978:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/docs/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/next/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/define-chaos-experiment-scope.md",tags:[],version:"current",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Remote Cluster Management",permalink:"/docs/next/remote-cluster-management"},next:{title:"Define Scheduling Rules",permalink:"/docs/next/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specify the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/next/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physical-machine-a\n - physical-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(61868).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},61868:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ac2bc92e.5583d1dd.js b/assets/js/ac2bc92e.93f8feda.js similarity index 99% rename from assets/js/ac2bc92e.5583d1dd.js rename to assets/js/ac2bc92e.93f8feda.js index 0777168326..5a31012999 100644 --- a/assets/js/ac2bc92e.5583d1dd.js +++ b/assets/js/ac2bc92e.93f8feda.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[500],{59766:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,o={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/versioned_docs/version-2.5.2/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/2.5.2/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/2.5.2/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/2.5.2/simulate-aws-chaos"}},a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFOG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[500],{59766:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,o={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/versioned_docs/version-2.5.2/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/2.5.2/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/2.5.2/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/2.5.2/simulate-aws-chaos"}},a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFIG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ac400e52.afc2bad9.js b/assets/js/ac400e52.c663705e.js similarity index 64% rename from assets/js/ac400e52.afc2bad9.js rename to assets/js/ac400e52.c663705e.js index 16b90b123a..4127d4d9f8 100644 --- a/assets/js/ac400e52.afc2bad9.js +++ b/assets/js/ac400e52.c663705e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[9551],{86731:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.6.4/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-jvm-application-chaos.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(10476).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(88586).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(21785).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is milisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"srting"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},10476:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},21785:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},88586:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[9551],{86731:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>o,frontMatter:()=>l,metadata:()=>d,toc:()=>h});var t=s(86070),r=s(6383);const l={title:"Simulate JVM Application Faults"},i=void 0,d={id:"simulate-jvm-application-chaos",title:"Simulate JVM Application Faults",description:"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.6.4/simulate-jvm-application-chaos.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos",permalink:"/docs/simulate-jvm-application-chaos",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-jvm-application-chaos.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Time Faults",permalink:"/docs/simulate-time-chaos-on-kubernetes"},next:{title:"Simulate Linux Kernel Faults",permalink:"/docs/simulate-kernel-chaos-on-kubernetes"}},c={},h=[{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using YAML files",id:"create-experiments-using-yaml-files",level:2},{value:"Step 1. Create the target application",id:"step-1-create-the-target-application",level:3},{value:"Step 2. Observe application behaviors before injecting faults\u200b",id:"step-2-observe-application-behaviors-before-injecting-faults",level:3},{value:"Step 3. Inject JVMChaos and check",id:"step-3-inject-jvmchaos-and-check",level:3},{value:"Field description",id:"field-description",level:2},{value:"Parameters for latency",id:"parameters-for-latency",level:3},{value:"Parameters for return",id:"parameters-for-return",level:3},{value:"Parameters for exception",id:"parameters-for-exception",level:3},{value:"Parameters for stress",id:"parameters-for-stress",level:3},{value:"Parameters for gc",id:"parameters-for-gc",level:3},{value:"Parameters for ruleData",id:"parameters-for-ruledata",level:3}];function a(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.p,{children:["Chaos Mesh simulates the faults of JVM application through ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"Throw custom exceptions"}),"\n",(0,t.jsx)(n.li,{children:"Trigger garbage collection"}),"\n",(0,t.jsx)(n.li,{children:"Increase method latency"}),"\n",(0,t.jsx)(n.li,{children:"Modify return values of a method"}),"\n",(0,t.jsx)(n.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,t.jsx)(n.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"This document describes how to use Chaos Mesh to create the above fault types of JVM experiments."}),"\n",(0,t.jsx)(n.admonition,{type:"note",children:(0,t.jsx)(n.p,{children:"Your Linux kernel must be v4.1 or later."})}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"create a new experiment",src:s(10476).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["In the ",(0,t.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(n.strong,{children:"JVM FAULT"}),", and select a specific behavior, such as ",(0,t.jsx)(n.strong,{children:(0,t.jsx)(n.code,{children:"RETURN"})}),". Then, fill out the detailed configurations."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"JVMChaos experiments",src:s(88586).A+"",width:"2682",height:"1484"})}),"\n",(0,t.jsx)(n.p,{children:"For information about how to fill out the configurations, refer to [Field Description] (#field-description)."}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.img,{alt:"experiment information",src:s(21785).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"create-experiments-using-yaml-files",children:"Create experiments using YAML files"}),"\n",(0,t.jsxs)(n.p,{children:["The following example shows the usage and effects of JVMChaos. The example specifies the return values of a method. The YAML files referred to in the following steps can be found in ",(0,t.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples/jvm",children:"examples/jvm"}),". The default work directory for the following steps is also ",(0,t.jsx)(n.code,{children:"examples/jvm"}),". The default namespace where Chaos Mesh is installed is ",(0,t.jsx)(n.code,{children:"chaos-mesh"}),"."]}),"\n",(0,t.jsx)(n.h3,{id:"step-1-create-the-target-application",children:"Step 1. Create the target application"}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.a,{href:"https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld",children:"Helloworld"})," is a simple Java application. In this section, this application is used as the target application that is to be tested. The target application is defined in ",(0,t.jsx)(n.code,{children:"example/jvm/app.yaml"})," as follows:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: v1\nkind: Pod\nmetadata:\n name: helloworld\n namespace: helloworld\nspec:\n containers:\n - name: helloworld\n # source code: https://github.com/WangXiangUSTC/byteman-example/tree/main/example.helloworld\n # this application will print log like this below:\n # 0. Hello World\n # 1. Hello World\n # ...\n image: xiang13225080/helloworld:v1.0\n imagePullPolicy: IfNotPresent\n"})}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Create the namespace for the target application:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl create namespace helloworld\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Build the application Pod:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f app.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Execute ",(0,t.jsx)(n.code,{children:"kubectl -n helloworld get pods"}),", and you are expected to find a pod named ",(0,t.jsx)(n.code,{children:"helloworld"})," in the ",(0,t.jsx)(n.code,{children:"helloworld"})," namespace."]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld get pods\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-text",children:"kubectl get pods -n helloworld\nNAME READY STATUS RESTARTS AGE\nhelloworld 1/1 Running 0 2m\n"})}),"\n",(0,t.jsxs)(n.p,{children:["After the ",(0,t.jsx)(n.code,{children:"READY"})," column turns to ",(0,t.jsx)(n.code,{children:"1/1"}),", you can proceed to the next step."]}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h3,{id:"step-2-observe-application-behaviors-before-injecting-faults",children:"Step 2. Observe application behaviors before injecting faults\u200b"}),"\n",(0,t.jsxs)(n.p,{children:["You can observe the behavior of ",(0,t.jsx)(n.code,{children:"helloworld"})," application before injecting faults, for example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The result is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"0. Hello World\n1. Hello World\n2. Hello World\n3. Hello World\n4. Hello World\n5. Hello World\n"})}),"\n",(0,t.jsxs)(n.p,{children:["You can see that ",(0,t.jsx)(n.code,{children:"helloworld"})," outputs a line of ",(0,t.jsx)(n.code,{children:"Hello World"})," every second, and the number of each line increases in turn."]}),"\n",(0,t.jsx)(n.h3,{id:"step-3-inject-jvmchaos-and-check",children:"Step 3. Inject JVMChaos and check"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"The JVMChaos with a specified return value is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: JVMChaos\nmetadata:\n name: return\n namespace: helloworld\nspec:\n action: return\n class: Main\n method: getnum\n value: '9999'\n mode: all\n selector:\n namespaces:\n - helloworld\n"})}),"\n",(0,t.jsxs)(n.p,{children:["JVMChaos changes the return value of the ",(0,t.jsx)(n.code,{children:"getnum"})," method to the number ",(0,t.jsx)(n.code,{children:"9999"}),", which means that the number of each line in the ",(0,t.jsx)(n.code,{children:"helloworld"})," output is set to ",(0,t.jsx)(n.code,{children:"9999"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Inject JVMChaos with a specified value:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl apply -f ./jvm-return-example.yaml\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsxs)(n.p,{children:["Check the latest log of ",(0,t.jsx)(n.code,{children:"helloworld"}),":"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"kubectl -n helloworld logs -f helloworld\n"})}),"\n",(0,t.jsx)(n.p,{children:"The log is as follows:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-shell",children:"Rule.execute called for return_0:0\nreturn execute\ncaught ReturnException\n9999. Hello World\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Default value"}),(0,t.jsx)(n.th,{children:"Required"}),(0,t.jsx)(n.th,{children:"Example"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"action"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates the specific fault type. The available fault types include ",(0,t.jsx)(n.code,{children:"latency"}),", ",(0,t.jsx)(n.code,{children:"return"}),", ",(0,t.jsx)(n.code,{children:"exception"}),", ",(0,t.jsx)(n.code,{children:"stress"}),", ",(0,t.jsx)(n.code,{children:"gc"}),", and ",(0,t.jsx)(n.code,{children:"ruleData"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:"return"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"mode"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["Indicates how to select Pod. The supported modes include ",(0,t.jsx)(n.code,{children:"one"}),", ",(0,t.jsx)(n.code,{children:"all"}),", ",(0,t.jsx)(n.code,{children:"fixed"}),", ",(0,t.jsx)(n.code,{children:"fixed-percent"}),", and ",(0,t.jsx)(n.code,{children:"random-max-percent"}),"."]}),(0,t.jsx)(n.td,{children:"None"}),(0,t.jsx)(n.td,{children:"Yes"}),(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"one"})})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["The meanings of the different ",(0,t.jsx)(n.code,{children:"action"})," values are as follows:"]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Value"}),(0,t.jsx)(n.th,{children:"Meaning"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"Increase method latency"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"return"})}),(0,t.jsx)(n.td,{children:"Modify return values of a method"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"Throw custom exceptions"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"stress"})}),(0,t.jsx)(n.td,{children:"Increase CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"gc"})}),(0,t.jsx)(n.td,{children:"Trigger garbage collection"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"Trigger faults by setting Byteman configuration files"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["For different ",(0,t.jsx)(n.code,{children:"action"})," values, there are different configuration items that can be filled in."]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-latency",children:["Parameters for ",(0,t.jsx)(n.code,{children:"latency"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"latency"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The duration of increasing method latency. The unit is millisecond."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-return",children:["Parameters for ",(0,t.jsx)(n.code,{children:"return"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"value"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:'Specifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-exception",children:["Parameters for ",(0,t.jsx)(n.code,{children:"exception"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"class"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the Java class"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"method"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The name of the method"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"exception"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"The thrown custom exception, such as 'java.io.IOException(\"BOOM\")'."}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-stress",children:["Parameters for ",(0,t.jsx)(n.code,{children:"stress"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"cpuCount"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsxs)(n.td,{children:["The number of CPU cores used for increasing CPU stress. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"memType"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsxs)(n.td,{children:["The type of OOM. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,t.jsx)(n.code,{children:"cpu-count"})," and ",(0,t.jsx)(n.code,{children:"mem-type"}),"."]}),(0,t.jsx)(n.td,{children:"No"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-gc",children:["Parameters for ",(0,t.jsx)(n.code,{children:"gc"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsx)(n.tbody,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})})]}),"\n",(0,t.jsxs)(n.h3,{id:"parameters-for-ruledata",children:["Parameters for ",(0,t.jsx)(n.code,{children:"ruleData"})]}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Parameter"}),(0,t.jsx)(n.th,{children:"Type"}),(0,t.jsx)(n.th,{children:"Description"}),(0,t.jsx)(n.th,{children:"Required"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"ruleData"})}),(0,t.jsx)(n.td,{children:"string"}),(0,t.jsx)(n.td,{children:"Specifies the Byteman configuration data"}),(0,t.jsx)(n.td,{children:"Yes"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"port"})}),(0,t.jsx)(n.td,{children:"int"}),(0,t.jsx)(n.td,{children:"The port ID attached to the Java process agent. The faults are injected into the Java process through this ID."}),(0,t.jsx)(n.td,{children:"No"})]})]})]}),"\n",(0,t.jsxs)(n.p,{children:["When you write the rule configuration file, take into account the specific Java program and the ",(0,t.jsx)(n.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),". For example:"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,t.jsx)(n.p,{children:'You need to escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data" as follows:'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-txt",children:'\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"\n'})})]})}function o(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},10476:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},21785:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},88586:(e,n,s)=>{s.d(n,{A:()=>t});const t=s.p+"assets/images/jvmchaos-exp-fd327cba6c3f8efc68f6f672e8c60ac4.png"},6383:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>d});var t=s(30758);const r={},l=t.createContext(r);function i(e){const n=t.useContext(l);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b14d964f.ac1ca1e6.js b/assets/js/b14d964f.ac1ca1e6.js deleted file mode 100644 index 6452bd0776..0000000000 --- a/assets/js/b14d964f.ac1ca1e6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[3627],{8348:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.5.2/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/2.5.2/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/2.5.2/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/2.5.2/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is milisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. Regarding to the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b14d964f.be35c3ea.js b/assets/js/b14d964f.be35c3ea.js new file mode 100644 index 0000000000..fe7379ffc2 --- /dev/null +++ b/assets/js/b14d964f.be35c3ea.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[3627],{8348:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>l,metadata:()=>d,toc:()=>c});var i=n(86070),s=n(6383);const l={title:"Simulate JVM Application Faults"},r=void 0,d={id:"simulate-jvm-application-chaos-in-physical-nodes",title:"Simulate JVM Application Faults",description:"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:",source:"@site/versioned_docs/version-2.5.2/simulate-jvm-application-chaos-in-physical-nodes.md",sourceDirName:".",slug:"/simulate-jvm-application-chaos-in-physical-nodes",permalink:"/docs/2.5.2/simulate-jvm-application-chaos-in-physical-nodes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-jvm-application-chaos-in-physical-nodes.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate JVM Application Faults"},sidebar:"docs",previous:{title:"Simulate Disk Faults",permalink:"/docs/2.5.2/simulate-disk-pressure-in-physical-nodes"},next:{title:"Simulate Time Faults",permalink:"/docs/2.5.2/simulate-time-chaos-on-physical-nodes"}},a={},c=[{value:"Create experiments using the command-line mode",id:"create-experiments-using-the-command-line-mode",level:2},{value:"Throw custom exceptions using the command-line mode",id:"throw-custom-exceptions-using-the-command-line-mode",level:3},{value:"Commands for throwing custom exceptions",id:"commands-for-throwing-custom-exceptions",level:4},{value:"Configuration description for throwing custom exceptions",id:"configuration-description-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions",id:"example-for-throwing-custom-exceptions",level:4},{value:"Trigger garbage collection using the command-line mode",id:"trigger-garbage-collection-using-the-command-line-mode",level:3},{value:"Commands for triggering garbage collection",id:"commands-for-triggering-garbage-collection",level:4},{value:"Configuration description for triggering garbage collection",id:"configuration-description-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection",id:"example-for-triggering-garbage-collection",level:4},{value:"Increase method latency using the command-line mode",id:"increase-method-latency-using-the-command-line-mode",level:3},{value:"Commands for increasing method latency",id:"commands-for-increasing-method-latency",level:4},{value:"Configuration description for increasing method latency",id:"configuration-description-for-increasing-method-latency",level:4},{value:"Example for increasing method latency",id:"example-for-increasing-method-latency",level:4},{value:"Modify return values of a method using the command-line mode",id:"modify-return-values-of-a-method-using-the-command-line-mode",level:3},{value:"Commands for modifying return values of a method",id:"commands-for-modifying-return-values-of-a-method",level:4},{value:"Configuration description for modifying return values of a method",id:"configuration-description-for-modifying-return-values-of-a-method",level:4},{value:"Example for simulating the scenario of modifying return values of a method",id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",level:4},{value:"Trigger faults by setting Byteman configuration files using the command-line mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",level:3},{value:"Commands for triggering faults by setting Byteman configuration files",id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Configuration description for triggering faults by setting Byteman configuration files",id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files",id:"example-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Increase JVM stress using the command-line mode",id:"increase-jvm-stress-using-the-command-line-mode",level:3},{value:"Commands for increasing JVM stress",id:"commands-for-increasing-jvm-stress",level:4},{value:"Configuration description for increasing JVM stress",id:"configuration-description-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress",id:"example-for-increasing-jvm-stress",level:4},{value:"Create experiments using the service mode",id:"create-experiments-using-the-service-mode",level:2},{value:"Throw custom exceptions using the service mode",id:"throw-custom-exceptions-using-the-service-mode",level:3},{value:"Parameters for throwing custom exceptions",id:"parameters-for-throwing-custom-exceptions",level:4},{value:"Example for throwing custom exceptions using the service mode",id:"example-for-throwing-custom-exceptions-using-the-service-mode",level:4},{value:"Trigger garbage collection using service mode",id:"trigger-garbage-collection-using-service-mode",level:3},{value:"Parameters for triggering garbage collection",id:"parameters-for-triggering-garbage-collection",level:4},{value:"Example for triggering garbage collection using the service mode",id:"example-for-triggering-garbage-collection-using-the-service-mode",level:4},{value:"Increase method latency using service mode",id:"increase-method-latency-using-service-mode",level:3},{value:"Parameters for increasing method latency",id:"parameters-for-increasing-method-latency",level:4},{value:"Example for increasing method latency using the service mode",id:"example-for-increasing-method-latency-using-the-service-mode",level:4},{value:"Modify return values of a method using service mode",id:"modify-return-values-of-a-method-using-service-mode",level:3},{value:"Parameters for modifying return values of a method",id:"parameters-for-modifying-return-values-of-a-method",level:4},{value:"Example for modifying return values of a method using the service mode",id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",level:4},{value:"Trigger faults by setting Byteman configuration files using service mode",id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",level:3},{value:"Parameters for triggering faults by setting Byteman configuration files",id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",level:4},{value:"Example for triggering faults by setting Byteman configuration files using the service mode",id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",level:4},{value:"Increase JVM stress using the service mode",id:"increase-jvm-stress-using-the-service-mode",level:3},{value:"Parameters for increasing JVM stress",id:"parameters-for-increasing-jvm-stress",level:4},{value:"Example for increasing JVM stress using the service mode",id:"example-for-increasing-jvm-stress-using-the-service-mode",level:4}];function o(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(t.p,{children:["Chaosd simulates the faults of JVM application through ",(0,i.jsx)(t.a,{href:"https://github.com/chaos-mesh/byteman",children:"Byteman"}),". The supported fault types are as follows:"]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"Throw custom exceptions"}),"\n",(0,i.jsx)(t.li,{children:"Trigger garbage collection"}),"\n",(0,i.jsx)(t.li,{children:"Increase method latency"}),"\n",(0,i.jsx)(t.li,{children:"Modify return values of a method"}),"\n",(0,i.jsx)(t.li,{children:"Trigger faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.li,{children:"Increase JVM pressure"}),"\n"]}),"\n",(0,i.jsx)(t.p,{children:"This document describes how to use Chaosd to create the above fault types of JVM experiments."}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-command-line-mode",children:"Create experiments using the command-line mode"}),"\n",(0,i.jsx)(t.p,{children:"This section introduces how to create the experiments of JVM application faults using the command-line mode."}),"\n",(0,i.jsx)(t.p,{children:"Before creating the experiment, you can run the following command line to see the types of JVM application faults supported by Chaosd:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm -h\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"JVM attack related commands\n\nUsage:\n chaosd attack jvm [command]\n\nAvailable Commands:\n exception throw specified exception for specified method\n gc trigger GC for JVM\n latency inject latency to specified method\n return return specified value for specified method\n rule-file inject fault with configured byteman rule file\n stress inject stress to JVM\n\nFlags:\n -h, --help help for jvm\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --uid string the experiment ID\n\nUse \"chaosd attack jvm [command] --help\" for more information about a command.\n"})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-command-line-mode",children:"Throw custom exceptions using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-throwing-custom-exceptions",children:"Commands for throwing custom exceptions"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that throws custom exceptions, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"throw specified exception for specified method\n\nUsage:\n chaosd attack jvm exception [options] [flags]\n\nFlags:\n -c, --class string Java class name\n --exception string the exception which needs to throw for action 'exception'\n -h, --help help for exception\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-throwing-custom-exceptions",children:"Configuration description for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions",children:"Example for throwing custom exceptions"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm exception -c Main -m sayhello --exception 'java.io.IOException(\"BOOM\")' --pid 30045\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:39:39.106 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-exception-q6nd0\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tthrow new java.io.IOException(\\"BOOM\\");\\nENDRULE\\n"] [file=/tmp/rule.btm296930759]\nAttack jvm successfully, uid: 26a45ae2-d395-46f5-a126-2b2c6c85ae9d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-the-command-line-mode",children:"Trigger garbage collection using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-garbage-collection",children:"Commands for triggering garbage collection"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers garbage collection, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"trigger GC for JVM\n\nUsage:\n chaosd attack jvm gc [flags]\n\nFlags:\n -h, --help help for gc\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-garbage-collection",children:"Configuration description for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection",children:"Example for triggering garbage collection"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm gc --pid 89345\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 02:49:47.850 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --gc-u0mlf\\nGC\\nENDRULE\\n"] [file=/tmp/rule.btm012481052]\nAttack jvm successfully, uid: f360e70a-5359-49b6-8526-d7e0a3c6f696\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation, and the experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-the-command-line-mode",children:"Increase method latency using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-method-latency",children:"Commands for increasing method latency"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases method latency, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject latency to specified method\n\nUsage:\n chaosd attack jvm latency [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for latency\n --latency int the latency duration, unit ms\n -m, --method string the method name in Java class\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-method-latency",children:"Configuration description for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"c"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency",children:"Example for increasing method latency"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:08:50.716 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-sayhello-latency-hlib2\\nCLASS Main\\nMETHOD sayhello\\nAT ENTRY\\nIF true\\nDO \\n\\tThread.sleep(5000);\\nENDRULE\\n"] [file=/tmp/rule.btm359997255]\n[2021/08/05 03:08:51.155 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-sayhello-latency-hlib2\\n\\n"]\nAttack jvm successfully, uid: bbe00c57-ac9d-4113-bf0c-2a6f184be261\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-the-command-line-mode",children:"Modify return values of a method using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-modifying-return-values-of-a-method",children:"Commands for modifying return values of a method"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that modifies return values of a method, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --help\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"return specified value for specified method\n\nUsage:\n chaosd attack jvm return [options] [flags]\n\nFlags:\n -c, --class string Java class name\n -h, --help help for return\n -m, --method string the method name in Java class\n --value string the return value for action 'return'. Only supports number and string types.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-modifying-return-values-of-a-method",children:"Configuration description for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"c"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"m"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"value"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required to be configured. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"pid"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required to be configured"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"port"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-simulating-the-scenario-of-modifying-return-values-of-a-method",children:"Example for simulating the scenario of modifying return values of a method"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm return --class Main --method getnum --value 999 --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:35:10.603 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE Main-getnum-return-i6gb7\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO \\n\\treturn 999;\\nENDRULE\\n"] [file=/tmp/rule.btm051982059]\n[2021/08/05 03:35:10.820 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule Main-getnum-return-i6gb7\\n\\n"]\nAttack jvm successfully, uid: e2f204f6-4bed-4d92-aade-2b4a47b02e5d\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-the-command-line-mode",children:"Trigger faults by setting Byteman configuration files using the command-line mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules in the Byteman rule configuration file, and then inject the faults by specifying the path of the configuration file using Chaosd. Regarding the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-triggering-faults-by-setting-byteman-configuration-files",children:"Commands for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that triggers faults by setting Byteman configuration files, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject fault with configured byteman rule file\n\nUsage:\n chaosd attack jvm rule-file [options] [flags]\n\nFlags:\n -h, --help help for rule-file\n -p, --path string the path of configured byteman rule file\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-triggering-faults-by-setting-byteman-configuration-files",children:"Configuration description for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"path"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the path of the Byteman configuration file"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files",children:"Example for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsxs)(t.p,{children:["Then, save the configuration file to the ",(0,i.jsx)(t.code,{children:"return.btm"})," file. After that, run the following command to inject faults."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm rule-file -p ./return.btm --pid 112694\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:45:40.757 +00:00] [INFO] [jvm.go:152] ["rule file data:RULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO\\n return 9999\\nENDRULE\\n"]\n[2021/08/05 03:45:41.011 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule modify return value\\n\\n"]\nAttack jvm successfully, uid: 5ca2e06d-a7c6-421d-bb67-0c9908bac17a\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-command-line-mode",children:"Increase JVM stress using the command-line mode"}),"\n",(0,i.jsx)(t.h4,{id:"commands-for-increasing-jvm-stress",children:"Commands for increasing JVM stress"}),"\n",(0,i.jsx)(t.p,{children:"To see the usage and configuration items of the command that increases JVM stress, run the following command:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --help\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"inject stress to JVM\n\nUsage:\n chaosd attack jvm stress [options] [flags]\n\nFlags:\n --cpu-count int the CPU core number\n -h, --help help for stress\n --mem-type int the memory type to be allocated. The value can be 'stack' or 'heap'.\n\nGlobal Flags:\n --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'\n --pid int the pid of Java process which needs to attach\n --port int the port of agent server (default 9288)\n --uid string the experiment ID\n"})}),"\n",(0,i.jsx)(t.h4,{id:"configuration-description-for-increasing-jvm-stress",children:"Configuration description for increasing JVM stress"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"cpu-count"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The number of CPU cores used for increasing JVM stress"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"mem-type"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The type of OOM"}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"None"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress",children:"Example for increasing JVM stress"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd attack jvm stress --cpu-count 2 --pid 123546\n"})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'[2021/08/05 03:59:51.256 +00:00] [INFO] [jvm.go:208] ["byteman rule"] [rule="\\nRULE --stress-jfeiu\\nSTRESS CPU\\nCPUCOUNT 2\\nENDRULE\\n"] [file=/tmp/rule.btm773062009]\n[2021/08/05 03:59:51.613 +00:00] [INFO] [jvm.go:94] ["submit rules"] [output="install rule --stress-jfeiu\\n\\n"]\nAttack jvm successfully, uid: b9b997b5-0a0d-4f1f-9081-d52a32318b84\n'})}),"\n",(0,i.jsx)(t.h2,{id:"create-experiments-using-the-service-mode",children:"Create experiments using the service mode"}),"\n",(0,i.jsx)(t.p,{children:"You can follow the instructions below to create experiments using the service mode."}),"\n",(0,i.jsxs)(t.ol,{children:["\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsx)(t.p,{children:"Execute Chaosd in service mode:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"chaosd server --port 31767\n"})}),"\n"]}),"\n",(0,i.jsxs)(t.li,{children:["\n",(0,i.jsxs)(t.p,{children:["Send HTTP POST request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:"curl -X POST 172.16.112.130:31767/api/attack/jvm -H \"Content-Type:application/json\" -d '{fault-configuration}'\n"})}),"\n",(0,i.jsxs)(t.p,{children:["For the ",(0,i.jsx)(t.code,{children:"fault-configuration"})," part in the above command, you need to configure it according to the fault types. For the corresponding parameters, refer to the parameters and examples of each fault type in the following sections."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(t.admonition,{type:"note",children:(0,i.jsxs)(t.p,{children:["When running an experiment, remember to save the UID information of the experiment. When you want to end the experiment corresponding to the UID, you need to send an HTTP DELETE request to the ",(0,i.jsx)(t.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]})}),"\n",(0,i.jsx)(t.h3,{id:"throw-custom-exceptions-using-the-service-mode",children:"Throw custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-throwing-custom-exceptions",children:"Parameters for throwing custom exceptions"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "exception"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"exception"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The thrown custom exception"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The faults is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-throwing-custom-exceptions-using-the-service-mode",children:"Example for throwing custom exceptions using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"exception","class":"Main","method":"sayhello","exception":"java.io.IOException(\\"BOOM\\")","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-garbage-collection-using-service-mode",children:"Trigger garbage collection using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-garbage-collection",children:"Parameters for triggering garbage collection"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "gc"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-garbage-collection-using-the-service-mode",children:"Example for triggering garbage collection using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"gc","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,i.jsx)(t.p,{children:"Triggering garbage collection is a one-time operation. The experiment does not require recovery."}),"\n",(0,i.jsx)(t.h3,{id:"increase-method-latency-using-service-mode",children:"Increase method latency using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-method-latency",children:"Parameters for increasing method latency"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "latency"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"latency"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The duration of increasing method latency"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required. The unit is millisecond."})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is needed to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-method-latency-using-the-service-mode",children:"Example for increasing method latency using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"modify-return-values-of-a-method-using-service-mode",children:"Modify return values of a method using service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-modifying-return-values-of-a-method",children:"Parameters for modifying return values of a method"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "return"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"class"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the Java class"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"method"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The name of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"value"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the return value of the method"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'string type, required. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-modifying-return-values-of-a-method-using-the-service-mode",children:"Example for modifying return values of a method using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"return","class":"Main","method":"getnum","value":"999","pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"trigger-faults-by-setting-byteman-configuration-files-using-service-mode",children:"Trigger faults by setting Byteman configuration files using service mode"}),"\n",(0,i.jsxs)(t.p,{children:["You can set the fault rules according to the Byteman rule configuration. For more information about the Byteman rule configuration, refer to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"byteman-rule-language"}),"."]}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-triggering-faults-by-setting-byteman-configuration-files",children:"Parameters for triggering faults by setting Byteman configuration files"}),"\n",(0,i.jsxs)(t.table,{children:[(0,i.jsx)(t.thead,{children:(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Parameter"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Description"}),(0,i.jsx)(t.th,{style:{textAlign:"left"},children:"Value"})]})}),(0,i.jsxs)(t.tbody,{children:[(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"action"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The action of the experiment"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:'Set to "rule-data"'})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"rule-data"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"Specifies the Byteman configuration data"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"pid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The Java process ID where the fault is to be injected"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"int type, required"})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"port"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The port number attached to the Java process agent. The fault is injected into the Java process through this port number."}),(0,i.jsxs)(t.td,{style:{textAlign:"left"},children:["int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),"."]})]}),(0,i.jsxs)(t.tr,{children:[(0,i.jsx)(t.td,{style:{textAlign:"left"},children:(0,i.jsx)(t.code,{children:"uid"})}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"The experiment ID"}),(0,i.jsx)(t.td,{style:{textAlign:"left"},children:"string type. This item is not required to be configured, because Chaosd randomly creates one."})]})]})]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-triggering-faults-by-setting-byteman-configuration-files-using-the-service-mode",children:"Example for triggering faults by setting Byteman configuration files using the service mode"}),"\n",(0,i.jsxs)(t.p,{children:["First, based on the specific Java program and referring to ",(0,i.jsx)(t.a,{href:"https://downloads.jboss.org/byteman/4.0.16/byteman-programmers-guide.html#the-byteman-rule-language",children:"the Byteman rule language"}),", write a rule configuration file. For example:"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-txt",children:"RULE modify return value\nCLASS Main\nMETHOD getnum\nAT ENTRY\nIF true\nDO\n return 9999\nENDRULE\n"})}),"\n",(0,i.jsx)(t.p,{children:'Then, escape the line breaks in the configuration file to the newline character "\\n", and use the escaped text as the value of "rule-data". Run the following command:'}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 127.0.0.1:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"rule-data","pid":30045,"rule-data":"\\nRULE modify return value\\nCLASS Main\\nMETHOD getnum\\nAT ENTRY\\nIF true\\nDO return 9999\\nENDRULE\\n"}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})}),"\n",(0,i.jsx)(t.h3,{id:"increase-jvm-stress-using-the-service-mode",children:"Increase JVM stress using the service mode"}),"\n",(0,i.jsx)(t.h4,{id:"parameters-for-increasing-jvm-stress",children:"Parameters for increasing JVM stress"}),"\n",(0,i.jsxs)(t.p,{children:["| Parameter | Description | Value |\n| :-- | :-- | :-- | --- |\n| ",(0,i.jsx)(t.code,{children:"action"}),' | The action of the experiment | Set to "stress" |\n| ',(0,i.jsx)(t.code,{children:"cpu-count"})," | The number of CPU cores used for increasing CPU stress | int type. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"mem-type"})," | The type of OOM | string type. Currently, both 'stack' and 'heap' OOM types are supported. You must configure one item between ",(0,i.jsx)(t.code,{children:"cpu-count"})," and ",(0,i.jsx)(t.code,{children:"mem-type"}),". |\n| ",(0,i.jsx)(t.code,{children:"pid"})," | None | The Java process ID where the fault is to be injected | int type, required |\n| ",(0,i.jsx)(t.code,{children:"port"})," | None | The port number attached to the Java process agent. The fault is injected into the Java process through this port number. | int type. The default value is ",(0,i.jsx)(t.code,{children:"9288"}),". |\n| ",(0,i.jsx)(t.code,{children:"uid"})," | None | The experiment ID | string type. This item is not required to be configured, because Chaosd randomly creates one. |"]}),"\n",(0,i.jsx)(t.h4,{id:"example-for-increasing-jvm-stress-using-the-service-mode",children:"Example for increasing JVM stress using the service mode"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d \'{"action":"stress","cpu-count":1,"pid":1828622}\'\n'})}),"\n",(0,i.jsx)(t.p,{children:"The result is as follows:"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}\n'})})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(o,{...e})}):o(e)}},6383:(e,t,n)=>{n.d(t,{R:()=>r,x:()=>d});var i=n(30758);const s={},l=i.createContext(s);function r(e){const t=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function d(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b60c2781.28c8fa79.js b/assets/js/b60c2781.28c8fa79.js new file mode 100644 index 0000000000..d9a208038a --- /dev/null +++ b/assets/js/b60c2781.28c8fa79.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7768],{6228:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.",source:"@site/versioned_docs/version-2.4.3/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/2.4.3/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/chaosd-search-recover.md",tags:[],version:"2.4.3",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/2.4.3/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/2.4.3/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/b60c2781.5bdc6f99.js b/assets/js/b60c2781.5bdc6f99.js deleted file mode 100644 index 680286f059..0000000000 --- a/assets/js/b60c2781.5bdc6f99.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7768],{6228:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.",source:"@site/versioned_docs/version-2.4.3/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/2.4.3/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/chaosd-search-recover.md",tags:[],version:"2.4.3",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/2.4.3/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/2.4.3/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bc0eadd3.82bf308f.js b/assets/js/bc0eadd3.056e1aa3.js similarity index 74% rename from assets/js/bc0eadd3.82bf308f.js rename to assets/js/bc0eadd3.056e1aa3.js index 72d2b81717..5793600ebe 100644 --- a/assets/js/bc0eadd3.82bf308f.js +++ b/assets/js/bc0eadd3.056e1aa3.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[11],{22873:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/docs/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/next/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/inspect-chaos-experiments.md",tags:[],version:"current",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/next/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/next/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/next/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(45961).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(44550).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been succesfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},44550:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},45961:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[11],{22873:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/docs/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/next/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/inspect-chaos-experiments.md",tags:[],version:"current",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/next/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/next/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/next/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(45961).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(44550).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been successfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},44550:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},45961:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bda40383.8efb3d1f.js b/assets/js/bda40383.8efb3d1f.js new file mode 100644 index 0000000000..0ec3c9efb4 --- /dev/null +++ b/assets/js/bda40383.8efb3d1f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4546],{46481:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/versioned_docs/version-2.5.2/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/2.5.2/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/define-chaos-experiment-scope.md",tags:[],version:"2.5.2",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Remote Cluster Management",permalink:"/docs/2.5.2/remote-cluster-management"},next:{title:"Define Scheduling Rules",permalink:"/docs/2.5.2/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specify the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/2.5.2/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physical-machine-a\n - physical-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(20359).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},20359:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/bda40383.c4a48734.js b/assets/js/bda40383.c4a48734.js deleted file mode 100644 index 9fc2712e7b..0000000000 --- a/assets/js/bda40383.c4a48734.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4546],{46481:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var n=t(86070),i=t(6383);const l={title:"Define the Scope of Chaos Experiments"},r=void 0,o={id:"define-chaos-experiment-scope",title:"Define the Scope of Chaos Experiments",description:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius.",source:"@site/versioned_docs/version-2.5.2/define-chaos-experiment-scope.md",sourceDirName:".",slug:"/define-chaos-experiment-scope",permalink:"/docs/2.5.2/define-chaos-experiment-scope",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/define-chaos-experiment-scope.md",tags:[],version:"2.5.2",frontMatter:{title:"Define the Scope of Chaos Experiments"},sidebar:"docs",previous:{title:"Remote Cluster Management",permalink:"/docs/2.5.2/remote-cluster-management"},next:{title:"Define Scheduling Rules",permalink:"/docs/2.5.2/define-scheduling-rules"}},c={},a=[{value:"An overview of experiment scopes",id:"an-overview-of-experiment-scopes",level:2},{value:"Define the experiment scope in a YAML configuration file",id:"define-the-experiment-scope-in-a-yaml-configuration-file",level:2},{value:"Namespace selectors",id:"namespace-selectors",level:3},{value:"Label selectors",id:"label-selectors",level:3},{value:"Expression selectors",id:"expression-selectors",level:3},{value:"Annotation selectors",id:"annotation-selectors",level:3},{value:"Field selectors",id:"field-selectors",level:3},{value:"PodPhase selectors",id:"podphase-selectors",level:3},{value:"Node selectors",id:"node-selectors",level:3},{value:"Node list selector",id:"node-list-selector",level:3},{value:"Pod list selector",id:"pod-list-selector",level:3},{value:"Physical machine list selector",id:"physical-machine-list-selector",level:3},{value:"Define the experiment scope on Chaos Dashboard",id:"define-the-experiment-scope-on-chaos-dashboard",level:2},{value:"Compatibility matrix",id:"compatibility-matrix",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault's explosion radius."}),"\n",(0,n.jsx)(s.h2,{id:"an-overview-of-experiment-scopes",children:"An overview of experiment scopes"}),"\n",(0,n.jsx)(s.p,{children:"In Chaos Mesh, you can define the scope of a single Chaos experiment by specifying a selector."}),"\n",(0,n.jsx)(s.p,{children:"Different types of selectors correspond to different filtering rules. You can specify one or more selectors in a Chaos experiment to define the scope of your experiment. If multiple selectors are specified at the same time, the current experiment target must meet the rules of all specified selectors at the same time."}),"\n",(0,n.jsx)(s.p,{children:"When you create a Chaos experiment, Chaos Mesh supports the following ways to define the scope of an experiment. You can choose any one of the following ways as needed:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.li,{children:"Define the experiment scope on the Chaos Dashboard"}),"\n"]}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-in-a-yaml-configuration-file",children:"Define the experiment scope in a YAML configuration file"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering."}),"\n",(0,n.jsx)(s.h3,{id:"namespace-selectors",children:"Namespace selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the namespace of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"If this selector is empty or is not specified, Chaos Mesh will set it to the namespace of the current Chaos experiment."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n namespaces:\n - 'app-ns'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"label-selectors",children:"Label selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/",children:"labels"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple labels are specified, the experiment target must have all the labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n labelSelectors:\n 'app.kubernetes.io/component': 'tikv'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"expression-selectors",children:"Expression selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies a set of ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements",children:"expressions"})," that define the label's rules to specifiy the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"You can use this selector to set up the experiment's target Pod that does not meet some labels."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n expressionSelectors:\n - { key: tier, operator: In, values: [cache] }\n - { key: environment, operator: NotIn, values: [dev] }\n"})}),"\n",(0,n.jsx)(s.h3,{id:"annotation-selectors",children:"Annotation selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/",children:"annotations"})," that the experiment's target Pod must have."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple annotations are specified, the experiment target must have all annotations specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n annotationSelectors:\n 'example-annotation': 'group-a'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"field-selectors",children:"Field selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/",children:"fields"})," of the experiment's target Pod."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple fields are specified, the experiment target must have all fields set by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n fieldSelectors:\n 'metadata.name': 'my-pod'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"podphase-selectors",children:"PodPhase selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the phase of the experiment's target Pod."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsxs)(s.li,{children:["Supported phases: ",(0,n.jsx)(s.code,{children:"Pending"}),", ",(0,n.jsx)(s.code,{children:"Running"}),", ",(0,n.jsx)(s.code,{children:"Succeeded"}),", ",(0,n.jsx)(s.code,{children:"Failed"}),", ",(0,n.jsx)(s.code,{children:"Unknown"}),"."]}),"\n",(0,n.jsx)(s.li,{children:"This option is empty by default, which means that the target Pod's phase is not limited."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n podPhaseSelectors:\n - 'Running'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-selectors",children:"Node selectors"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the ",(0,n.jsx)(s.a,{href:"https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/",children:"node label"})," to which the experiment's target Pod belongs."]}),"\n",(0,n.jsx)(s.li,{children:"Data type: key-value pairs."}),"\n",(0,n.jsx)(s.li,{children:"If multiple node labels are specified, the node to which the experiment's target Pod belongs must have all labels specified by this selector."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodeSelectors:\n 'node-label': 'label-one'\n"})}),"\n",(0,n.jsx)(s.h3,{id:"node-list-selector",children:"Node list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Specifies the node to which the experiment's target Pod belongs."}),"\n",(0,n.jsx)(s.li,{children:"Data type: string array type."}),"\n",(0,n.jsx)(s.li,{children:"The target Pod can only belong to one node in the configured node list."}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n nodes:\n - node1\n - node2\n"})}),"\n",(0,n.jsx)(s.h3,{id:"pod-list-selector",children:"Pod list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"Pods"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"Pod"}),' and the "values" are the target ',(0,n.jsx)(s.code,{children:"Pod"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n pods:\n tidb-cluster: # namespace of the target pods\n - basic-tidb-0\n - basic-pd-0\n - basic-tikv-0\n - basic-tikv-1\n"})}),"\n",(0,n.jsx)(s.h3,{id:"physical-machine-list-selector",children:"Physical machine list selector"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsxs)(s.li,{children:["Specifies the namespaces and list of the experiment's target ",(0,n.jsx)(s.code,{children:"PhysicalMachines"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:['Type of data: key-value pairs. The "keys" are the namespaces of the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"}),', and the "values" are the target ',(0,n.jsx)(s.code,{children:"PhysicalMachine"})," list."]}),"\n",(0,n.jsxs)(s.li,{children:["If you have specified this selector, Chaos Mesh ",(0,n.jsx)(s.strong,{children:"ignores"})," other configured selectors."]}),"\n"]}),"\n",(0,n.jsx)(s.admonition,{type:"note",children:(0,n.jsxs)(s.p,{children:[(0,n.jsx)(s.code,{children:"PhysicalMachine"})," is a CRD (CustomResourcesDefinition) that represents a physical machine. To create ",(0,n.jsx)(s.code,{children:"PhysicalMachine"}),", Chaos Mesh uses ",(0,n.jsx)(s.a,{href:"/docs/2.5.2/chaosctl-tool#generate-tls-certificates-for-chaosd",children:"Chaosctl"}),"."]})}),"\n",(0,n.jsx)(s.p,{children:"When creating the experiment using the YAML file, you need to configure selectors. For example:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-yaml",children:"spec:\n selector:\n physicalMachines:\n default: # namespace of the target PhysicalMachines\n - physcial-machine-a\n - physcial-machine-b\n"})}),"\n",(0,n.jsx)(s.h2,{id:"define-the-experiment-scope-on-chaos-dashboard",children:"Define the experiment scope on Chaos Dashboard"}),"\n",(0,n.jsx)(s.p,{children:"If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information."}),"\n",(0,n.jsx)(s.p,{children:"The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Namespace selectors"}),"\n",(0,n.jsx)(s.li,{children:"Label selectors"}),"\n",(0,n.jsx)(s.li,{children:"Annotation selectors"}),"\n",(0,n.jsx)(s.li,{children:"Phase selectors"}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"While setting selectors, you can also view the actual scope of the experiment target in the Dashboard in real time and can directly modify the target Pod scope filtered by the selectors."}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Dashboard Selectors",src:t(20359).A+"",width:"815",height:"647"})}),"\n",(0,n.jsx)(s.h2,{id:"compatibility-matrix",children:"Compatibility matrix"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support Kubernetes"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Support physical machine"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Namespace Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Label Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Expression Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Annotation Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Field Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PodPhase Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Node List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Pod List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"PhysicalMachine List Selectors"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"})]})]})]})]})}function d(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},20359:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/dashboard_selectors_en-6eb46f8883de4818cbbc4f91e664fc47.png"},6383:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>o});var n=t(30758);const i={},l=n.createContext(i);function r(e){const s=n.useContext(l);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function o(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.createElement(l.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c143539c.0a08ab3a.js b/assets/js/c143539c.0a08ab3a.js new file mode 100644 index 0000000000..7b0bbfde25 --- /dev/null +++ b/assets/js/c143539c.0a08ab3a.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[6384],{67660:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/next/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/next/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/next/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/next/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/next/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Expose Chaos Dashboard with Ingress","href":"/docs/next/expose-dashboard-with-ingress","docId":"expose-dashboard-with-ingress","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/next/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/next/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/next/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/next/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"link","label":"Remote Cluster Management","href":"/docs/next/remote-cluster-management","docId":"remote-cluster-management","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/next/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/next/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/next/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/next/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/next/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/next/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/next/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/next/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/next/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/next/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/next/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/next/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/next/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/next/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/next/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/next/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/next/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/next/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/next/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/next/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/next/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Incidents","href":"/docs/next/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/next/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/next/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/next/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/next/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/next/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/next/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/next/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/next/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/next/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/next/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/next/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/next/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/next/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/next/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/next/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/next/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/next/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/next/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add a New Chaos Experiment Type","href":"/docs/next/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/next/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/next/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/next/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/next/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/next/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/next/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.5.0 Tracking","href":"/docs/next/release-2.5-tracking","docId":"release-2.5-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add a New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"The developer manual section may be out of date. If you find any problems or have any questions, please create an issue and let us know. Thank you for your contribution!","sidebar":"docs"},"expose-dashboard-with-ingress":{"id":"expose-dashboard-with-ingress","title":"Expose Chaos Dashboard with Ingress","description":"At times, you may need to make the Chaos Dashboard accessible to external users, while placing it under the subpath of your current monitoring dashboard.","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add a new chaos experiment type, you have added HelloWorldChaos, which can print Hello world! in the logs of Chaos Controller Manager.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.5-tracking":{"id":"release-2.5-tracking","title":"Chaos Mesh v2.5.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"remote-cluster-management":{"id":"remote-cluster-management","title":"Remote Cluster Management","description":"Remote Cluster Introduction","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Incidents","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and setup the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/c143539c.b870f0d1.js b/assets/js/c143539c.b870f0d1.js deleted file mode 100644 index c6385d3974..0000000000 --- a/assets/js/c143539c.b870f0d1.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[6384],{67660:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":"unreleased","badge":true,"noIndex":false,"className":"docs-version-current","isLast":false,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/next/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/next/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/next/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/next/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/next/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Expose Chaos Dashboard with Ingress","href":"/docs/next/expose-dashboard-with-ingress","docId":"expose-dashboard-with-ingress","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/next/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/next/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/next/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/next/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"link","label":"Remote Cluster Management","href":"/docs/next/remote-cluster-management","docId":"remote-cluster-management","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/next/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/next/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/next/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/next/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/next/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/next/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/next/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/next/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/next/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/next/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/next/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/next/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/next/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/next/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/next/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/next/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/next/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/next/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/next/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/next/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/next/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Incidents","href":"/docs/next/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/next/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/next/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/next/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/next/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/next/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/next/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/next/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/next/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/next/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/next/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/next/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/next/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/next/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/next/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/next/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/next/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/next/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/next/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add a New Chaos Experiment Type","href":"/docs/next/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/next/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/next/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/next/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/next/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/next/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/next/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.5.0 Tracking","href":"/docs/next/release-2.5-tracking","docId":"release-2.5-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add a New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"The developer manual section may be out of date. If you find any problems or have any questions, please create an issue and let us know. Thank you for your contribution!","sidebar":"docs"},"expose-dashboard-with-ingress":{"id":"expose-dashboard-with-ingress","title":"Expose Chaos Dashboard with Ingress","description":"At times, you may need to make the Chaos Dashboard accessible to external users, while placing it under the subpath of your current monitoring dashboard.","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add a new chaos experiment type, you have added HelloWorldChaos, which can print Hello world! in the logs of Chaos Controller Manager.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.5-tracking":{"id":"release-2.5-tracking","title":"Chaos Mesh v2.5.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"remote-cluster-management":{"id":"remote-cluster-management","title":"Remote Cluster Management","description":"Remote Cluster Introduction","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Incidents","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and setup the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/c44d6f6a.d2751cb9.js b/assets/js/c44d6f6a.4f6883d2.js similarity index 74% rename from assets/js/c44d6f6a.d2751cb9.js rename to assets/js/c44d6f6a.4f6883d2.js index 4262731b65..edeefed89d 100644 --- a/assets/js/c44d6f6a.d2751cb9.js +++ b/assets/js/c44d6f6a.4f6883d2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2849],{40085:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/versioned_docs/version-2.6.4/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/inspect-chaos-experiments.md",tags:[],version:"2.6.4",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(22421).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(46850).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been succesfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},46850:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},22421:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2849],{40085:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/versioned_docs/version-2.6.4/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/inspect-chaos-experiments.md",tags:[],version:"2.6.4",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(22421).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(46850).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been successfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},46850:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},22421:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ca94432f.6dc596e5.js b/assets/js/ca94432f.6dc596e5.js deleted file mode 100644 index 04d4da68b4..0000000000 --- a/assets/js/ca94432f.6dc596e5.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[5607],{11112:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.",source:"@site/versioned_docs/version-2.5.2/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/2.5.2/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/chaosd-search-recover.md",tags:[],version:"2.5.2",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/2.5.2/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/2.5.2/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ca94432f.ee175ffd.js b/assets/js/ca94432f.ee175ffd.js new file mode 100644 index 0000000000..0eaa32d018 --- /dev/null +++ b/assets/js/ca94432f.ee175ffd.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[5607],{11112:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.",source:"@site/versioned_docs/version-2.5.2/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/2.5.2/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/chaosd-search-recover.md",tags:[],version:"2.5.2",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/2.5.2/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/2.5.2/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d4b8d191.5077229f.js b/assets/js/d4b8d191.5077229f.js new file mode 100644 index 0000000000..364a3da903 --- /dev/null +++ b/assets/js/d4b8d191.5077229f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[578],{52955:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.",source:"@site/docs/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/next/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/chaosd-search-recover.md",tags:[],version:"current",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/next/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/next/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/d4b8d191.57bb04fe.js b/assets/js/d4b8d191.57bb04fe.js deleted file mode 100644 index f1d68f4fbe..0000000000 --- a/assets/js/d4b8d191.57bb04fe.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[578],{52955:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.",source:"@site/docs/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/next/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/chaosd-search-recover.md",tags:[],version:"current",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/next/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/next/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e0508589.52686267.js b/assets/js/e0508589.87880677.js similarity index 99% rename from assets/js/e0508589.52686267.js rename to assets/js/e0508589.87880677.js index 5a11222120..fdc8707b6f 100644 --- a/assets/js/e0508589.52686267.js +++ b/assets/js/e0508589.87880677.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[6547],{93501:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/versioned_docs/version-2.4.3/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/2.4.3/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-network-chaos-on-kubernetes.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/2.4.3/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/2.4.3/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Net emulation example",id:"net-emulation-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(34747).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(27364).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(37198).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"net-emulation-example",children:"Net emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available vaules include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/2.4.3/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},34747:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},37198:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},27364:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[6547],{93501:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/versioned_docs/version-2.4.3/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/2.4.3/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/simulate-network-chaos-on-kubernetes.md",tags:[],version:"2.4.3",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/2.4.3/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/2.4.3/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Net emulation example",id:"net-emulation-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(34747).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(27364).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(37198).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"net-emulation-example",children:"Net emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available values include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/2.4.3/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},34747:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},37198:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},27364:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e84af1dc.20a86aa3.js b/assets/js/e84af1dc.23a0ff3c.js similarity index 99% rename from assets/js/e84af1dc.20a86aa3.js rename to assets/js/e84af1dc.23a0ff3c.js index 0cd9c83531..f0567f8fba 100644 --- a/assets/js/e84af1dc.20a86aa3.js +++ b/assets/js/e84af1dc.23a0ff3c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4853],{34025:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/versioned_docs/version-2.5.2/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/2.5.2/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-network-chaos-on-kubernetes.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/2.5.2/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/2.5.2/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Net emulation example",id:"net-emulation-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(60503).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(83608).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(34778).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"net-emulation-example",children:"Net emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available vaules include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/2.5.2/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},60503:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},34778:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},83608:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4853],{34025:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>d,default:()=>h,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var i=t(86070),s=t(6383);const r={title:"Simulate Network Faults"},d=void 0,l={id:"simulate-network-chaos-on-kubernetes",title:"Simulate Network Faults",description:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.",source:"@site/versioned_docs/version-2.5.2/simulate-network-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-network-chaos-on-kubernetes",permalink:"/docs/2.5.2/simulate-network-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/simulate-network-chaos-on-kubernetes.md",tags:[],version:"2.5.2",frontMatter:{title:"Simulate Network Faults"},sidebar:"docs",previous:{title:"Simulate Pod Faults",permalink:"/docs/2.5.2/simulate-pod-chaos-on-kubernetes"},next:{title:"Simulate Stress Scenarios",permalink:"/docs/2.5.2/simulate-heavy-stress-on-kubernetes"}},c={},o=[{value:"NetworkChaos introduction",id:"networkchaos-introduction",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML files",id:"create-experiments-using-the-yaml-files",level:2},{value:"Net emulation example",id:"net-emulation-example",level:3},{value:"Partition example",id:"partition-example",level:3},{value:"Bandwidth example",id:"bandwidth-example",level:3},{value:"Field description",id:"field-description",level:2},{value:"Description for action-related fields",id:"description-for-action-related-fields",level:2},{value:"delay",id:"delay",level:3},{value:"reorder",id:"reorder",level:3},{value:"loss",id:"loss",level:3},{value:"duplicate",id:"duplicate",level:3},{value:"corrupt",id:"corrupt",level:3},{value:"bandwidth",id:"bandwidth",level:3}];function a(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,s.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.p,{children:"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh."}),"\n",(0,i.jsx)(n.h2,{id:"networkchaos-introduction",children:"NetworkChaos introduction"}),"\n",(0,i.jsx)(n.p,{children:"NetworkChaos is a fault type in Chaos Mesh. By creating a NetworkChaos experiment, you can simulate a network fault scenario for a cluster. Currently, NetworkChaos supports the following fault types:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Partition"}),": network disconnection and partition."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Net Emulation"}),": poor network conditions, such as high delays, high packet loss rate, packet reordering, and so on."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"Bandwidth"}),": limit the communication bandwidth between nodes."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,i.jsx)(n.p,{children:"Before creating NetworkChaos experiments, ensure the following:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsx)(n.li,{children:"During the network injection process, make sure that the connection between Controller Manager and Chaos Daemon works, otherwise the NetworkChaos cannot be restored anymore."}),"\n",(0,i.jsx)(n.li,{children:"If you want to simulate Net Emulation fault, make sure the NET_SCH_NETEM module is installed in the Linux kernel. If you are using CentOS, you can install the module through the kernel-modules-extra package. Most other Linux distributions have installed the module already by default."}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Open Chaos Dashboard, and click ",(0,i.jsx)(n.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Create Experiment",src:t(60503).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["In the ",(0,i.jsx)(n.strong,{children:"Choose a Target"})," area, choose ",(0,i.jsx)(n.strong,{children:"NETWORK ATTACK"})," and select a specific behavior, such as ",(0,i.jsx)(n.strong,{children:"LOSS"}),". Then fill out specific configuration."]}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"NetworkChaos Experiments",src:t(83608).A+"",width:"2018",height:"1480"})}),"\n",(0,i.jsxs)(n.p,{children:["For details of specific configuration fields, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration."}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.img,{alt:"Experiment Information",src:t(34778).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-experiments-using-the-yaml-files",children:"Create experiments using the YAML files"}),"\n",(0,i.jsx)(n.h3,{id:"net-emulation-example",children:"Net emulation example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-delay.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: delay\nspec:\n action: delay\n mode: one\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'web-show'\n delay:\n latency: '10ms'\n correlation: '100'\n jitter: '0ms'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration causes a latency of 10 milliseconds in the network connections of the target Pods. In addition to latency injection, Chaos Mesh supports packet loss and packet reordering injection. For details, see ",(0,i.jsx)(n.a,{href:"#field-description",children:"field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-delay.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"partition-example",children:"Partition example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-partition.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: partition\nspec:\n action: partition\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n direction: to\n target:\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app2'\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration blocks the connection created from ",(0,i.jsx)(n.code,{children:"app1"})," to ",(0,i.jsx)(n.code,{children:"app2"}),". The value for the ",(0,i.jsx)(n.code,{children:"direction"})," field can be ",(0,i.jsx)(n.code,{children:"to"}),", ",(0,i.jsx)(n.code,{children:"from"})," or ",(0,i.jsx)(n.code,{children:"both"}),". For details, refer to ",(0,i.jsx)(n.a,{href:"#field-description",children:"Field description"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-partition.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth-example",children:"Bandwidth example"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Write the experiment configuration to the ",(0,i.jsx)(n.code,{children:"network-bandwidth.yaml"})," file, as shown below:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: NetworkChaos\nmetadata:\n name: bandwidth\nspec:\n action: bandwidth\n mode: all\n selector:\n namespaces:\n - default\n labelSelectors:\n 'app': 'app1'\n bandwidth:\n rate: '1mbps'\n limit: 20971520\n buffer: 10000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This configuration limits the bandwidth of ",(0,i.jsx)(n.code,{children:"app1"})," to 1 mbps."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["After the configuration file is prepared, use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create the experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f ./network-bandwidth.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"field-description",children:"Field description"}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"action"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Indicates the specific fault type. Available types include: ",(0,i.jsx)(n.code,{children:"netem"}),", ",(0,i.jsx)(n.code,{children:"delay"})," (network delay), ",(0,i.jsx)(n.code,{children:"loss"})," (packet loss), ",(0,i.jsx)(n.code,{children:"duplicate"})," (packet duplicating), ",(0,i.jsx)(n.code,{children:"corrupt"})," (packet corrupt), ",(0,i.jsx)(n.code,{children:"partition"})," (network partition), and ",(0,i.jsx)(n.code,{children:"bandwidth"})," (network bandwidth limit). After you specify ",(0,i.jsx)(n.code,{children:"action"})," field, refer to ",(0,i.jsxs)(n.a,{href:"#description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]})," for other necessary field configuration."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"Partition"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"target"}),(0,i.jsx)(n.td,{children:"Selector"}),(0,i.jsx)(n.td,{children:"Used in combination with direction, making Chaos only effective for some packets."}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"direction"}),(0,i.jsx)(n.td,{children:"enum"}),(0,i.jsxs)(n.td,{children:["Indicates the direction of ",(0,i.jsx)(n.code,{children:"target"})," packets. Available values include ",(0,i.jsx)(n.code,{children:"from"})," (the packets from ",(0,i.jsx)(n.code,{children:"target"}),"), ",(0,i.jsx)(n.code,{children:"to"})," (the packets to ",(0,i.jsx)(n.code,{children:"target"}),"), and ",(0,i.jsx)(n.code,{children:"both"})," ( the packets from or to ",(0,i.jsx)(n.code,{children:"target"}),"). This parameter makes Chaos only take effect for a specific direction of packets."]}),(0,i.jsx)(n.td,{children:"to"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"both"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"mode"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Specifies the mode of the experiment. The mode options include ",(0,i.jsx)(n.code,{children:"one"})," (selecting a random Pod), ",(0,i.jsx)(n.code,{children:"all"})," (selecting all eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,i.jsx)(n.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,i.jsx)(n.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:(0,i.jsx)(n.code,{children:"one"})})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"value"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsxs)(n.td,{children:["Provides a parameter for the ",(0,i.jsx)(n.code,{children:"mode"})," configuration, depending on ",(0,i.jsx)(n.code,{children:"mode"}),". For example, when ",(0,i.jsx)(n.code,{children:"mode"})," is set to ",(0,i.jsx)(n.code,{children:"fixed-percent"}),", ",(0,i.jsx)(n.code,{children:"value"})," specifies the percentage of Pods."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"selector"}),(0,i.jsx)(n.td,{children:"struct"}),(0,i.jsxs)(n.td,{children:["Specifies the target Pod. For details, refer to ",(0,i.jsx)(n.a,{href:"/docs/2.5.2/define-chaos-experiment-scope",children:"Define the experiment scope"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"externalTargets"}),(0,i.jsx)(n.td,{children:"[]string"}),(0,i.jsxs)(n.td,{children:["Indicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with ",(0,i.jsx)(n.code,{children:"direction: to"}),"."]}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1.1.1.1, google.com"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"device"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Specifies the affected network interface"}),(0,i.jsx)(n.td,{children:"None"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:'"eth0"'})]})]})]}),"\n",(0,i.jsxs)(n.h2,{id:"description-for-action-related-fields",children:["Description for ",(0,i.jsx)(n.code,{children:"action"}),"-related fields"]}),"\n",(0,i.jsxs)(n.p,{children:["For the Net Emulation and Bandwidth fault types, you can further configure the ",(0,i.jsx)(n.code,{children:"action"})," related parameters according to the following description."]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Net Emulation type: ",(0,i.jsx)(n.code,{children:"delay"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicated"}),", ",(0,i.jsx)(n.code,{children:"corrupt"})]}),"\n",(0,i.jsxs)(n.li,{children:["Bandwidth type: ",(0,i.jsx)(n.code,{children:"bandwidth"})]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"delay",children:"delay"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"delay"})," means simulating network delay fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"latency"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"2ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the current latency and the previous one. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"jitter"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the range of the network latency"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1ms"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"Reorder(#Reorder)"}),(0,i.jsx)(n.td,{children:"Indicates the status of network packet reordering"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["The computational model for ",(0,i.jsx)(n.code,{children:"correlation"})," is as follows:"]}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Generate a random number whose distribution is related to the previous value:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"rnd = value * (1-corr) + last_rnd * corr\n"})}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"rnd"})," is the random number. ",(0,i.jsx)(n.code,{children:"corr"})," is the ",(0,i.jsx)(n.code,{children:"correlation"})," you fill out before."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsx)(n.p,{children:"Use this random number to determine the delay of the current packet:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"((rnd % (2 * sigma)) + mu) - sigma\n"})}),"\n",(0,i.jsxs)(n.p,{children:["In the above command, ",(0,i.jsx)(n.code,{children:"sigma"})," is ",(0,i.jsx)(n.code,{children:"jitter"})," and ",(0,i.jsx)(n.code,{children:"mu"})," is ",(0,i.jsx)(n.code,{children:"latency"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h3,{id:"reorder",children:"reorder"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"reorder"})," means simulating network packet reordering fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"reorder"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability to reorder"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"0.5"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between this time's length of delay time and the previous time's length of delay time. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"gap"}),(0,i.jsx)(n.td,{children:"int"}),(0,i.jsx)(n.td,{children:"Indicates the gap before and after packet reordering"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"5"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"loss",children:"loss"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"loss"})," means simulating packet loss fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"loss"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet loss and the previous time's packet loss. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"duplicate",children:"duplicate"}),"\n",(0,i.jsxs)(n.p,{children:["Set ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"duplicate"}),", meaning simulating package duplication. At this point, you can also set the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"duplicate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet duplicating and the previous time's packet duplicating. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsx)(n.h3,{id:"corrupt",children:"corrupt"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"corrupt"})," means simulating package corruption fault. You can also configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"corrupt"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the probability of packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"correlation"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the correlation between the probability of current packet corruption and the previous time's packet corruption. Range of value: [0, 100]"}),(0,i.jsx)(n.td,{children:"0"}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"50"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For occasional events such as ",(0,i.jsx)(n.code,{children:"reorder"}),", ",(0,i.jsx)(n.code,{children:"loss"}),", ",(0,i.jsx)(n.code,{children:"duplicate"}),", and ",(0,i.jsx)(n.code,{children:"corrupt"}),", the ",(0,i.jsx)(n.code,{children:"correlation"})," is more complicated. For specific model description, refer to ",(0,i.jsx)(n.a,{href:"http://web.archive.org/web/20200120162102/http://netgroup.uniroma2.it/twiki/bin/view.cgi/Main/NetemCLG",children:"NetemCLG"}),"."]}),"\n",(0,i.jsx)(n.h3,{id:"bandwidth",children:"bandwidth"}),"\n",(0,i.jsxs)(n.p,{children:["Setting ",(0,i.jsx)(n.code,{children:"action"})," to ",(0,i.jsx)(n.code,{children:"bandwidth"})," means simulating bandwidth limit fault. You also need to configure the following parameters."]}),"\n",(0,i.jsxs)(n.table,{children:[(0,i.jsx)(n.thead,{children:(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.th,{children:"Parameter"}),(0,i.jsx)(n.th,{children:"Type"}),(0,i.jsx)(n.th,{children:"Description"}),(0,i.jsx)(n.th,{children:"Default value"}),(0,i.jsx)(n.th,{children:"Required"}),(0,i.jsx)(n.th,{children:"Example"})]})}),(0,i.jsxs)(n.tbody,{children:[(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"rate"}),(0,i.jsx)(n.td,{children:"string"}),(0,i.jsx)(n.td,{children:"Indicates the rate of bandwidth limit"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1mbps"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"limit"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the number of bytes waiting in queue"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"buffer"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsx)(n.td,{children:"Indicates the maximum number of bytes that can be sent instantaneously"}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"Yes"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"peakrate"}),(0,i.jsx)(n.td,{children:"uint64"}),(0,i.jsxs)(n.td,{children:["Indicates the maximum consumption of ",(0,i.jsx)(n.code,{children:"bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]}),(0,i.jsxs)(n.tr,{children:[(0,i.jsx)(n.td,{children:"minburst"}),(0,i.jsx)(n.td,{children:"uint32"}),(0,i.jsxs)(n.td,{children:["Indicates the size of ",(0,i.jsx)(n.code,{children:"peakrate bucket"})," (usually not set)"]}),(0,i.jsx)(n.td,{}),(0,i.jsx)(n.td,{children:"No"}),(0,i.jsx)(n.td,{children:"1"})]})]})]}),"\n",(0,i.jsxs)(n.p,{children:["For more details of these fields, you can refer to ",(0,i.jsx)(n.a,{href:"https://man7.org/linux/man-pages/man8/tc-tbf.8.html",children:"tc-tbf document"}),". The limit is suggested to set to at least ",(0,i.jsx)(n.code,{children:"2 * rate * latency"}),", where the ",(0,i.jsx)(n.code,{children:"latency"})," is the estimated latency between source and target, and it can be estimated through ",(0,i.jsx)(n.code,{children:"ping"})," command. Too small ",(0,i.jsx)(n.code,{children:"limit"})," can cause high loss rate and impact the throughput of the tcp connection."]})]})}function h(e={}){const{wrapper:n}={...(0,s.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(a,{...e})}):a(e)}},60503:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},34778:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"},83608:(e,n,t)=>{t.d(n,{A:()=>i});const i=t.p+"assets/images/networkchaos-exp-bdb9cf9dc1cb7bf48717ed428ed8d8a5.png"},6383:(e,n,t)=>{t.d(n,{R:()=>d,x:()=>l});var i=t(30758);const s={},r=i.createContext(s);function d(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/e86885f1.dd8fb11a.js b/assets/js/e86885f1.7339d991.js similarity index 99% rename from assets/js/e86885f1.dd8fb11a.js rename to assets/js/e86885f1.7339d991.js index a5a413ffb3..202ea1cf8d 100644 --- a/assets/js/e86885f1.dd8fb11a.js +++ b/assets/js/e86885f1.7339d991.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7955],{56841:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>c,default:()=>x,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var t=n(86070),i=n(6383),r=n(70597);const l={title:"Simulate DNS Faults"},c=void 0,o={id:"simulate-dns-chaos-on-kubernetes",title:"Simulate DNS Faults",description:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.",source:"@site/docs/simulate-dns-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-dns-chaos-on-kubernetes",permalink:"/docs/next/simulate-dns-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-dns-chaos-on-kubernetes.md",tags:[],version:"current",frontMatter:{title:"Simulate DNS Faults"},sidebar:"docs",previous:{title:"Simulate File I/O Faults",permalink:"/docs/next/simulate-io-chaos-on-kubernetes"},next:{title:"Simulate Time Faults",permalink:"/docs/next/simulate-time-chaos-on-kubernetes"}},d={},a=[{value:"DNSChaos Introduction",id:"dnschaos-introduction",level:2},{value:"Check if Chaos DNS Server is deployed",id:"check-if-chaos-dns-server-is-deployed",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML file",id:"create-experiments-using-the-yaml-file",level:2},{value:"Configuration Description",id:"configuration-description",level:3}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults."}),"\n",(0,t.jsxs)(s.admonition,{type:"info",children:[(0,t.jsx)(s.p,{children:"To simluate DNS faults, you need to deploy a special DNS service called Chaos DNS Server."}),(0,t.jsxs)(s.p,{children:["In the latest version, Chaos Mesh will deploy Chaos DNS Server by default. If you don't need to simulate DNS faults, you can set ",(0,t.jsx)(s.code,{children:"dnsServer.create"})," to ",(0,t.jsx)(s.code,{children:"false"})," when installing Chaos Mesh:"]}),(0,t.jsx)(r.A,{children:"helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-mesh --version latest --set dnsServer.create=false"})]}),"\n",(0,t.jsx)(s.h2,{id:"dnschaos-introduction",children:"DNSChaos Introduction"}),"\n",(0,t.jsx)(s.p,{children:"DNSChaos is used to simulate wrong DNS responses. For example, DNSChaos can return an error or return a random IP address when receiving a DNS request."}),"\n",(0,t.jsx)(s.h2,{id:"check-if-chaos-dns-server-is-deployed",children:"Check if Chaos DNS Server is deployed"}),"\n",(0,t.jsx)(s.p,{children:"Check if Chaos DNS Server is deployed by running the following command:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl get pods -n chaos-mesh -l app.kubernetes.io/component=chaos-dns-server\n"})}),"\n",(0,t.jsxs)(s.p,{children:["Make sure that the Pod status is ",(0,t.jsx)(s.code,{children:"Running"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"notes",children:"Notes"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Currently, DNSChaos only supports record types ",(0,t.jsx)(s.code,{children:"A"})," and ",(0,t.jsx)(s.code,{children:"AAAA"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The chaos DNS service runs CoreDNS with the ",(0,t.jsx)(s.a,{href:"https://github.com/chaos-mesh/k8s_dns_chaos",children:"k8s_dns_chaos"})," plugin. If the CoreDNS service in your Kubernetes cluster contains some special configurations, you can edit configMap ",(0,t.jsx)(s.code,{children:"dns-server-config"})," to make the configuration of the chaos DNS service consistent with that of the K8s CoreDNS service using the following command:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl edit configmap dns-server-config -n chaos-mesh\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(s.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Create Experiment",src:n(43088).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["In the ",(0,t.jsx)(s.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(s.strong,{children:"DNS FAULT"})," and select a specific behavior, such as ",(0,t.jsx)(s.strong,{children:"ERROR"}),". Then fill out the matching rules."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"DNSChaos Experiment",src:n(85150).A+"",width:"1718",height:"1436"})}),"\n",(0,t.jsxs)(s.p,{children:["According to the matching rules configured in the screenshot, the DNS FAULT takes effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an error will be returned when a DNS request is sent to these three domains. For details of specific matching rules, refer to the description of the ",(0,t.jsx)(s.code,{children:"patterns"})," field in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experiment Information",src:n(733).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-the-yaml-file",children:"Create experiments using the YAML file"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Write the experiment configuration to the ",(0,t.jsx)(s.code,{children:"dnschaos.yaml"})," file:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: DNSChaos\nmetadata:\n name: dns-chaos-example\n namespace: chaos-mesh\nspec:\n action: random\n mode: all\n patterns:\n - google.com\n - chaos-mesh.*\n - github.?om\n selector:\n namespaces:\n - busybox\n"})}),"\n",(0,t.jsxs)(s.p,{children:["This configuration can take effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an IP address will be returned when a DNS request is sent to these three domains. For specific matching rules, refer to the ",(0,t.jsx)(s.code,{children:"patterns"})," description in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["After the configuration file is prepared, use ",(0,t.jsx)(s.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl apply -f dnschaos.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"configuration-description",children:"Configuration Description"}),"\n",(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Parameter"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Default value"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Required"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Example"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"action"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Defines the behavior of DNS fault. Optional values: ",(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"}),". When the value is ",(0,t.jsx)(s.code,{children:"random"}),", DNS service returns a random IP address; when the value is ",(0,t.jsx)(s.code,{children:"error"}),", DNS service returns an error."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"patterns"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"String array"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Selects a domain template that matches faults. Placeholder ",(0,t.jsx)(s.code,{children:"?"})," and wildcard are supported. ",(0,t.jsx)(s.code,{children:"*"})]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"[]"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", ",(0,t.jsx)(s.code,{children:"github.com"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"mode"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the mode of the experiment. The mode options include ",(0,t.jsx)(s.code,{children:"one"})," (selecting a random Pod), ",(0,t.jsx)(s.code,{children:"all"})," (selecting all eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,t.jsx)(s.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"one"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"value"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Provides parameters for the ",(0,t.jsx)(s.code,{children:"mode"})," configuration, depending on ",(0,t.jsx)(s.code,{children:"mode"}),". For example, when ",(0,t.jsx)(s.code,{children:"mode"})," is set to ",(0,t.jsx)(s.code,{children:"fixed-percent"}),", ",(0,t.jsx)(s.code,{children:"value"})," specifies the percentage of Pods."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"1"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"selector"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"struct"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the target Pod. For details, refer to ",(0,t.jsx)(s.a,{href:"/docs/next/define-chaos-experiment-scope",children:"Define the Scope of Chaos Experiments"}),"."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"}})]})]})]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The wildcard in ",(0,t.jsx)(s.code,{children:"patterns"})," configuration must be at the end of string. For example, ",(0,t.jsx)(s.code,{children:"chaos-mes*.org."})," is an invalid configuration."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["When ",(0,t.jsx)(s.code,{children:"patterns"})," is not configured, faults are injected for all domains."]}),"\n"]}),"\n"]})})]})}function x(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},70597:(e,s,n)=>{n.d(s,{A:()=>h});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(29582),o=n.n(c),d=n(7073),a=n(86070);const h=e=>{let{children:s,className:n="language-bash"}=e;const{siteConfig:c}=(0,i.A)(),{versions:h}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,a.jsx)(t.A,{children:()=>{const e=(0,d.t)(c,h),t="latest"===e?"":`--version ${(e=>{if(o().satisfies(e,">=2.0.3"))return e;const s=e.slice(0,3);return"v"+(parseFloat(s)-.7).toFixed(1)+e.slice(3)})(e)}`;return(0,a.jsx)(l.A,{className:n,children:s.replace("--version latest",t).trim()})}})}},7073:(e,s,n)=>{n.d(s,{A:()=>d,t:()=>o});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(86070);const o=(e,s)=>{const n=window.location.pathname;let t=window.localStorage.getItem("docs-preferred-version-default");if(n===e.baseUrl&&t)return"current"===t?"latest":t;if(n.includes("/docs/next"))return"latest";const i=s.find((e=>e.isLast)),r=s.find((e=>n.includes(e.name)));return r?r.name:i.name};const d=e=>{let{children:s,replaced:n="latest",isArchive:d=!1,className:a="language-bash"}=e;const{siteConfig:h}=(0,i.A)(),{versions:x}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,c.jsx)(t.A,{children:()=>{const e=o(h,x),t=d?s.replace(n,function(e){return"latest"===e?"refs/heads/master":`refs/tags/v${e}`}(e)):"latest"===e?s:s.replace(n,"v"+e);return(0,c.jsx)(l.A,{className:a,children:t})}})}},43088:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},85150:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/dnschaos-exp-1b652bbb9c9b57d42d5a5496789886bf.png"},733:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7955],{56841:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>c,default:()=>x,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var t=n(86070),i=n(6383),r=n(70597);const l={title:"Simulate DNS Faults"},c=void 0,o={id:"simulate-dns-chaos-on-kubernetes",title:"Simulate DNS Faults",description:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.",source:"@site/docs/simulate-dns-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-dns-chaos-on-kubernetes",permalink:"/docs/next/simulate-dns-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/docs/simulate-dns-chaos-on-kubernetes.md",tags:[],version:"current",frontMatter:{title:"Simulate DNS Faults"},sidebar:"docs",previous:{title:"Simulate File I/O Faults",permalink:"/docs/next/simulate-io-chaos-on-kubernetes"},next:{title:"Simulate Time Faults",permalink:"/docs/next/simulate-time-chaos-on-kubernetes"}},d={},a=[{value:"DNSChaos Introduction",id:"dnschaos-introduction",level:2},{value:"Check if Chaos DNS Server is deployed",id:"check-if-chaos-dns-server-is-deployed",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML file",id:"create-experiments-using-the-yaml-file",level:2},{value:"Configuration Description",id:"configuration-description",level:3}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults."}),"\n",(0,t.jsxs)(s.admonition,{type:"info",children:[(0,t.jsx)(s.p,{children:"To simulate DNS faults, you need to deploy a special DNS service called Chaos DNS Server."}),(0,t.jsxs)(s.p,{children:["In the latest version, Chaos Mesh will deploy Chaos DNS Server by default. If you don't need to simulate DNS faults, you can set ",(0,t.jsx)(s.code,{children:"dnsServer.create"})," to ",(0,t.jsx)(s.code,{children:"false"})," when installing Chaos Mesh:"]}),(0,t.jsx)(r.A,{children:"helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-mesh --version latest --set dnsServer.create=false"})]}),"\n",(0,t.jsx)(s.h2,{id:"dnschaos-introduction",children:"DNSChaos Introduction"}),"\n",(0,t.jsx)(s.p,{children:"DNSChaos is used to simulate wrong DNS responses. For example, DNSChaos can return an error or return a random IP address when receiving a DNS request."}),"\n",(0,t.jsx)(s.h2,{id:"check-if-chaos-dns-server-is-deployed",children:"Check if Chaos DNS Server is deployed"}),"\n",(0,t.jsx)(s.p,{children:"Check if Chaos DNS Server is deployed by running the following command:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl get pods -n chaos-mesh -l app.kubernetes.io/component=chaos-dns-server\n"})}),"\n",(0,t.jsxs)(s.p,{children:["Make sure that the Pod status is ",(0,t.jsx)(s.code,{children:"Running"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"notes",children:"Notes"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Currently, DNSChaos only supports record types ",(0,t.jsx)(s.code,{children:"A"})," and ",(0,t.jsx)(s.code,{children:"AAAA"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The chaos DNS service runs CoreDNS with the ",(0,t.jsx)(s.a,{href:"https://github.com/chaos-mesh/k8s_dns_chaos",children:"k8s_dns_chaos"})," plugin. If the CoreDNS service in your Kubernetes cluster contains some special configurations, you can edit configMap ",(0,t.jsx)(s.code,{children:"dns-server-config"})," to make the configuration of the chaos DNS service consistent with that of the K8s CoreDNS service using the following command:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl edit configmap dns-server-config -n chaos-mesh\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(s.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Create Experiment",src:n(43088).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["In the ",(0,t.jsx)(s.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(s.strong,{children:"DNS FAULT"})," and select a specific behavior, such as ",(0,t.jsx)(s.strong,{children:"ERROR"}),". Then fill out the matching rules."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"DNSChaos Experiment",src:n(85150).A+"",width:"1718",height:"1436"})}),"\n",(0,t.jsxs)(s.p,{children:["According to the matching rules configured in the screenshot, the DNS FAULT takes effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an error will be returned when a DNS request is sent to these three domains. For details of specific matching rules, refer to the description of the ",(0,t.jsx)(s.code,{children:"patterns"})," field in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experiment Information",src:n(733).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-the-yaml-file",children:"Create experiments using the YAML file"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Write the experiment configuration to the ",(0,t.jsx)(s.code,{children:"dnschaos.yaml"})," file:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: DNSChaos\nmetadata:\n name: dns-chaos-example\n namespace: chaos-mesh\nspec:\n action: random\n mode: all\n patterns:\n - google.com\n - chaos-mesh.*\n - github.?om\n selector:\n namespaces:\n - busybox\n"})}),"\n",(0,t.jsxs)(s.p,{children:["This configuration can take effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an IP address will be returned when a DNS request is sent to these three domains. For specific matching rules, refer to the ",(0,t.jsx)(s.code,{children:"patterns"})," description in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["After the configuration file is prepared, use ",(0,t.jsx)(s.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl apply -f dnschaos.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"configuration-description",children:"Configuration Description"}),"\n",(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Parameter"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Default value"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Required"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Example"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"action"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Defines the behavior of DNS fault. Optional values: ",(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"}),". When the value is ",(0,t.jsx)(s.code,{children:"random"}),", DNS service returns a random IP address; when the value is ",(0,t.jsx)(s.code,{children:"error"}),", DNS service returns an error."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"patterns"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"String array"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Selects a domain template that matches faults. Placeholder ",(0,t.jsx)(s.code,{children:"?"})," and wildcard are supported. ",(0,t.jsx)(s.code,{children:"*"})]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"[]"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", ",(0,t.jsx)(s.code,{children:"github.com"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"mode"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the mode of the experiment. The mode options include ",(0,t.jsx)(s.code,{children:"one"})," (selecting a random Pod), ",(0,t.jsx)(s.code,{children:"all"})," (selecting all eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,t.jsx)(s.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"one"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"value"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Provides parameters for the ",(0,t.jsx)(s.code,{children:"mode"})," configuration, depending on ",(0,t.jsx)(s.code,{children:"mode"}),". For example, when ",(0,t.jsx)(s.code,{children:"mode"})," is set to ",(0,t.jsx)(s.code,{children:"fixed-percent"}),", ",(0,t.jsx)(s.code,{children:"value"})," specifies the percentage of Pods."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"1"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"selector"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"struct"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the target Pod. For details, refer to ",(0,t.jsx)(s.a,{href:"/docs/next/define-chaos-experiment-scope",children:"Define the Scope of Chaos Experiments"}),"."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"}})]})]})]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The wildcard in ",(0,t.jsx)(s.code,{children:"patterns"})," configuration must be at the end of string. For example, ",(0,t.jsx)(s.code,{children:"chaos-mes*.org."})," is an invalid configuration."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["When ",(0,t.jsx)(s.code,{children:"patterns"})," is not configured, faults are injected for all domains."]}),"\n"]}),"\n"]})})]})}function x(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},70597:(e,s,n)=>{n.d(s,{A:()=>h});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(29582),o=n.n(c),d=n(7073),a=n(86070);const h=e=>{let{children:s,className:n="language-bash"}=e;const{siteConfig:c}=(0,i.A)(),{versions:h}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,a.jsx)(t.A,{children:()=>{const e=(0,d.t)(c,h),t="latest"===e?"":`--version ${(e=>{if(o().satisfies(e,">=2.0.3"))return e;const s=e.slice(0,3);return"v"+(parseFloat(s)-.7).toFixed(1)+e.slice(3)})(e)}`;return(0,a.jsx)(l.A,{className:n,children:s.replace("--version latest",t).trim()})}})}},7073:(e,s,n)=>{n.d(s,{A:()=>d,t:()=>o});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(86070);const o=(e,s)=>{const n=window.location.pathname;let t=window.localStorage.getItem("docs-preferred-version-default");if(n===e.baseUrl&&t)return"current"===t?"latest":t;if(n.includes("/docs/next"))return"latest";const i=s.find((e=>e.isLast)),r=s.find((e=>n.includes(e.name)));return r?r.name:i.name};const d=e=>{let{children:s,replaced:n="latest",isArchive:d=!1,className:a="language-bash"}=e;const{siteConfig:h}=(0,i.A)(),{versions:x}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,c.jsx)(t.A,{children:()=>{const e=o(h,x),t=d?s.replace(n,function(e){return"latest"===e?"refs/heads/master":`refs/tags/v${e}`}(e)):"latest"===e?s:s.replace(n,"v"+e);return(0,c.jsx)(l.A,{className:a,children:t})}})}},43088:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},85150:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/dnschaos-exp-1b652bbb9c9b57d42d5a5496789886bf.png"},733:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"}}]); \ No newline at end of file diff --git a/assets/js/ea4c8659.9d441468.js b/assets/js/ea4c8659.c0415969.js similarity index 99% rename from assets/js/ea4c8659.9d441468.js rename to assets/js/ea4c8659.c0415969.js index 84c360d4cc..15a7548cff 100644 --- a/assets/js/ea4c8659.9d441468.js +++ b/assets/js/ea4c8659.c0415969.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[897],{75341:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>c,default:()=>x,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var t=n(86070),i=n(6383),r=n(70597);const l={title:"Simulate DNS Faults"},c=void 0,o={id:"simulate-dns-chaos-on-kubernetes",title:"Simulate DNS Faults",description:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.",source:"@site/versioned_docs/version-2.6.4/simulate-dns-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-dns-chaos-on-kubernetes",permalink:"/docs/simulate-dns-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-dns-chaos-on-kubernetes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate DNS Faults"},sidebar:"docs",previous:{title:"Simulate File I/O Faults",permalink:"/docs/simulate-io-chaos-on-kubernetes"},next:{title:"Simulate Time Faults",permalink:"/docs/simulate-time-chaos-on-kubernetes"}},d={},a=[{value:"DNSChaos Introduction",id:"dnschaos-introduction",level:2},{value:"Check if Chaos DNS Server is deployed",id:"check-if-chaos-dns-server-is-deployed",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML file",id:"create-experiments-using-the-yaml-file",level:2},{value:"Configuration Description",id:"configuration-description",level:3}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults."}),"\n",(0,t.jsxs)(s.admonition,{type:"info",children:[(0,t.jsx)(s.p,{children:"To simluate DNS faults, you need to deploy a special DNS service called Chaos DNS Server."}),(0,t.jsxs)(s.p,{children:["In the latest version, Chaos Mesh will deploy Chaos DNS Server by default. If you don't need to simulate DNS faults, you can set ",(0,t.jsx)(s.code,{children:"dnsServer.create"})," to ",(0,t.jsx)(s.code,{children:"false"})," when installing Chaos Mesh:"]}),(0,t.jsx)(r.A,{children:"helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-mesh --version latest --set dnsServer.create=false"})]}),"\n",(0,t.jsx)(s.h2,{id:"dnschaos-introduction",children:"DNSChaos Introduction"}),"\n",(0,t.jsx)(s.p,{children:"DNSChaos is used to simulate wrong DNS responses. For example, DNSChaos can return an error or return a random IP address when receiving a DNS request."}),"\n",(0,t.jsx)(s.h2,{id:"check-if-chaos-dns-server-is-deployed",children:"Check if Chaos DNS Server is deployed"}),"\n",(0,t.jsx)(s.p,{children:"Check if Chaos DNS Server is deployed by running the following command:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl get pods -n chaos-mesh -l app.kubernetes.io/component=chaos-dns-server\n"})}),"\n",(0,t.jsxs)(s.p,{children:["Make sure that the Pod status is ",(0,t.jsx)(s.code,{children:"Running"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"notes",children:"Notes"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Currently, DNSChaos only supports record types ",(0,t.jsx)(s.code,{children:"A"})," and ",(0,t.jsx)(s.code,{children:"AAAA"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The chaos DNS service runs CoreDNS with the ",(0,t.jsx)(s.a,{href:"https://github.com/chaos-mesh/k8s_dns_chaos",children:"k8s_dns_chaos"})," plugin. If the CoreDNS service in your Kubernetes cluster contains some special configurations, you can edit configMap ",(0,t.jsx)(s.code,{children:"dns-server-config"})," to make the configuration of the chaos DNS service consistent with that of the K8s CoreDNS service using the following command:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl edit configmap dns-server-config -n chaos-mesh\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(s.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Create Experiment",src:n(10476).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["In the ",(0,t.jsx)(s.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(s.strong,{children:"DNS FAULT"})," and select a specific behavior, such as ",(0,t.jsx)(s.strong,{children:"ERROR"}),". Then fill out the matching rules."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"DNSChaos Experiment",src:n(68522).A+"",width:"1718",height:"1436"})}),"\n",(0,t.jsxs)(s.p,{children:["According to the matching rules configured in the screenshot, the DNS FAULT takes effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an error will be returned when a DNS request is sent to these three domains. For details of specific matching rules, refer to the description of the ",(0,t.jsx)(s.code,{children:"patterns"})," field in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experiment Information",src:n(21785).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-the-yaml-file",children:"Create experiments using the YAML file"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Write the experiment configuration to the ",(0,t.jsx)(s.code,{children:"dnschaos.yaml"})," file:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: DNSChaos\nmetadata:\n name: dns-chaos-example\n namespace: chaos-mesh\nspec:\n action: random\n mode: all\n patterns:\n - google.com\n - chaos-mesh.*\n - github.?om\n selector:\n namespaces:\n - busybox\n"})}),"\n",(0,t.jsxs)(s.p,{children:["This configuration can take effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an IP address will be returned when a DNS request is sent to these three domains. For specific matching rules, refer to the ",(0,t.jsx)(s.code,{children:"patterns"})," description in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["After the configuration file is prepared, use ",(0,t.jsx)(s.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl apply -f dnschaos.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"configuration-description",children:"Configuration Description"}),"\n",(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Parameter"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Default value"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Required"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Example"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"action"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Defines the behavior of DNS fault. Optional values: ",(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"}),". When the value is ",(0,t.jsx)(s.code,{children:"random"}),", DNS service returns a random IP address; when the value is ",(0,t.jsx)(s.code,{children:"error"}),", DNS service returns an error."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"patterns"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"String array"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Selects a domain template that matches faults. Placeholder ",(0,t.jsx)(s.code,{children:"?"})," and wildcard are supported. ",(0,t.jsx)(s.code,{children:"*"})]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"[]"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", ",(0,t.jsx)(s.code,{children:"github.com"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"mode"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the mode of the experiment. The mode options include ",(0,t.jsx)(s.code,{children:"one"})," (selecting a random Pod), ",(0,t.jsx)(s.code,{children:"all"})," (selecting all eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,t.jsx)(s.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"one"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"value"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Provides parameters for the ",(0,t.jsx)(s.code,{children:"mode"})," configuration, depending on ",(0,t.jsx)(s.code,{children:"mode"}),". For example, when ",(0,t.jsx)(s.code,{children:"mode"})," is set to ",(0,t.jsx)(s.code,{children:"fixed-percent"}),", ",(0,t.jsx)(s.code,{children:"value"})," specifies the percentage of Pods."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"1"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"selector"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"struct"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the target Pod. For details, refer to ",(0,t.jsx)(s.a,{href:"/docs/define-chaos-experiment-scope",children:"Define the Scope of Chaos Experiments"}),"."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"}})]})]})]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The wildcard in ",(0,t.jsx)(s.code,{children:"patterns"})," configuration must be at the end of string. For example, ",(0,t.jsx)(s.code,{children:"chaos-mes*.org."})," is an invalid configuration."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["When ",(0,t.jsx)(s.code,{children:"patterns"})," is not configured, faults are injected for all domains."]}),"\n"]}),"\n"]})})]})}function x(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},70597:(e,s,n)=>{n.d(s,{A:()=>h});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(29582),o=n.n(c),d=n(7073),a=n(86070);const h=e=>{let{children:s,className:n="language-bash"}=e;const{siteConfig:c}=(0,i.A)(),{versions:h}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,a.jsx)(t.A,{children:()=>{const e=(0,d.t)(c,h),t="latest"===e?"":`--version ${(e=>{if(o().satisfies(e,">=2.0.3"))return e;const s=e.slice(0,3);return"v"+(parseFloat(s)-.7).toFixed(1)+e.slice(3)})(e)}`;return(0,a.jsx)(l.A,{className:n,children:s.replace("--version latest",t).trim()})}})}},7073:(e,s,n)=>{n.d(s,{A:()=>d,t:()=>o});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(86070);const o=(e,s)=>{const n=window.location.pathname;let t=window.localStorage.getItem("docs-preferred-version-default");if(n===e.baseUrl&&t)return"current"===t?"latest":t;if(n.includes("/docs/next"))return"latest";const i=s.find((e=>e.isLast)),r=s.find((e=>n.includes(e.name)));return r?r.name:i.name};const d=e=>{let{children:s,replaced:n="latest",isArchive:d=!1,className:a="language-bash"}=e;const{siteConfig:h}=(0,i.A)(),{versions:x}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,c.jsx)(t.A,{children:()=>{const e=o(h,x),t=d?s.replace(n,function(e){return"latest"===e?"refs/heads/master":`refs/tags/v${e}`}(e)):"latest"===e?s:s.replace(n,"v"+e);return(0,c.jsx)(l.A,{className:a,children:t})}})}},10476:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},68522:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/dnschaos-exp-1b652bbb9c9b57d42d5a5496789886bf.png"},21785:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[897],{75341:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>d,contentTitle:()=>c,default:()=>x,frontMatter:()=>l,metadata:()=>o,toc:()=>a});var t=n(86070),i=n(6383),r=n(70597);const l={title:"Simulate DNS Faults"},c=void 0,o={id:"simulate-dns-chaos-on-kubernetes",title:"Simulate DNS Faults",description:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.",source:"@site/versioned_docs/version-2.6.4/simulate-dns-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-dns-chaos-on-kubernetes",permalink:"/docs/simulate-dns-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-dns-chaos-on-kubernetes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate DNS Faults"},sidebar:"docs",previous:{title:"Simulate File I/O Faults",permalink:"/docs/simulate-io-chaos-on-kubernetes"},next:{title:"Simulate Time Faults",permalink:"/docs/simulate-time-chaos-on-kubernetes"}},d={},a=[{value:"DNSChaos Introduction",id:"dnschaos-introduction",level:2},{value:"Check if Chaos DNS Server is deployed",id:"check-if-chaos-dns-server-is-deployed",level:2},{value:"Notes",id:"notes",level:2},{value:"Create experiments using Chaos Dashboard",id:"create-experiments-using-chaos-dashboard",level:2},{value:"Create experiments using the YAML file",id:"create-experiments-using-the-yaml-file",level:2},{value:"Configuration Description",id:"configuration-description",level:3}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults."}),"\n",(0,t.jsxs)(s.admonition,{type:"info",children:[(0,t.jsx)(s.p,{children:"To simulate DNS faults, you need to deploy a special DNS service called Chaos DNS Server."}),(0,t.jsxs)(s.p,{children:["In the latest version, Chaos Mesh will deploy Chaos DNS Server by default. If you don't need to simulate DNS faults, you can set ",(0,t.jsx)(s.code,{children:"dnsServer.create"})," to ",(0,t.jsx)(s.code,{children:"false"})," when installing Chaos Mesh:"]}),(0,t.jsx)(r.A,{children:"helm install chaos-mesh chaos-mesh/chaos-mesh --namespace=chaos-mesh --version latest --set dnsServer.create=false"})]}),"\n",(0,t.jsx)(s.h2,{id:"dnschaos-introduction",children:"DNSChaos Introduction"}),"\n",(0,t.jsx)(s.p,{children:"DNSChaos is used to simulate wrong DNS responses. For example, DNSChaos can return an error or return a random IP address when receiving a DNS request."}),"\n",(0,t.jsx)(s.h2,{id:"check-if-chaos-dns-server-is-deployed",children:"Check if Chaos DNS Server is deployed"}),"\n",(0,t.jsx)(s.p,{children:"Check if Chaos DNS Server is deployed by running the following command:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl get pods -n chaos-mesh -l app.kubernetes.io/component=chaos-dns-server\n"})}),"\n",(0,t.jsxs)(s.p,{children:["Make sure that the Pod status is ",(0,t.jsx)(s.code,{children:"Running"}),"."]}),"\n",(0,t.jsx)(s.h2,{id:"notes",children:"Notes"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Currently, DNSChaos only supports record types ",(0,t.jsx)(s.code,{children:"A"})," and ",(0,t.jsx)(s.code,{children:"AAAA"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The chaos DNS service runs CoreDNS with the ",(0,t.jsx)(s.a,{href:"https://github.com/chaos-mesh/k8s_dns_chaos",children:"k8s_dns_chaos"})," plugin. If the CoreDNS service in your Kubernetes cluster contains some special configurations, you can edit configMap ",(0,t.jsx)(s.code,{children:"dns-server-config"})," to make the configuration of the chaos DNS service consistent with that of the K8s CoreDNS service using the following command:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl edit configmap dns-server-config -n chaos-mesh\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-chaos-dashboard",children:"Create experiments using Chaos Dashboard"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Open Chaos Dashboard, and click ",(0,t.jsx)(s.strong,{children:"NEW EXPERIMENT"})," on the page to create a new experiment:"]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Create Experiment",src:n(10476).A+"",width:"959",height:"519"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["In the ",(0,t.jsx)(s.strong,{children:"Choose a Target"})," area, choose ",(0,t.jsx)(s.strong,{children:"DNS FAULT"})," and select a specific behavior, such as ",(0,t.jsx)(s.strong,{children:"ERROR"}),". Then fill out the matching rules."]}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"DNSChaos Experiment",src:n(68522).A+"",width:"1718",height:"1436"})}),"\n",(0,t.jsxs)(s.p,{children:["According to the matching rules configured in the screenshot, the DNS FAULT takes effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an error will be returned when a DNS request is sent to these three domains. For details of specific matching rules, refer to the description of the ",(0,t.jsx)(s.code,{children:"patterns"})," field in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Fill out the experiment information, and specify the experiment scope and the scheduled experiment duration:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experiment Information",src:n(21785).A+"",width:"973",height:"442"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Submit the experiment information."}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"create-experiments-using-the-yaml-file",children:"Create experiments using the YAML file"}),"\n",(0,t.jsxs)(s.ol,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["Write the experiment configuration to the ",(0,t.jsx)(s.code,{children:"dnschaos.yaml"})," file:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: DNSChaos\nmetadata:\n name: dns-chaos-example\n namespace: chaos-mesh\nspec:\n action: random\n mode: all\n patterns:\n - google.com\n - chaos-mesh.*\n - github.?om\n selector:\n namespaces:\n - busybox\n"})}),"\n",(0,t.jsxs)(s.p,{children:["This configuration can take effect for domains including ",(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", and ",(0,t.jsx)(s.code,{children:"github.com"}),", which means that an IP address will be returned when a DNS request is sent to these three domains. For specific matching rules, refer to the ",(0,t.jsx)(s.code,{children:"patterns"})," description in ",(0,t.jsx)(s.a,{href:"#configuration-description",children:"Configuration Description"}),"."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["After the configuration file is prepared, use ",(0,t.jsx)(s.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-bash",children:"kubectl apply -f dnschaos.yaml\n"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.h3,{id:"configuration-description",children:"Configuration Description"}),"\n",(0,t.jsxs)(s.table,{children:[(0,t.jsx)(s.thead,{children:(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Parameter"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Type"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Default value"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Required"}),(0,t.jsx)(s.th,{style:{textAlign:"left"},children:"Example"})]})}),(0,t.jsxs)(s.tbody,{children:[(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"action"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Defines the behavior of DNS fault. Optional values: ",(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"}),". When the value is ",(0,t.jsx)(s.code,{children:"random"}),", DNS service returns a random IP address; when the value is ",(0,t.jsx)(s.code,{children:"error"}),", DNS service returns an error."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"random"})," or ",(0,t.jsx)(s.code,{children:"error"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"patterns"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"String array"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Selects a domain template that matches faults. Placeholder ",(0,t.jsx)(s.code,{children:"?"})," and wildcard are supported. ",(0,t.jsx)(s.code,{children:"*"})]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"[]"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:[(0,t.jsx)(s.code,{children:"google.com"}),", ",(0,t.jsx)(s.code,{children:"chaos-mesh.org"}),", ",(0,t.jsx)(s.code,{children:"github.com"})]})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"mode"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the mode of the experiment. The mode options include ",(0,t.jsx)(s.code,{children:"one"})," (selecting a random Pod), ",(0,t.jsx)(s.code,{children:"all"})," (selecting all eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed"})," (selecting a specified number of eligible Pods), ",(0,t.jsx)(s.code,{children:"fixed-percent"})," (selecting a specified percentage of Pods from the eligible Pods), and ",(0,t.jsx)(s.code,{children:"random-max-percent"})," (selecting the maximum percentage of Pods from the eligible Pods)."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"one"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"value"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"string"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Provides parameters for the ",(0,t.jsx)(s.code,{children:"mode"})," configuration, depending on ",(0,t.jsx)(s.code,{children:"mode"}),". For example, when ",(0,t.jsx)(s.code,{children:"mode"})," is set to ",(0,t.jsx)(s.code,{children:"fixed-percent"}),", ",(0,t.jsx)(s.code,{children:"value"})," specifies the percentage of Pods."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"No"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"1"})})]}),(0,t.jsxs)(s.tr,{children:[(0,t.jsx)(s.td,{style:{textAlign:"left"},children:(0,t.jsx)(s.code,{children:"selector"})}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"struct"}),(0,t.jsxs)(s.td,{style:{textAlign:"left"},children:["Specifies the target Pod. For details, refer to ",(0,t.jsx)(s.a,{href:"/docs/define-chaos-experiment-scope",children:"Define the Scope of Chaos Experiments"}),"."]}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,t.jsx)(s.td,{style:{textAlign:"left"},children:"Yes"}),(0,t.jsx)(s.td,{style:{textAlign:"left"}})]})]})]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["The wildcard in ",(0,t.jsx)(s.code,{children:"patterns"})," configuration must be at the end of string. For example, ",(0,t.jsx)(s.code,{children:"chaos-mes*.org."})," is an invalid configuration."]}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsxs)(s.p,{children:["When ",(0,t.jsx)(s.code,{children:"patterns"})," is not configured, faults are injected for all domains."]}),"\n"]}),"\n"]})})]})}function x(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},70597:(e,s,n)=>{n.d(s,{A:()=>h});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(29582),o=n.n(c),d=n(7073),a=n(86070);const h=e=>{let{children:s,className:n="language-bash"}=e;const{siteConfig:c}=(0,i.A)(),{versions:h}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,a.jsx)(t.A,{children:()=>{const e=(0,d.t)(c,h),t="latest"===e?"":`--version ${(e=>{if(o().satisfies(e,">=2.0.3"))return e;const s=e.slice(0,3);return"v"+(parseFloat(s)-.7).toFixed(1)+e.slice(3)})(e)}`;return(0,a.jsx)(l.A,{className:n,children:s.replace("--version latest",t).trim()})}})}},7073:(e,s,n)=>{n.d(s,{A:()=>d,t:()=>o});var t=n(33453),i=n(85599),r=n(46687),l=n(99630),c=n(86070);const o=(e,s)=>{const n=window.location.pathname;let t=window.localStorage.getItem("docs-preferred-version-default");if(n===e.baseUrl&&t)return"current"===t?"latest":t;if(n.includes("/docs/next"))return"latest";const i=s.find((e=>e.isLast)),r=s.find((e=>n.includes(e.name)));return r?r.name:i.name};const d=e=>{let{children:s,replaced:n="latest",isArchive:d=!1,className:a="language-bash"}=e;const{siteConfig:h}=(0,i.A)(),{versions:x}=(0,r.P_)("docusaurus-plugin-content-docs");return(0,c.jsx)(t.A,{children:()=>{const e=o(h,x),t=d?s.replace(n,function(e){return"latest"===e?"refs/heads/master":`refs/tags/v${e}`}(e)):"latest"===e?s:s.replace(n,"v"+e);return(0,c.jsx)(l.A,{className:a,children:t})}})}},10476:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/create-new-exp-1c53e87b7cbd0e5935aec8529fbbaea4.png"},68522:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/dnschaos-exp-1b652bbb9c9b57d42d5a5496789886bf.png"},21785:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/exp-info-8b402b174aa7d3cd9f8cfde8b492e876.png"}}]); \ No newline at end of file diff --git a/assets/js/ef21a7a0.520bc558.js b/assets/js/ef21a7a0.520bc558.js deleted file mode 100644 index e1ce8b003f..0000000000 --- a/assets/js/ef21a7a0.520bc558.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4198],{74591:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.",source:"@site/versioned_docs/version-2.6.4/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/chaosd-search-recover.md",tags:[],version:"2.6.4",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/ef21a7a0.b88f7ae6.js b/assets/js/ef21a7a0.b88f7ae6.js new file mode 100644 index 0000000000..e3e3525a7b --- /dev/null +++ b/assets/js/ef21a7a0.b88f7ae6.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[4198],{74591:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>o,contentTitle:()=>c,default:()=>h,frontMatter:()=>i,metadata:()=>d,toc:()=>l});var n=t(86070),r=t(6383);const i={title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},c=void 0,d={id:"chaosd-search-recover",title:"Search and Recover Experiments of Chaosd",description:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.",source:"@site/versioned_docs/version-2.6.4/chaosd-search-recover.md",sourceDirName:".",slug:"/chaosd-search-recover",permalink:"/docs/chaosd-search-recover",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/chaosd-search-recover.md",tags:[],version:"2.6.4",frontMatter:{title:"Search and Recover Experiments of Chaosd",summary:"Describes how to search and recover the experiments of Chaosd, and provide related examples."},sidebar:"docs",previous:{title:"Simulate Redis Faults",permalink:"/docs/simulate-redis-chaos-on-physical-nodes"},next:{title:"GCP OAuth Authentication",permalink:"/docs/gcp-authentication"}},o={},l=[{value:"Search experiments of Chaosd",id:"search-experiments-of-chaosd",level:2},{value:"Search experiments using the command-line mode",id:"search-experiments-using-the-command-line-mode",level:3},{value:"Configuration description",id:"configuration-description",level:4},{value:"Example",id:"example",level:4},{value:"Search experiments using the service mode",id:"search-experiments-using-the-service-mode",level:3},{value:"Example",id:"example-1",level:4},{value:"Recover experiments of Chaosd",id:"recover-experiments-of-chaosd",level:2},{value:"Recover experiments using the command-line mode",id:"recover-experiments-using-the-command-line-mode",level:3},{value:"Recover experiments using the service mode",id:"recover-experiments-using-the-service-mode",level:3}];function a(e){const s={code:"code",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.p,{children:"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples."}),"\n",(0,n.jsx)(s.h2,{id:"search-experiments-of-chaosd",children:"Search experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"This section introduces how to use command-line mode and service mode to find experiments of Chaosd."}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-command-line-mode",children:"Search experiments using the command-line mode"}),"\n",(0,n.jsxs)(s.p,{children:["By running the following command, you can view the configurations supported by the ",(0,n.jsx)(s.code,{children:"search"})," command:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"$ chaosd search --help\nSearch chaos attack, you can search attacks through the uid or the state of the attack\n\nUsage:\n chaosd search UID [flags]\n\nFlags:\n -A, --all list all chaos attacks\n --asc order by CreateTime, default value is false that means order by CreateTime desc\n -h, --help help for search\n -k, --kind string attack kind, supported value: network, process, stress, disk, host, jvm\n -l, --limit uint32 limit the count of attacks\n -o, --offset uint32 starting to search attacks from offset\n -s, --status string attack status, supported value: created, success, error, destroyed, revoked\n\nGlobal Flags:\n --log-level string the log level of chaosd, the value can be 'debug', 'info', 'warn' and 'error'\n"})}),"\n",(0,n.jsx)(s.h4,{id:"configuration-description",children:"Configuration description"}),"\n",(0,n.jsxs)(s.table,{children:[(0,n.jsx)(s.thead,{children:(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Configuration item"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Abbreviation"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Description"}),(0,n.jsx)(s.th,{style:{textAlign:"left"},children:"Type"})]})}),(0,n.jsxs)(s.tbody,{children:[(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"all"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"A"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists all experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"asc"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"None"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["Sorts the experiments in ascending order of the creation time. The default value is ",(0,n.jsx)(s.code,{children:"false"}),"."]}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"bool"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"kind"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"k"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments of the specified kind"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported kinds are as follows: ",(0,n.jsx)(s.code,{children:"network"}),", ",(0,n.jsx)(s.code,{children:"process"}),", ",(0,n.jsx)(s.code,{children:"stress"}),", ",(0,n.jsx)(s.code,{children:"disk"}),", ",(0,n.jsx)(s.code,{children:"host"}),", ",(0,n.jsx)(s.code,{children:"jvm"})]})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"limit"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"l"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"The number of listed experiments"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"offset"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"o"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Searches from the specified offset"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"int"})]}),(0,n.jsxs)(s.tr,{children:[(0,n.jsx)(s.td,{style:{textAlign:"left"},children:(0,n.jsx)(s.code,{children:"status"})}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"s"}),(0,n.jsx)(s.td,{style:{textAlign:"left"},children:"Lists experiments with the specified status"}),(0,n.jsxs)(s.td,{style:{textAlign:"left"},children:["string. The supported types are as follows: ",(0,n.jsx)(s.code,{children:"created"}),", ",(0,n.jsx)(s.code,{children:"success"}),", ",(0,n.jsx)(s.code,{children:"error"}),", ",(0,n.jsx)(s.code,{children:"destroyed"}),", ",(0,n.jsx)(s.code,{children:"revoked"})]})]})]})]}),"\n",(0,n.jsx)(s.h4,{id:"example",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"./chaosd search --kind network --status destroyed --limit 1\n"})}),"\n",(0,n.jsxs)(s.p,{children:["By running this command, you can search the experiments of the kind of ",(0,n.jsx)(s.code,{children:"network"})," in the status of ",(0,n.jsx)(s.code,{children:"destroyed"})," (indicating that the experiment has been recovered)."]}),"\n",(0,n.jsx)(s.p,{children:"After running the command, only one row of data is output in the result:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:' UID KIND ACTION STATUS CREATE TIME CONFIGURATION\n--------------------------------------- --------- -------- ----------- --------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n 1f6c1253-522a-43d9-83f8-42607102b3b9 network delay destroyed 2021-11-02T15:14:07+08:00 {"schedule":"","duration":"","action":"delay","kind":"network","uid":"1f6c1253-522a-43d9-83f8-42607102b3b9","latency":"2s","jitter":"0ms","correlation":"0","device":"eth0","ip-address":"220.181.38.251","ip-protocol":"all"}\n'})}),"\n",(0,n.jsx)(s.h3,{id:"search-experiments-using-the-service-mode",children:"Search experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["Currently, the service mode only supports searching all experiments. You can get the data by visiting the ",(0,n.jsx)(s.code,{children:"/api/experiments/"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.h4,{id:"example-1",children:"Example"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X GET 127.0.0.1:31767/api/experiments/\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[{"id":1,"uid":"ddc5ca81-b677-4595-b691-0ce57bedb156","created_at":"2021-10-18T16:01:18.563542491+08:00","updated_at":"2021-10-18T16:07:27.87111393+08:00","status":"success","kind":"stress","action":"mem","recover_command":"{\\"schedule\\":\\"\\",\\"duration\\":\\"\\",\\"action\\":\\"mem\\",\\"kind\\":\\"stress\\",\\"uid\\":\\"ddc5ca81-b677-4595-b691-0ce57bedb156\\",\\"Load\\":0,\\"Workers\\":0,\\"Size\\":\\"100MB\\",\\"Options\\":null,\\"StressngPid\\":0}","launch_mode":"svr"}]\n'})}),"\n",(0,n.jsx)(s.h2,{id:"recover-experiments-of-chaosd",children:"Recover experiments of Chaosd"}),"\n",(0,n.jsx)(s.p,{children:"After creating an experiment, if you want to withdraw the impact caused by the experiment, you can use the recovery feature of experiments."}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-command-line-mode",children:"Recover experiments using the command-line mode"}),"\n",(0,n.jsx)(s.p,{children:"You can recover an experiment by using Chaosd recover UID."}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the command-line mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"Create a CPU stress experiment using Chaosd:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd attack stress cpu --workers 2 --load 10\n"})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'[2021/05/12 03:38:33.698 +00:00] [INFO] [stress.go:66] ["stressors normalize"] [arguments=" --cpu 2 --cpu-load 10"]\n[2021/05/12 03:38:33.702 +00:00] [INFO] [stress.go:82] ["Start stress-ng process successfully"] [command="/usr/bin/stress-ng --cpu 2 --cpu-load 10"] [Pid=27483]\nAttack stress cpu successfully, uid: 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["When you do not need to simulate the CPU stress scenario anymore, use the ",(0,n.jsx)(s.code,{children:"recover"})," command to recover the experiment corresponding to the UID:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"chaosd recover 4f33b2d4-aee6-43ca-9c43-0f12867e5c9c\n"})}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"recover-experiments-using-the-service-mode",children:"Recover experiments using the service mode"}),"\n",(0,n.jsxs)(s.p,{children:["You can recover an experiment by sending a ",(0,n.jsx)(s.code,{children:"DELETE"})," HTTP request to the ",(0,n.jsx)(s.code,{children:"/api/attack/{uid}"})," path of Chaosd service."]}),"\n",(0,n.jsx)(s.p,{children:"The following example shows how to recover an experiment using the service mode."}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsxs)(s.p,{children:["Send a ",(0,n.jsx)(s.code,{children:"POST"})," HTTP request to the Chaosd service to create a CPU stress experiment:"]}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'curl -X POST 172.16.112.130:31767/api/attack/stress -H "Content-Type:application/json" -d \'{"load":10, "action":"cpu","workers":1}\'\n'})}),"\n",(0,n.jsx)(s.p,{children:"The result is as follows:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:'{"status":200,"message":"attack successfully","uid":"c3c519bf-819a-4a7b-97fb-e3d0814481fa"}\n'})}),"\n",(0,n.jsx)(s.p,{children:"Save the experiment UID for later use."}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["\n",(0,n.jsx)(s.p,{children:"When you do not need to simulate the CPU stress scenario anymore, run the following command to recover the experiment corresponding to the UID:"}),"\n",(0,n.jsx)(s.pre,{children:(0,n.jsx)(s.code,{className:"language-bash",children:"curl -X DELETE 172.16.112.130:31767/api/attack/c3c519bf-819a-4a7b-97fb-e3d0814481fa\n"})}),"\n"]}),"\n"]})]})}function h(e={}){const{wrapper:s}={...(0,r.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(a,{...e})}):a(e)}},6383:(e,s,t)=>{t.d(s,{R:()=>c,x:()=>d});var n=t(30758);const r={},i=n.createContext(r);function c(e){const s=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/efa120a1.cdead96d.js b/assets/js/efa120a1.d97a7b05.js similarity index 99% rename from assets/js/efa120a1.cdead96d.js rename to assets/js/efa120a1.d97a7b05.js index 68d806676e..653b918b9d 100644 --- a/assets/js/efa120a1.cdead96d.js +++ b/assets/js/efa120a1.d97a7b05.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[1392],{36953:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,o={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/versioned_docs/version-2.6.4/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/simulate-aws-chaos"}},a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFOG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[1392],{36953:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>a,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var i=s(86070),t=s(6383);const l={title:"Simulate Linux Kernel Faults"},r=void 0,o={id:"simulate-kernel-chaos-on-kubernetes",title:"Simulate Linux Kernel Faults",description:"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.",source:"@site/versioned_docs/version-2.6.4/simulate-kernel-chaos-on-kubernetes.md",sourceDirName:".",slug:"/simulate-kernel-chaos-on-kubernetes",permalink:"/docs/simulate-kernel-chaos-on-kubernetes",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.6.4/simulate-kernel-chaos-on-kubernetes.md",tags:[],version:"2.6.4",frontMatter:{title:"Simulate Linux Kernel Faults"},sidebar:"docs",previous:{title:"Simulate JVM Application Faults",permalink:"/docs/simulate-jvm-application-chaos"},next:{title:"Simulate AWS Faults",permalink:"/docs/simulate-aws-chaos"}},a={},c=[{value:"Prerequisites",id:"prerequisites",level:2},{value:"Configuration file",id:"configuration-file",level:2},{value:"Create an experiment using kubectl",id:"create-an-experiment-using-kubectl",level:2},{value:"Usage restriction",id:"usage-restriction",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(n.p,{children:["This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using ",(0,i.jsx)(n.a,{href:"https://lore.kernel.org/lkml/20171213180356.hsuhzoa7s4ngro2r@destiny/T/",children:"BPF"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"Although you can set the injection target of KernelChaos to one or several Pods, the performance of other Pods on the host will be affected, because all Pods share the same kernel."}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"The simulation of Linux kernel faults is disabled by default. Do not use this feature in a production environment."})}),"\n",(0,i.jsx)(n.h2,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"Linux kernel version >= 4.18."}),"\n",(0,i.jsxs)(n.li,{children:["The Linux kernel configuration ",(0,i.jsx)(n.a,{href:"https://cateee.net/lkddb/web-lkddb/BPF_KPROBE_OVERRIDE.html",children:"CONFIG_BPF_KPROBE_OVERRIDE"})," is enabled."]}),"\n",(0,i.jsxs)(n.li,{children:["The ",(0,i.jsx)(n.code,{children:"bpfki.create"})," configuration value in ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/blob/master/helm/chaos-mesh/values.yaml",children:"values.yaml"})," is ",(0,i.jsx)(n.code,{children:"true"}),"."]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"configuration-file",children:"Configuration file"}),"\n",(0,i.jsx)(n.p,{children:"A simple KernelChaos configuration file is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-yaml",children:"apiVersion: chaos-mesh.org/v1alpha1\nkind: KernelChaos\nmetadata:\n name: kernel-chaos-example\n namespace: chaos-mesh\nspec:\n mode: one\n selector:\n namespaces:\n - chaos-mount\n failKernRequest:\n callchain:\n - funcname: '__x64_sys_mount'\n failtype: 0\n"})}),"\n",(0,i.jsxs)(n.p,{children:["For more configuration examples, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/chaos-mesh/tree/master/examples",children:"examples"}),". You can modify these configuration examples as needed."]}),"\n",(0,i.jsx)(n.p,{children:"Configuration description:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"mode"})," specifies how the experiment runs. The options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"one"}),": randomly selects an eligible Pod."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"all"}),": selects all eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed"}),": selects a specified number of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"fixed-percent"}),": selects a specified percentage of eligible Pods."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"random-max-percent"}),": selects the maximum percentage of eligible Pods."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"selector"})," specifies the target Pod for fault injection."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"FailedkernRequest"})," specifies the fault mode (such as kmallo and bio). It also specifies a specific call chain path and the optional filtering conditions. The configuration items are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Failtype"})," specifies the fault type. The value options are as follows:"]}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"'0': injects the slab allocation error should_failslab."}),"\n",(0,i.jsx)(n.li,{children:"'1': injects the memory page allocation error should_fail_alloc_page."}),"\n",(0,i.jsx)(n.li,{children:"'2': injects the bio error should_fail_bio."}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["For more information on these three fault types, refer to ",(0,i.jsx)(n.a,{href:"https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html",children:"fault-injection"})," and ",(0,i.jsx)(n.a,{href:"http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"inject_example"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"Callchain"})," specifies a specific call chain. For example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:"ext4_mount\n-> mount_subtree\n-> ...\n -> should_failslab\n"})}),"\n",(0,i.jsxs)(n.p,{children:["You can also use the function parameters as filtering rules to inject more fine-grained faults. Refer to ",(0,i.jsx)(n.a,{href:"https://github.com/chaos-mesh/bpfki/tree/develop/examples",children:"call chain and predicate examples"})," for more information. If no call chain is specified, keep the ",(0,i.jsx)(n.code,{children:"callchain"})," field empty, indicating that faults will be injected to any path on which slab alloc is called (for example, kmallo)."]}),"\n",(0,i.jsx)(n.p,{children:"The call chain type is a frame array, consisting of the following three parts:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"funcname"}),", which can be found from the kernel source code or from ",(0,i.jsx)(n.code,{children:"/proc/kallsyms"}),", such as ",(0,i.jsx)(n.code,{children:"ext4_mount"}),"."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"parameters"}),", which is used for filtering. If you want to inject a slab error on the ",(0,i.jsx)(n.code,{children:"d_alloc_parallel(struct dentry *parent, const struct qstr *name)"})," with a special name ",(0,i.jsx)(n.code,{children:"bananas"})," path, you need to set the ",(0,i.jsx)(n.code,{children:"parameters"})," to ",(0,i.jsx)(n.code,{children:"struct dentry *parent, const struct qstr *name"}),". Otherwise, omit this configuration."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.strong,{children:"predicate"}),", which is used to access the parameters of the frame array. Taking ",(0,i.jsx)(n.strong,{children:"parameters"})," as an example, you can set it to ",(0,i.jsx)(n.code,{children:'STRNCMP(name->name, "bananas", 8)'})," to control the path of fault injection, or you can leave it empty for all call paths that execute ",(0,i.jsx)(n.code,{children:"d_allo_parallel"})," receive the slab fault injection."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"headers"}),' specifies the kernel header file you need. For example, "linux/mmzone.h" and "linux/blkdev.h".']}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"probability"})," specifies the probability of faults. If you want the probability of 1%, set to '1'."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.strong,{children:"times"})," specifies the maximum number of times a fault is triggered."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"create-an-experiment-using-kubectl",children:"Create an experiment using kubectl"}),"\n",(0,i.jsxs)(n.p,{children:["Use ",(0,i.jsx)(n.code,{children:"kubectl"})," to create an experiment:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-bash",children:"kubectl apply -f KernelChaos\n"})}),"\n",(0,i.jsxs)(n.p,{children:["The KernelChaos feature is similar to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject.py",children:"inject.py"}),". For more information, refer to ",(0,i.jsx)(n.a,{href:"https://github.com/iovisor/bcc/blob/master/tools/inject_example.txt",children:"input_example.txt"}),"."]}),"\n",(0,i.jsx)(n.p,{children:"A simple example is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-c",children:'#include \n#include \n#include \n#include \n#include \n\nint main(void) {\n int ret;\n while (1) {\n ret = mount("/dev/sdc", "/mnt", "ext4",\n MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n sleep(1);\n ret = umount("/mnt");\n if (ret < 0)\n fprintf(stderr, "%s\\n", strerror(errno));\n }\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"During the fault injection, the output is as follows:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n> Cannot allocate memory\n> Invalid argument\n"})}),"\n",(0,i.jsx)(n.h2,{id:"usage-restriction",children:"Usage restriction"}),"\n",(0,i.jsx)(n.p,{children:"You can use container_id to limit the scope of the fault injection, but some paths trigger system-level behaviors. For example:"}),"\n",(0,i.jsxs)(n.p,{children:["When ",(0,i.jsx)(n.code,{children:"failtype"})," is ",(0,i.jsx)(n.code,{children:"1"}),", it means that the physical page allocation fails. If this event is frequently triggered within a short period of time (for example, ",(0,i.jsx)(n.code,{children:"while (1) {memset(malloc(1M), '1', 1M)}"}),"), the oom-killer system call is triggered to recycle memory."]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},6383:(e,n,s)=>{s.d(n,{R:()=>r,x:()=>o});var i=s(30758);const t={},l=i.createContext(t);function r(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:r(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f25d6f58.d2dc3eb9.js b/assets/js/f25d6f58.b6279740.js similarity index 74% rename from assets/js/f25d6f58.d2dc3eb9.js rename to assets/js/f25d6f58.b6279740.js index 008b440c3c..067ade3aac 100644 --- a/assets/js/f25d6f58.d2dc3eb9.js +++ b/assets/js/f25d6f58.b6279740.js @@ -1 +1 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[8067],{31758:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/versioned_docs/version-2.5.2/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/2.5.2/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/inspect-chaos-experiments.md",tags:[],version:"2.5.2",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/2.5.2/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/2.5.2/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/2.5.2/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(1336).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(1023).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been succesfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},1023:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},1336:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[8067],{31758:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>o,default:()=>l,frontMatter:()=>c,metadata:()=>r,toc:()=>d});var t=n(86070),i=n(6383);const c={title:"Inspect Results of Chaos Experiments"},o=void 0,r={id:"inspect-chaos-experiments",title:"Inspect Results of Chaos Experiments",description:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.",source:"@site/versioned_docs/version-2.5.2/inspect-chaos-experiments.md",sourceDirName:".",slug:"/inspect-chaos-experiments",permalink:"/docs/2.5.2/inspect-chaos-experiments",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.5.2/inspect-chaos-experiments.md",tags:[],version:"2.5.2",frontMatter:{title:"Inspect Results of Chaos Experiments"},sidebar:"docs",previous:{title:"Run a Chaos Experiment",permalink:"/docs/2.5.2/run-a-chaos-experiment"},next:{title:"Create Chaos Mesh Workflow",permalink:"/docs/2.5.2/create-chaos-mesh-workflow"}},a={},d=[{value:"Introduction to steps of a chaos experiment",id:"introduction-to-steps-of-a-chaos-experiment",level:2},{value:"Check results using Chaos Dashboard",id:"check-results-using-chaos-dashboard",level:2},{value:"Check results using the kubectl command",id:"check-results-using-the-kubectl-command",level:2}];function h(e){const s={a:"a",admonition:"admonition",code:"code",h2:"h2",img:"img",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.p,{children:"This document describes how to use Chaos Mesh to check running status and results of chaos experiments."}),"\n",(0,t.jsx)(s.h2,{id:"introduction-to-steps-of-a-chaos-experiment",children:"Introduction to steps of a chaos experiment"}),"\n",(0,t.jsx)(s.p,{children:"In Chaos Mesh, the life cycle of a chaos experiment is divided into four steps, according to its running process:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:['Injecting: Chaos experiment is in the process of fault injection. Normally, this step lasts for a short time. If the "Injecting" step lasts a long time, it may be due to some exceptions in the chaos experiment. In this case, you can check ',(0,t.jsx)(s.code,{children:"Events"})," to find the cause of the exceptions."]}),"\n",(0,t.jsx)(s.li,{children:"Running: After the faults have been successfully injected into all target pods, the chaos experiment starts running."}),"\n",(0,t.jsxs)(s.li,{children:["Paused: when executing a ",(0,t.jsx)(s.a,{href:"/docs/2.5.2/run-a-chaos-experiment#pause-chaos-experiments",children:"paused"})," process for a running chaos experiment, Chaos Mesh restores the injected faults from all target pods, which indicates the experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["Finished: if the ",(0,t.jsx)(s.code,{children:"duration"})," parameter of the experiment is configured, and when the experiment runs it up, Chaos Mesh restores the injected faults from all target pods, which indicates that the experiment is finished."]}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:"check-results-using-chaos-dashboard",children:"Check results using Chaos Dashboard"}),"\n",(0,t.jsx)(s.p,{children:"You can check the running steps of chaos experiments on any of the following pages using Chaos Dashboard:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"List of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(1336).A+"",width:"1760",height:"648"})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:"Details of chaos experiments:"}),"\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.img,{alt:"Experimental Status",src:n(1023).A+"",width:"1680",height:"762"})}),"\n"]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["If the ",(0,t.jsx)(s.strong,{children:'"Injecting"'})," step lasts for a long time, it may be due to some anomalies in the chaos experiment (e.g. the configured selectors have not selected target pods where to inject chaos actions). In this case, you can check ",(0,t.jsx)(s.strong,{children:(0,t.jsx)(s.code,{children:"Events"})})," to find the cause of the exceptions and check the configuration of the chaos experiment."]}),"\n",(0,t.jsxs)(s.li,{children:["Chaos Dashboard only displays ",(0,t.jsx)(s.a,{href:"#introduction-to-steps-of-a-chaos-experiment",children:"main steps of a chaos experiment"}),". For more detailed information about experiment status and results, run the ",(0,t.jsx)(s.code,{children:"kubectl"})," command."]}),"\n"]})}),"\n",(0,t.jsxs)(s.h2,{id:"check-results-using-the-kubectl-command",children:["Check results using the ",(0,t.jsx)(s.code,{children:"kubectl"})," command"]}),"\n",(0,t.jsxs)(s.p,{children:["To confirm the results of chaos experiments, use the following ",(0,t.jsx)(s.code,{children:"kubectl describe"})," command to check the ",(0,t.jsx)(s.code,{children:"Status"})," and ",(0,t.jsx)(s.code,{children:"Events"})," of experiment objects."]}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"kubectl describe podchaos pod-failure-tikv -n tidb-cluster\n"})}),"\n",(0,t.jsx)(s.p,{children:"The expected output is as follows:"}),"\n",(0,t.jsx)(s.pre,{children:(0,t.jsx)(s.code,{className:"language-shell",children:"...\nStatus:\n Conditions:\n Reason:\n Status: False\n Type: Paused\n Reason:\n Status: True\n Type: Selected\n Reason:\n Status: True\n Type: AllInjected\n Reason:\n Status: False\n Type: AllRecovered\n Experiment:\n Container Records:\n Id: tidb-cluster/basic-tikv-0\n Phase: Injected\n Selector Key: .\n Desired Phase: Run\nEvents:\n Type Reason Age From Message\n ---- ------ ---- ---- -------\n Normal FinalizerInited 39s finalizer Finalizer has been inited\n Normal Paused 39s desiredphase Experiment has been paused\n Normal Updated 39s finalizer Successfully update finalizer of resource\n Normal Updated 39s records Successfully update records of resource\n Normal Updated 39s desiredphase Successfully update desiredPhase of resource\n Normal Started 17s desiredphase Experiment has started\n Normal Updated 17s desiredphase Successfully update desiredPhase of resource\n Normal Applied 17s records Successfully apply chaos for tidb-cluster/basic-tikv-0\n Normal Updated 17s records Successfully update records of resource\n"})}),"\n",(0,t.jsx)(s.p,{children:"The above output contains two parts:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Status"})}),"\n",(0,t.jsxs)(s.p,{children:["Based on the running process of the chaos experiment, the ",(0,t.jsx)(s.code,{children:"Status"})," provides four types of status records:"]}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Paused"}),': indicates the chaos experiment is in the "Paused" step.']}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"Selected"}),": indicates the chaos experiment had correctly selected the target pods where to inject chaos actions."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllInjected"}),": indicates the faults have been successfully injected to all target pods."]}),"\n",(0,t.jsxs)(s.li,{children:[(0,t.jsx)(s.code,{children:"AllRecoverd"}),": indicates the injected faults have been successfully restored from all target pods."]}),"\n"]}),"\n",(0,t.jsx)(s.p,{children:"The actual running status of current chaos experiments can be inferred from these four types of status records. For example:"}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"}),"\u3001",(0,t.jsx)(s.code,{children:"Selected"}),"\u3001",(0,t.jsx)(s.code,{children:"AllRecoverd"})," is ",(0,t.jsx)(s.code,{children:"True"})," and ",(0,t.jsx)(s.code,{children:"AllInjected"})," is ",(0,t.jsx)(s.code,{children:"False"}),", it indicates the current chaos experiment is paused."]}),"\n",(0,t.jsxs)(s.li,{children:["When ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the current chaos experiment is paused. However, if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]}),"\n"]}),"\n",(0,t.jsx)(s.admonition,{type:"note",children:(0,t.jsxs)(s.p,{children:["You can get more information from the combination of the above status records, for example, when ",(0,t.jsx)(s.code,{children:"Paused"})," is ",(0,t.jsx)(s.code,{children:"True"}),", it indicates the experiment is paused, but if the ",(0,t.jsx)(s.code,{children:"Selected"})," is ",(0,t.jsx)(s.code,{children:"False"})," at the same time, then it means the current experiment cannot select the target pods where to inject chaos actions."]})}),"\n"]}),"\n",(0,t.jsxs)(s.li,{children:["\n",(0,t.jsx)(s.p,{children:(0,t.jsx)(s.code,{children:"Events"})}),"\n",(0,t.jsx)(s.p,{children:"It contains the records of actions conducted during the whole life cycle of a chaos experiment, which can help to check experiment status and troubleshoot issues."}),"\n"]}),"\n"]})]})}function l(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,t.jsx)(s,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},1023:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/chaos_detail_status-171482b3cd8c1e3759a52e4fd6860875.png"},1336:(e,s,n)=>{n.d(s,{A:()=>t});const t=n.p+"assets/images/list_chaos_status-478857ce5a06cb75eabc4d3a980a91e0.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var t=n(30758);const i={},c=t.createContext(i);function o(e){const s=t.useContext(c);return t.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),t.createElement(c.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f7309d15.400cff5c.js b/assets/js/f7309d15.400cff5c.js deleted file mode 100644 index 925e152cf8..0000000000 --- a/assets/js/f7309d15.400cff5c.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2794],{51370:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>t,metadata:()=>r,toc:()=>c});var a=n(86070),i=n(6383);const t={title:"Basic Features"},o=void 0,r={id:"basic-features",title:"Basic Features",description:"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.",source:"@site/versioned_docs/version-2.4.3/basic-features.md",sourceDirName:".",slug:"/basic-features",permalink:"/docs/2.4.3/basic-features",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/basic-features.md",tags:[],version:"2.4.3",frontMatter:{title:"Basic Features"},sidebar:"docs",previous:{title:"Chaos Mesh Overview",permalink:"/docs/2.4.3/"},next:{title:"Quick Start",permalink:"/docs/2.4.3/quick-start"}},l={},c=[{value:"Fault injection",id:"fault-injection",level:2},{value:"Chaos workflows",id:"chaos-workflows",level:2},{value:"Visualized operations",id:"visualized-operations",level:2},{value:"Security guarantee",id:"security-guarantee",level:2}];function h(e){const s={a:"a",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["This document describes the basic features of Chaos Mesh, including ",(0,a.jsx)(s.a,{href:"#fault-injection",children:"fault injection"}),", ",(0,a.jsx)(s.a,{href:"#chaos-workflows",children:"Chaos workflows"}),", ",(0,a.jsx)(s.a,{href:"#visualized-operations",children:"visualized operations"}),", and ",(0,a.jsx)(s.a,{href:"#security-guarantees",children:"security guarantees"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"fault-injection",children:"Fault injection"}),"\n",(0,a.jsx)(s.p,{children:"Fault injection is the key of Chaos experiments. Chaos Mesh covers a full range of faults that might occur in a distributed system, and provides three comprehensive and fine-grained fault types: basic resource faults, platform faults, and application-layer faults."}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["Basic resource faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-pod-chaos-on-kubernetes",children:"PodChaos"}),": simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-network-chaos-on-kubernetes",children:"NetworkChaos"}),": simulates network failures, such as network latency, packet loss, packet disorder, and network partitions."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-dns-chaos-on-kubernetes",children:"DNSChaos"}),": simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-http-chaos-on-kubernetes",children:"HTTPChaos"}),": simulates HTTP communication failures, such as HTTP communication latency."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-heavy-stress-on-kubernetes",children:"StressChaos"}),": simulates CPU race or memory race."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-io-chaos-on-kubernetes",children:"IOChaos"}),": simulates the I/O failure of an application file, such as I/O delays, read and write failures."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-time-chaos-on-kubernetes",children:"TimeChaos"}),": simulates the time jump exception."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes",children:"KernelChaos"}),": simulates kernel failures, such as an exception of the application memory allocation."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Platform faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-aws-chaos",children:"AWSChaos"}),": simulates AWS platform failures, such as the AWS node restart."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-gcp-chaos",children:"GCPChaos"}),": simulates GCP platform failures, such as the GCP node restart."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Application faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-jvm-application-chaos",children:"JVMChaos"}),": simulates JVM application failures, such as the function call delay."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"chaos-workflows",children:"Chaos workflows"}),"\n",(0,a.jsx)(s.p,{children:"A Chaos workflow includes a set of Chaos experiments and an application status check, so you can complete the entire process of a Chaos engineering project on the platform."}),"\n",(0,a.jsx)(s.p,{children:"Chaos workflows enable you to perform a series of Chaos experiments, keep expanding the explosion radius (including the scope of attacks), and increase the failure types. After running a Chaos workflow, you can easily view the current state of the application using Chaos Mesh and determine whether to perform follow-up experiments.At the same time, to reduce the cost of maintaining Chaos workflows, you can keep updating and accumulating the Chaos experiment workflows, and apply the existing experiments to other workflows."}),"\n",(0,a.jsx)(s.p,{children:"Currently, Chaos workflows provide the following features:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Orchestrate serial Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Orchestrate parallel Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Support checking experimental status and results"}),"\n",(0,a.jsx)(s.li,{children:"Support pausing a Chaos experiment"}),"\n",(0,a.jsx)(s.li,{children:"Support using YAML files to define and manage Chaos workflows"}),"\n",(0,a.jsx)(s.li,{children:"Support using the web UI to define and manage Chaos workflows"}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["For the configuration of a specific workflow, see ",(0,a.jsx)(s.a,{href:"/docs/2.4.3/create-chaos-mesh-workflow",children:"Create Chaos Mesh workflow"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"visualized-operations",children:"Visualized operations"}),"\n",(0,a.jsx)(s.p,{children:"Chaos Mesh provides the Chaos Dashboard component for visualized operations, which greatly simplifies Chaos experiments.You can manage and monitor a Chaos experiment directly through the visualization interface. For example, with a few clicks on the interface, you can define the scope of a Chaos experiment, specify the type of Chaos injection, define scheduling rules, and get the results of the Chaos experiment."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Chaos workflow",src:n(15564).A+"",width:"1892",height:"859"})}),"\n",(0,a.jsx)(s.h2,{id:"security-guarantee",children:"Security guarantee"}),"\n",(0,a.jsxs)(s.p,{children:["Chaos Mesh manages permissions using the native ",(0,a.jsx)(s.a,{href:"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",children:"RBAC"})," feature in Kubernetes."]}),"\n",(0,a.jsx)(s.p,{children:"You can freely create multiple roles based on your actual permission requirements, bind the roles to the username service account, and then generate the token corresponding to the service account.When you log into the Dashboard using this token, you can only perform Chaos experiments within the permissions given by the service account."}),"\n",(0,a.jsx)(s.p,{children:"In addition, you can specify the namespaces that allow Chaos experiments by setting the namespace annotations, which further safeguards the control of Chaos experiments."})]})}function u(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},15564:(e,s,n)=>{n.d(s,{A:()=>a});const a=n.p+"assets/images/dashboard-overview-445b086ab6dbbdf6525405e17c12782b.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var a=n(30758);const i={},t=a.createContext(i);function o(e){const s=a.useContext(t);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/f7309d15.dea33b92.js b/assets/js/f7309d15.dea33b92.js new file mode 100644 index 0000000000..586ce991b0 --- /dev/null +++ b/assets/js/f7309d15.dea33b92.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[2794],{51370:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>l,contentTitle:()=>o,default:()=>u,frontMatter:()=>t,metadata:()=>r,toc:()=>c});var a=n(86070),i=n(6383);const t={title:"Basic Features"},o=void 0,r={id:"basic-features",title:"Basic Features",description:"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.",source:"@site/versioned_docs/version-2.4.3/basic-features.md",sourceDirName:".",slug:"/basic-features",permalink:"/docs/2.4.3/basic-features",draft:!1,unlisted:!1,editUrl:"https://github.com/chaos-mesh/website/edit/master/versioned_docs/version-2.4.3/basic-features.md",tags:[],version:"2.4.3",frontMatter:{title:"Basic Features"},sidebar:"docs",previous:{title:"Chaos Mesh Overview",permalink:"/docs/2.4.3/"},next:{title:"Quick Start",permalink:"/docs/2.4.3/quick-start"}},l={},c=[{value:"Fault injection",id:"fault-injection",level:2},{value:"Chaos workflows",id:"chaos-workflows",level:2},{value:"Visualized operations",id:"visualized-operations",level:2},{value:"Security guarantee",id:"security-guarantee",level:2}];function h(e){const s={a:"a",h2:"h2",img:"img",li:"li",p:"p",ul:"ul",...(0,i.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(s.p,{children:["This document describes the basic features of Chaos Mesh, including ",(0,a.jsx)(s.a,{href:"#fault-injection",children:"fault injection"}),", ",(0,a.jsx)(s.a,{href:"#chaos-workflows",children:"Chaos workflows"}),", ",(0,a.jsx)(s.a,{href:"#visualized-operations",children:"visualized operations"}),", and ",(0,a.jsx)(s.a,{href:"#security-guarantees",children:"security guarantees"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"fault-injection",children:"Fault injection"}),"\n",(0,a.jsx)(s.p,{children:"Fault injection is the key of Chaos experiments. Chaos Mesh covers a full range of faults that might occur in a distributed system, and provides three comprehensive and fine-grained fault types: basic resource faults, platform faults, and application-layer faults."}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:["Basic resource faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-pod-chaos-on-kubernetes",children:"PodChaos"}),": simulates Pod failures, such as Pod node restart, Pod's persistent unavailability, and certain container failures in a specific Pod."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-network-chaos-on-kubernetes",children:"NetworkChaos"}),": simulates network failures, such as network latency, packet loss, packet disorder, and network partitions."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-dns-chaos-on-kubernetes",children:"DNSChaos"}),": simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-http-chaos-on-kubernetes",children:"HTTPChaos"}),": simulates HTTP communication failures, such as HTTP communication latency."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-heavy-stress-on-kubernetes",children:"StressChaos"}),": simulates CPU race or memory race."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-io-chaos-on-kubernetes",children:"IOChaos"}),": simulates the I/O failure of an application file, such as I/O delays, read and write failures."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-time-chaos-on-kubernetes",children:"TimeChaos"}),": simulates the time jump exception."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes",children:"KernelChaos"}),": simulates kernel failures, such as an exception of the application memory allocation."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Platform faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-aws-chaos",children:"AWSChaos"}),": simulates AWS platform failures, such as the AWS node restart."]}),"\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-gcp-chaos",children:"GCPChaos"}),": simulates GCP platform failures, such as the GCP node restart."]}),"\n"]}),"\n"]}),"\n",(0,a.jsxs)(s.li,{children:["Application faults:","\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsxs)(s.li,{children:[(0,a.jsx)(s.a,{href:"/docs/2.4.3/simulate-jvm-application-chaos",children:"JVMChaos"}),": simulates JVM application failures, such as the function call delay."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,a.jsx)(s.h2,{id:"chaos-workflows",children:"Chaos workflows"}),"\n",(0,a.jsx)(s.p,{children:"A Chaos workflow includes a set of Chaos experiments and an application status check, so you can complete the entire process of a Chaos engineering project on the platform."}),"\n",(0,a.jsx)(s.p,{children:"Chaos workflows enable you to perform a series of Chaos experiments, keep expanding the explosion radius (including the scope of attacks), and increase the failure types. After running a Chaos workflow, you can easily view the current state of the application using Chaos Mesh and determine whether to perform follow-up experiments.At the same time, to reduce the cost of maintaining Chaos workflows, you can keep updating and accumulating the Chaos experiment workflows, and apply the existing experiments to other workflows."}),"\n",(0,a.jsx)(s.p,{children:"Currently, Chaos workflows provide the following features:"}),"\n",(0,a.jsxs)(s.ul,{children:["\n",(0,a.jsx)(s.li,{children:"Orchestrate serial Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Orchestrate parallel Chaos experiments"}),"\n",(0,a.jsx)(s.li,{children:"Support checking experimental status and results"}),"\n",(0,a.jsx)(s.li,{children:"Support pausing a Chaos experiment"}),"\n",(0,a.jsx)(s.li,{children:"Support using YAML files to define and manage Chaos workflows"}),"\n",(0,a.jsx)(s.li,{children:"Support using the web UI to define and manage Chaos workflows"}),"\n"]}),"\n",(0,a.jsxs)(s.p,{children:["For the configuration of a specific workflow, see ",(0,a.jsx)(s.a,{href:"/docs/2.4.3/create-chaos-mesh-workflow",children:"Create Chaos Mesh workflow"}),"."]}),"\n",(0,a.jsx)(s.h2,{id:"visualized-operations",children:"Visualized operations"}),"\n",(0,a.jsx)(s.p,{children:"Chaos Mesh provides the Chaos Dashboard component for visualized operations, which greatly simplifies Chaos experiments.You can manage and monitor a Chaos experiment directly through the visualization interface. For example, with a few clicks on the interface, you can define the scope of a Chaos experiment, specify the type of Chaos injection, define scheduling rules, and get the results of the Chaos experiment."}),"\n",(0,a.jsx)(s.p,{children:(0,a.jsx)(s.img,{alt:"Chaos workflow",src:n(15564).A+"",width:"1892",height:"859"})}),"\n",(0,a.jsx)(s.h2,{id:"security-guarantee",children:"Security guarantee"}),"\n",(0,a.jsxs)(s.p,{children:["Chaos Mesh manages permissions using the native ",(0,a.jsx)(s.a,{href:"https://kubernetes.io/docs/reference/access-authn-authz/rbac/",children:"RBAC"})," feature in Kubernetes."]}),"\n",(0,a.jsx)(s.p,{children:"You can freely create multiple roles based on your actual permission requirements, bind the roles to the username service account, and then generate the token corresponding to the service account.When you log into the Dashboard using this token, you can only perform Chaos experiments within the permissions given by the service account."}),"\n",(0,a.jsx)(s.p,{children:"In addition, you can specify the namespaces that allow Chaos experiments by setting the namespace annotations, which further safeguards the control of Chaos experiments."})]})}function u(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,a.jsx)(s,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}},15564:(e,s,n)=>{n.d(s,{A:()=>a});const a=n.p+"assets/images/dashboard-overview-445b086ab6dbbdf6525405e17c12782b.png"},6383:(e,s,n)=>{n.d(s,{R:()=>o,x:()=>r});var a=n(30758);const i={},t=a.createContext(i);function o(e){const s=a.useContext(t);return a.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function r(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),a.createElement(t.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/fb790a05.19de27ad.js b/assets/js/fb790a05.19de27ad.js deleted file mode 100644 index 7aa2a09b53..0000000000 --- a/assets/js/fb790a05.19de27ad.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7839],{86976:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"2.4.3","label":"2.4.3","banner":"unmaintained","badge":true,"noIndex":false,"className":"docs-version-2.4.3","isLast":false,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/2.4.3/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/2.4.3/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/2.4.3/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/2.4.3/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/2.4.3/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/2.4.3/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/2.4.3/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/2.4.3/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/2.4.3/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/2.4.3/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/2.4.3/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/2.4.3/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/2.4.3/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/2.4.3/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/2.4.3/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/2.4.3/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/2.4.3/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/2.4.3/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/2.4.3/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.4.3/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.4.3/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/2.4.3/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/2.4.3/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.4.3/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.4.3/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/2.4.3/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/2.4.3/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/2.4.3/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/2.4.3/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Latency","href":"/docs/2.4.3/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/2.4.3/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/2.4.3/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/2.4.3/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.4.3/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/2.4.3/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.4.3/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/2.4.3/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.4.3/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.4.3/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/2.4.3/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/2.4.3/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/2.4.3/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/2.4.3/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/2.4.3/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/2.4.3/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/2.4.3/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/2.4.3/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/2.4.3/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add New Chaos Experiment Type","href":"/docs/2.4.3/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/2.4.3/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/2.4.3/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/2.4.3/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/2.4.3/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/2.4.3/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/2.4.3/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.4.0 Tracking","href":"/docs/2.4.3/release-2.4-tracking","docId":"release-2.4-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"This document describes how to develop Chaos Mesh. Before you start, it is recommended to first read the following documents:","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add new chaos experiment type, you have added HelloWorldChaos, which can print Hello World! in the logs of Chaos Controller Manager. To enable the HelloWorldChaos to inject some faults into the target Pod, you need to extend interface for Chaos Daemon.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.4-tracking":{"id":"release-2.4-tracking","title":"Chaos Mesh v2.4.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Latency","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and set up the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/fb790a05.7f8c4ca7.js b/assets/js/fb790a05.7f8c4ca7.js new file mode 100644 index 0000000000..8f20bb466d --- /dev/null +++ b/assets/js/fb790a05.7f8c4ca7.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkchaos_mesh_website=self.webpackChunkchaos_mesh_website||[]).push([[7839],{86976:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"2.4.3","label":"2.4.3","banner":"unmaintained","badge":true,"noIndex":false,"className":"docs-version-2.4.3","isLast":false,"docsSidebars":{"docs":[{"type":"category","label":"About Chaos Mesh","items":[{"type":"link","label":"Chaos Mesh Overview","href":"/docs/2.4.3/","docId":"overview","unlisted":false},{"type":"link","label":"Basic Features","href":"/docs/2.4.3/basic-features","docId":"basic-features","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Getting Started","collapsed":false,"items":[{"type":"category","label":"Installation and Deployment","collapsed":false,"items":[{"type":"link","label":"Quick Start","href":"/docs/2.4.3/quick-start","docId":"quick-start","unlisted":false},{"type":"link","label":"Install Chaos Mesh using Helm","href":"/docs/2.4.3/production-installation-using-helm","docId":"production-installation-using-helm","unlisted":false},{"type":"link","label":"Install Chaos Mesh Offline","href":"/docs/2.4.3/offline-installation","docId":"offline-installation","unlisted":false},{"type":"link","label":"Persistence Chaos Dashboard","href":"/docs/2.4.3/persistence-dashboard","docId":"persistence-dashboard","unlisted":false},{"type":"link","label":"Uninstall Chaos Mesh","href":"/docs/2.4.3/uninstallation","docId":"uninstallation","unlisted":false},{"type":"link","label":"Supported Releases","href":"/supported-releases"}],"collapsible":true},{"type":"link","label":"Manage User Permissions","href":"/docs/2.4.3/manage-user-permissions","docId":"manage-user-permissions","unlisted":false},{"type":"link","label":"Configure namespace for Chaos experiments","href":"/docs/2.4.3/configure-enabled-namespace","docId":"configure-enabled-namespace","unlisted":false},{"type":"category","label":"Run a Single Chaos Experiment","items":[{"type":"link","label":"Define the Scope of Chaos Experiments","href":"/docs/2.4.3/define-chaos-experiment-scope","docId":"define-chaos-experiment-scope","unlisted":false},{"type":"link","label":"Define Scheduling Rules","href":"/docs/2.4.3/define-scheduling-rules","docId":"define-scheduling-rules","unlisted":false},{"type":"link","label":"Run a Chaos Experiment","href":"/docs/2.4.3/run-a-chaos-experiment","docId":"run-a-chaos-experiment","unlisted":false},{"type":"link","label":"Inspect Results of Chaos Experiments","href":"/docs/2.4.3/inspect-chaos-experiments","docId":"inspect-chaos-experiments","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Orchestrate Multiple Chaos Experiments","items":[{"type":"link","label":"Create Chaos Mesh Workflow","href":"/docs/2.4.3/create-chaos-mesh-workflow","docId":"create-chaos-mesh-workflow","unlisted":false},{"type":"link","label":"Serial and Parallel Experiments","href":"/docs/2.4.3/run-serial-or-parallel-experiments","docId":"run-serial-or-parallel-experiments","unlisted":false},{"type":"link","label":"Send HTTP Requests on Workflow","href":"/docs/2.4.3/send-http-request-on-workflow","docId":"send-http-request-on-workflow","unlisted":false},{"type":"link","label":"Check Workflow Status","href":"/docs/2.4.3/check-workflow-status","docId":"check-workflow-status","unlisted":false},{"type":"link","label":"Status Check in Workflow","href":"/docs/2.4.3/status-check-in-workflow","docId":"status-check-in-workflow","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsible":true},{"type":"category","label":"Types of Chaos Experiments","items":[{"type":"category","label":"Kubernetes","items":[{"type":"link","label":"Simulate Pod Faults","href":"/docs/2.4.3/simulate-pod-chaos-on-kubernetes","docId":"simulate-pod-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.4.3/simulate-network-chaos-on-kubernetes","docId":"simulate-network-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.4.3/simulate-heavy-stress-on-kubernetes","docId":"simulate-heavy-stress-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate File I/O Faults","href":"/docs/2.4.3/simulate-io-chaos-on-kubernetes","docId":"simulate-io-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate DNS Faults","href":"/docs/2.4.3/simulate-dns-chaos-on-kubernetes","docId":"simulate-dns-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.4.3/simulate-time-chaos-on-kubernetes","docId":"simulate-time-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.4.3/simulate-jvm-application-chaos","docId":"simulate-jvm-application-chaos","unlisted":false},{"type":"link","label":"Simulate Linux Kernel Faults","href":"/docs/2.4.3/simulate-kernel-chaos-on-kubernetes","docId":"simulate-kernel-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate AWS Faults","href":"/docs/2.4.3/simulate-aws-chaos","docId":"simulate-aws-chaos","unlisted":false},{"type":"link","label":"Simulate Azure Faults","href":"/docs/2.4.3/simulate-azure-chaos","docId":"simulate-azure-chaos","unlisted":false},{"type":"link","label":"Simulate GCP Faults","href":"/docs/2.4.3/simulate-gcp-chaos","docId":"simulate-gcp-chaos","unlisted":false},{"type":"link","label":"Simulate HTTP Faults","href":"/docs/2.4.3/simulate-http-chaos-on-kubernetes","docId":"simulate-http-chaos-on-kubernetes","unlisted":false},{"type":"link","label":"Simulate Block Device Latency","href":"/docs/2.4.3/simulate-block-chaos-on-kubernetes","docId":"simulate-block-chaos-on-kubernetes","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Physical Nodes","items":[{"type":"link","label":"Chaosd Introduction","href":"/docs/2.4.3/chaosd-overview","docId":"chaosd-overview","unlisted":false},{"type":"link","label":"Simulate Faults on Physical Machines","href":"/docs/2.4.3/simulate-physical-machine-chaos","docId":"simulate-physical-machine-chaos","unlisted":false},{"type":"link","label":"Simulate Process Faults","href":"/docs/2.4.3/simulate-process-chaos-in-physical-nodes","docId":"simulate-process-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Network Faults","href":"/docs/2.4.3/simulate-network-chaos-in-physical-nodes","docId":"simulate-network-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Host Faults","href":"/docs/2.4.3/simulate-host-console-in-physical-nodes","docId":"simulate-host-console-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Stress Scenarios","href":"/docs/2.4.3/simulate-heavy-stress-in-physical-nodes","docId":"simulate-heavy-stress-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Disk Faults","href":"/docs/2.4.3/simulate-disk-pressure-in-physical-nodes","docId":"simulate-disk-pressure-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate JVM Application Faults","href":"/docs/2.4.3/simulate-jvm-application-chaos-in-physical-nodes","docId":"simulate-jvm-application-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Time Faults","href":"/docs/2.4.3/simulate-time-chaos-on-physical-nodes","docId":"simulate-time-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Simulate File Faults","href":"/docs/2.4.3/simulate-file-chaos-in-physical-nodes","docId":"simulate-file-chaos-in-physical-nodes","unlisted":false},{"type":"link","label":"Simulate Redis Faults","href":"/docs/2.4.3/simulate-redis-chaos-on-physical-nodes","docId":"simulate-redis-chaos-on-physical-nodes","unlisted":false},{"type":"link","label":"Search and Recover Experiments of Chaosd","href":"/docs/2.4.3/chaosd-search-recover","docId":"chaosd-search-recover","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true},{"type":"category","label":"Authentication","items":[{"type":"link","label":"GCP OAuth Authentication","href":"/docs/2.4.3/gcp-authentication","docId":"gcp-authentication","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Tools Integration","items":[{"type":"link","label":"Integrate Chaos Mesh to GitHub Actions","href":"/docs/2.4.3/integrate-chaos-mesh-into-github-actions","docId":"integrate-chaos-mesh-into-github-actions","unlisted":false},{"type":"link","label":"Use Grafana Data Source Plugin for Observations","href":"/docs/2.4.3/use-grafana-data-source","docId":"use-grafana-data-source","unlisted":false},{"type":"link","label":"Chaosctl","href":"/docs/2.4.3/chaosctl-tool","docId":"chaosctl-tool","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Development Guides","items":[{"type":"link","label":"Developer Guide Overview","href":"/docs/2.4.3/developer-guide-overview","docId":"developer-guide-overview","unlisted":false},{"type":"link","label":"Configure the Development Environment","href":"/docs/2.4.3/configure-development-environment","docId":"configure-development-environment","unlisted":false},{"type":"link","label":"Add New Chaos Experiment Type","href":"/docs/2.4.3/add-new-chaos-experiment-type","docId":"add-new-chaos-experiment-type","unlisted":false},{"type":"link","label":"Extend Chaos Daemon Interface","href":"/docs/2.4.3/extend-chaos-daemon-interface","docId":"extend-chaos-daemon-interface","unlisted":false},{"type":"link","label":"Extend Chaosd","href":"/docs/2.4.3/extend-chaosd","docId":"extend-chaosd","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"FAQs and Troubleshooting","items":[{"type":"link","label":"FAQs","href":"/docs/2.4.3/faqs","docId":"faqs","unlisted":false},{"type":"link","label":"Upgrade to Chaos Mesh 2.0","href":"/docs/2.4.3/upgrade-to-2.0","docId":"upgrade-to-2.0","unlisted":false},{"type":"link","label":"Upgrade from 2.1 to 2.2","href":"/docs/2.4.3/upgrade-from-2.1-to-2.2","docId":"upgrade-from-2.1-to-2.2","unlisted":false}],"collapsed":true,"collapsible":true},{"type":"category","label":"Release","items":[{"type":"link","label":"Chaos Mesh Release Cycle","href":"/docs/2.4.3/release-cycle","docId":"release-cycle","unlisted":false},{"type":"category","label":"Release Tracking","items":[{"type":"link","label":"Chaos Mesh v2.4.0 Tracking","href":"/docs/2.4.3/release-2.4-tracking","docId":"release-2.4-tracking","unlisted":false}],"collapsed":true,"collapsible":true}],"collapsed":true,"collapsible":true}]},"docs":{"add-new-chaos-experiment-type":{"id":"add-new-chaos-experiment-type","title":"Add New Chaos Experiment Type","description":"This document describes how to add a new chaos experiment type.","sidebar":"docs"},"basic-features":{"id":"basic-features","title":"Basic Features","description":"This document describes the basic features of Chaos Mesh, including fault injection, Chaos workflows, visualized operations, and security guarantees.","sidebar":"docs"},"chaos-engineering-principles":{"id":"chaos-engineering-principles","title":"\u6df7\u6c8c\u5de5\u7a0b\u7406\u8bba","description":"TODO"},"chaosctl-tool":{"id":"chaosctl-tool","title":"Chaosctl","description":"Chaosctl is a tool to assist in debugging Chaos Mesh. With Chaosctl, you can simplify the process of developing and debugging new chaos types, and provide references for other developers when raising an issue.","sidebar":"docs"},"chaosd-overview":{"id":"chaosd-overview","title":"Chaosd Introduction","description":"Chaosd introduction","sidebar":"docs"},"chaosd-search-recover":{"id":"chaosd-search-recover","title":"Search and Recover Experiments of Chaosd","description":"You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.","sidebar":"docs"},"check-workflow-status":{"id":"check-workflow-status","title":"Check Workflow Status","description":"Check workflow status using Chaos Dashboard","sidebar":"docs"},"clean-up-chaos-experiments":{"id":"clean-up-chaos-experiments","title":"Clean up Chaos Experiments","description":"TODO"},"configure-development-environment":{"id":"configure-development-environment","title":"Configure the Development Environment","description":"This document describes how to configure a local development environment for Chaos Mesh.","sidebar":"docs"},"configure-enabled-namespace":{"id":"configure-enabled-namespace","title":"Configure namespace for Chaos experiments","description":"This chapter walks you through how to configure Chaos experiments to only take effect in the specified namespace, and protect other unspecified namespaces against fault injection.","sidebar":"docs"},"create-chaos-mesh-workflow":{"id":"create-chaos-mesh-workflow","title":"Create Chaos Mesh Workflow","description":"Introduction to Chaos Mesh Workflow","sidebar":"docs"},"define-chaos-experiment-scope":{"id":"define-chaos-experiment-scope","title":"Define the Scope of Chaos Experiments","description":"This document describes how to define the scope of a single Chaos experiment, which helps you accurately control the fault\'s explosion radius.","sidebar":"docs"},"define-scheduling-rules":{"id":"define-scheduling-rules","title":"Define Scheduling Rules","description":"Schedule overview","sidebar":"docs"},"define-workflow-scheduling-rules":{"id":"define-workflow-scheduling-rules","title":"\u5b9a\u4e49\u8c03\u5ea6\u89c4\u5219","description":"TODO"},"developer-guide-overview":{"id":"developer-guide-overview","title":"Developer Guide Overview","description":"This document describes how to develop Chaos Mesh. Before you start, it is recommended to first read the following documents:","sidebar":"docs"},"extend-chaos-daemon-interface":{"id":"extend-chaos-daemon-interface","title":"Extend Chaos Daemon Interface","description":"In Add new chaos experiment type, you have added HelloWorldChaos, which can print Hello World! in the logs of Chaos Controller Manager. To enable the HelloWorldChaos to inject some faults into the target Pod, you need to extend interface for Chaos Daemon.","sidebar":"docs"},"extend-chaosd":{"id":"extend-chaosd","title":"Extend Chaosd","description":"TODO","sidebar":"docs"},"faqs":{"id":"faqs","title":"FAQs","description":"If I do not have deployed Kubernetes clusters, can I use Chaos Mesh to create chaos experiments?","sidebar":"docs"},"gcp-authentication":{"id":"gcp-authentication","title":"GCP OAuth Authentication","description":"When Chaos Mesh is deployed on the Google Cloud Platform, you can log in to Chaos Dashboard through Google OAuth. This document describes how to enable and configure this function.","sidebar":"docs"},"glossary":{"id":"glossary","title":"\u672f\u8bed\u8868","description":"TODO"},"go-client":{"id":"go-client","title":"Go","description":"TODO"},"inspect-chaos-experiments":{"id":"inspect-chaos-experiments","title":"Inspect Results of Chaos Experiments","description":"This document describes how to use Chaos Mesh to check running status and results of chaos experiments.","sidebar":"docs"},"integrate-chaos-mesh-into-github-actions":{"id":"integrate-chaos-mesh-into-github-actions","title":"Integrate Chaos Mesh to GitHub Actions","description":"This document describes how to integrate Chaos Mesh to customize the continuous integration (CI) using chaos-mesh-action. This helps you identify issues that have been introduced into system development before product releases.","sidebar":"docs"},"java-client":{"id":"java-client","title":"JAVA","description":"TODO"},"manage-user-permissions":{"id":"manage-user-permissions","title":"Manage User Permissions","description":"This document describes how to manage user permissions in Chaos Mesh, including creating user accounts with different roles, binding permissions to user accounts, managing tokens, and enabling or disabling permission authentication.","sidebar":"docs"},"multi-data-center-scenario":{"id":"multi-data-center-scenario","title":"\u591a\u6570\u636e\u4e2d\u5fc3\u573a\u666f","description":"TODO"},"offline-installation":{"id":"offline-installation","title":"Install Chaos Mesh Offline","description":"This document describes how to install Chaos Mesh offline.","sidebar":"docs"},"overview":{"id":"overview","title":"Chaos Mesh Overview","description":"This document describes the concepts, use cases, core strengths, and the architecture of Chaos Mesh.","sidebar":"docs"},"persistence-dashboard":{"id":"persistence-dashboard","title":"Persistence Chaos Dashboard","description":"This document describes how to make Chaos Dashboard persistence.","sidebar":"docs"},"production-installation-using-helm":{"id":"production-installation-using-helm","title":"Install Chaos Mesh using Helm","description":"This document describes how to install Chaos Mesh in the production environment.","sidebar":"docs"},"python-client":{"id":"python-client","title":"Python","description":"TODO"},"quick-start":{"id":"quick-start","title":"Quick Start","description":"This document describes how to start Chaos Mesh quickly in a test or local environment.","sidebar":"docs"},"release-0.0.8":{"id":"release-0.0.8","title":"0.0.8 release notes","description":"TODO"},"release-0.0.9":{"id":"release-0.0.9","title":"0.0.9 release notes","description":"TODO"},"release-1.0.0":{"id":"release-1.0.0","title":"1.0.0 release notes","description":"TODO"},"release-2.0.0":{"id":"release-2.0.0","title":"2.0.0 release notes","description":"TODO"},"release-2.4-tracking":{"id":"release-2.4-tracking","title":"Chaos Mesh v2.4.0 Tracking","description":"Links","sidebar":"docs"},"release-cycle":{"id":"release-cycle","title":"Chaos Mesh Release Cycle","description":"This document is focused on Chaos Mesh developers and contributors who need to create an enhancement, issue, or pull request which targets a specific release milestone.","sidebar":"docs"},"run-a-chaos-experiment":{"id":"run-a-chaos-experiment","title":"Run a Chaos Experiment","description":"This document describes how to create, run, view, pause, update, and delete Chaos experiments in Chaos Mesh.","sidebar":"docs"},"run-serial-or-parallel-experiments":{"id":"run-serial-or-parallel-experiments","title":"Serial and Parallel Experiments","description":"Chaos Mesh Workflow offers two ways of scheduling experiments: serial and parallel. You can configure and schedule multiple experiments as needed.","sidebar":"docs"},"rust-client":{"id":"rust-client","title":"Rust","description":"TODO"},"send-http-request-on-workflow":{"id":"send-http-request-on-workflow","title":"Send HTTP Requests on Workflow","description":"Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.","sidebar":"docs"},"simulate-aws-chaos":{"id":"simulate-aws-chaos","title":"Simulate AWS Faults","description":"This document describes how to use Chaos Mesh to simulate AWS faults.","sidebar":"docs"},"simulate-azure-chaos":{"id":"simulate-azure-chaos","title":"Simulate Azure Faults","description":"This document describes how to use Chaos Mesh to simulate Azure faults.","sidebar":"docs"},"simulate-block-chaos-on-kubernetes":{"id":"simulate-block-chaos-on-kubernetes","title":"Simulate Block Device Latency","description":"BlockChaos Introduction","sidebar":"docs"},"simulate-disk-pressure-in-physical-nodes":{"id":"simulate-disk-pressure-in-physical-nodes","title":"Simulate Disk Faults","description":"This document describes how to use Chaosd to simulate disk faults. This feature helps you simulate disk read/write load (via dd) or disk fill (via dd or fallocate).","sidebar":"docs"},"simulate-dns-chaos-on-kubernetes":{"id":"simulate-dns-chaos-on-kubernetes","title":"Simulate DNS Faults","description":"This document describes how to create DNSChaos experiments in Chaos Mesh to simulate DNS faults.","sidebar":"docs"},"simulate-file-chaos-in-physical-nodes":{"id":"simulate-file-chaos-in-physical-nodes","title":"Simulate File Faults","description":"TODO","sidebar":"docs"},"simulate-gcp-chaos":{"id":"simulate-gcp-chaos","title":"Simulate GCP Faults","description":"This document describes how to use Chaos Mesh to inject faults into GCP Pod. Chaos Dashboard and YAML files are provided to create GCPChaos experiments.","sidebar":"docs"},"simulate-heavy-stress-in-physical-nodes":{"id":"simulate-heavy-stress-in-physical-nodes","title":"Simulate Stress Scenarios","description":"This document describes how to use Chaosd to simulate stress scenarios. This feature generates CPU or memory stress on the host using stress-ng. You can create stress experiments either in command-line or service mode.","sidebar":"docs"},"simulate-heavy-stress-on-kubernetes":{"id":"simulate-heavy-stress-on-kubernetes","title":"Simulate Stress Scenarios","description":"StressChaos Introduction","sidebar":"docs"},"simulate-host-console-in-physical-nodes":{"id":"simulate-host-console-in-physical-nodes","title":"Simulate Host Faults","description":"This document introduces how to simulate host shutdown faults using Chaosd.","sidebar":"docs"},"simulate-http-chaos-on-kubernetes":{"id":"simulate-http-chaos-on-kubernetes","title":"Simulate HTTP Faults","description":"This document describes how to simulate HTTP faults by creating HTTPChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-io-chaos-on-kubernetes":{"id":"simulate-io-chaos-on-kubernetes","title":"Simulate File I/O Faults","description":"This document describes how to create IOChaos experiments in Chaos Mesh.","sidebar":"docs"},"simulate-jvm-application-chaos":{"id":"simulate-jvm-application-chaos","title":"Simulate JVM Application Faults","description":"Chaos Mesh simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-jvm-application-chaos-in-physical-nodes":{"id":"simulate-jvm-application-chaos-in-physical-nodes","title":"Simulate JVM Application Faults","description":"Chaosd simulates the faults of JVM application through Byteman. The supported fault types are as follows:","sidebar":"docs"},"simulate-kernel-chaos-on-kubernetes":{"id":"simulate-kernel-chaos-on-kubernetes","title":"Simulate Linux Kernel Faults","description":"This document describes how to use KernelChaos to simulate Linux kernel faults. This feature injects I/O-based or memory-based faults into the specified kernel paths using BPF.","sidebar":"docs"},"simulate-network-chaos-in-physical-nodes":{"id":"simulate-network-chaos-in-physical-nodes","title":"Simulate Network Faults","description":"This document introduces how to use Chaosd to simulate network faults. The simulations can be completed by modifying network routing and traffic flow control using iptables, ipsets, tc, etc.","sidebar":"docs"},"simulate-network-chaos-on-kubernetes":{"id":"simulate-network-chaos-on-kubernetes","title":"Simulate Network Faults","description":"This document describes how to simulate network faults using NetworkChaos in Chaos Mesh.","sidebar":"docs"},"simulate-physical-machine-chaos":{"id":"simulate-physical-machine-chaos","title":"Simulate Faults on Physical Machines","description":"This document describes how to create PhysicalMachineChaos (physical machine chaos) experiments in Chaos Mesh to simulate the faults of network, disk, pressure, JVM, time, and others in physical or virtual machines.","sidebar":"docs"},"simulate-pod-chaos-on-kubernetes":{"id":"simulate-pod-chaos-on-kubernetes","title":"Simulate Pod Faults","description":"This document describes how to use Chaos Mesh to inject faults into Kubernetes Pod to simulate Pod or container faults. Chaos Dashboard and YAML files are provided to create PodChaos experiments.","sidebar":"docs"},"simulate-process-chaos-in-physical-nodes":{"id":"simulate-process-chaos-in-physical-nodes","title":"Simulate Process Faults","description":"This document describes how to use Chaosd to simulate process faults. The process faults use the Golang interface of the kill command to simulate the scenarios that the process is killed or stopped. You can create experiments either in the command-line mode or service mode.","sidebar":"docs"},"simulate-redis-chaos-on-physical-nodes":{"id":"simulate-redis-chaos-on-physical-nodes","title":"Simulate Redis Faults","description":"This document introduces how to use Chaosd to simulate Redis faults. This feature uses Golang interfaces in go-redis package and the redis-server command-line tool. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"simulate-time-chaos-on-kubernetes":{"id":"simulate-time-chaos-on-kubernetes","title":"Simulate Time Faults","description":"TimeChaos Introduction","sidebar":"docs"},"simulate-time-chaos-on-physical-nodes":{"id":"simulate-time-chaos-on-physical-nodes","title":"Simulate Time Faults","description":"This document describes how to use Chaosd to simulate a time offset scenario. You can create experiments either in command-line mode or service mode.","sidebar":"docs"},"status-check-in-workflow":{"id":"status-check-in-workflow","title":"Status Check in Workflow","description":"In Workflow, the status check could execute specified operations on external systems, such as application systems and monitoring systems, to obtain their statuses, and automatically abort the Workflow when it finds the system is unhealthy. The concept is similar to Container Probes in Kubernetes. This article describes how to execute status checks in Workflow using YAML files.","sidebar":"docs"},"troubleshooting-guide":{"id":"troubleshooting-guide","title":"\u6545\u969c\u6392\u67e5","description":"TODO"},"uninstallation":{"id":"uninstallation","title":"Uninstall Chaos Mesh","description":"This document introduces how to uninstall Chaos Mesh, including uninstall Chaos Mesh with Helm and uninstall Chaos Mesh manually. It\'s also very helpful to manually purge Chaos Mesh installation from Kubernetes cluster if you have to do.","sidebar":"docs"},"upgrade-from-2.1-to-2.2":{"id":"upgrade-from-2.1-to-2.2","title":"Upgrade from 2.1 to 2.2","description":"There are several changes in Helm Charts 2.2.0 release. This documentation introduces how to migrate from 2.1.x to 2.2.0.","sidebar":"docs"},"upgrade-to-2.0":{"id":"upgrade-to-2.0","title":"Upgrade to Chaos Mesh 2.0","description":"This document provides detailed instruction for upgrading Chaos Mesh from 1.x to 2.0. Chaos Mesh 2.0 introduced some new features and fixed many issues. Because in Chaos Mesh 2.0, some code has been rebuilt, you need to perform extra actions for the upgrade.","sidebar":"docs"},"use-argo-to-orchestrate-chaos-experiments":{"id":"use-argo-to-orchestrate-chaos-experiments","title":"\u4f7f\u7528 Argo \u7f16\u6392\u6df7\u6c8c\u5b9e\u9a8c","description":"TODO"},"use-grafana-data-source":{"id":"use-grafana-data-source","title":"Use Grafana Data Source Plugin for Observations","description":"This document describes how to install the Data Source plugin for Grafana and set up the plugin to observe Chaos Mesh events.","sidebar":"docs"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.ed361a13.js b/assets/js/runtime~main.ee7b8624.js similarity index 89% rename from assets/js/runtime~main.ed361a13.js rename to assets/js/runtime~main.ee7b8624.js index 00c2cb5e22..c1d37855ca 100644 --- a/assets/js/runtime~main.ed361a13.js +++ b/assets/js/runtime~main.ee7b8624.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,f,c,d,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var f=t[e]={exports:{}};return b[e].call(f.exports,f,f.exports,r),f.exports}r.m=b,e=[],r.O=(a,f,c,d)=>{if(!f){var b=1/0;for(i=0;i=d)&&Object.keys(r.O).every((e=>r.O[e](f[o])))?f.splice(o--,1):(t=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[f,c,d]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var d=Object.create(null);r.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(d,b),d},r.d=(e,a)=>{for(var f in a)r.o(a,f)&&!r.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,f)=>(r.f[f](e,a),a)),[])),r.u=e=>"assets/js/"+({11:"bc0eadd3",14:"104d1416",36:"c3e7c0c9",57:"b089efb6",121:"ae77e8e2",184:"02ac8add",185:"191c30c0",246:"1404d338",258:"8c78330a",284:"f759dd86",336:"217721c0",343:"12b1faf3",363:"12e8afb1",372:"d853b26e",406:"fc64b336",421:"261e8f95",449:"589bdb1e",500:"ac2bc92e",502:"de2866f0",503:"7462fa9a",529:"08af526d",547:"93eff53c",566:"06a8f81a",569:"aa5a177c",576:"abf7ef46",578:"d4b8d191",579:"cbec43f6",607:"9f09c0c4",646:"98269b50",689:"5457728b",696:"75234536",699:"e5a3b196",715:"d3fbcd5e",741:"11eeaf94",783:"a4ee439e",810:"0c3ee269",825:"aed57c6e",880:"b516026a",897:"ea4c8659",922:"8eb0ea08",923:"99bc7767",956:"f1555dde",957:"c141421f",999:"9f0e6576",1001:"8a93abd2",1059:"e671ed15",1094:"72fec000",1117:"85828edd",1122:"34d05537",1169:"85d01255",1196:"349ca830",1199:"29637022",1228:"c20650c8",1235:"a7456010",1280:"1e73a314",1290:"5233d56a",1297:"c231ae2a",1343:"fc0deac2",1353:"1147623b",1355:"2bd9a4f4",1375:"52534247",1392:"efa120a1",1414:"64db70a3",1419:"9b7cc76c",1449:"95e0ec25",1454:"42c371df",1473:"d524739c",1487:"d50e42cc",1488:"bd8b6f29",1491:"c62b7275",1557:"2a74af38",1620:"c3f65626",1621:"591059de",1672:"dd04b75e",1675:"b6f15f4b",1734:"f6e0d55d",1772:"8dc6dd8d",1824:"ecd7e5b4",1841:"b16ab538",1849:"366ada8c",1858:"fad1e435",1870:"fa551551",1903:"acecf23e",1909:"199cfc1b",1925:"5e3e1feb",1928:"dcec8022",2006:"9908821b",2018:"66463a72",2030:"0ab1f926",2048:"76776ce4",2059:"d042486d",2064:"a2188845",2119:"8ae96016",2137:"738f3c0d",2138:"1a4e3797",2162:"6828bc3e",2192:"d7ede3a0",2217:"3ebe1811",2239:"db3cf118",2256:"11b43341",2302:"e97f4c14",2470:"0a3c9d81",2532:"930c3d3d",2537:"bdb15fe9",2564:"22c99dfb",2567:"0b7a903d",2575:"804cd4d3",2593:"366fb5a9",2603:"3c03df54",2611:"88839718",2624:"c837099f",2634:"c4f5d8e4",2637:"51d6a254",2711:"9e4087bc",2766:"3fe76707",2794:"f7309d15",2814:"72e14192",2839:"3106804f",2849:"c44d6f6a",2855:"49784f7c",2891:"562c697b",2912:"a5b4bd89",2929:"d93f3ed8",2941:"eb22d371",2957:"51f60bd2",2994:"ea0178cf",3012:"8a64a7fb",3019:"6897adcd",3068:"1b232ec9",3082:"63328f1b",3083:"733580ea",3113:"b5e9f7b8",3119:"86d1f6d3",3129:"70329d25",3141:"120235e2",3149:"3c0cff8c",3156:"e91017d6",3157:"098d4173",3177:"8a5f6556",3188:"3b5985a4",3215:"2063472f",3236:"11408f98",3249:"ccc49370",3277:"529c53fa",3278:"169a7e91",3288:"fad52357",3317:"fecc65b6",3324:"8fbfdb6a",3350:"ee9abf09",3382:"7aafb598",3413:"9b6413a6",3493:"41da1ac1",3498:"7247ad55",3528:"75ba67a2",3530:"733750c7",3550:"8575fbbf",3559:"32aa1a3b",3578:"b2fca173",3580:"278c0ee7",3581:"43aabc11",3595:"63389418",3618:"7f77f4ae",3627:"b14d964f",3662:"69935607",3671:"3253b287",3690:"47be93b7",3698:"26ac8cdf",3778:"8c914af7",3785:"df0cf232",3789:"90ecb0a4",3793:"f9adc506",3802:"3955c833",3817:"b94df2e2",3854:"ad242a1d",3871:"3cf74380",3872:"22de7d29",3949:"b2eb6ad0",3986:"227412c0",4027:"bc8cb039",4028:"8ce2a1ba",4030:"01ccb5c8",4092:"4f7ce8f2",4198:"ef21a7a0",4212:"621db11d",4229:"de96c0ed",4249:"aff76f8f",4271:"891e3ffb",4279:"02489c3c",4284:"eb96136a",4311:"64a5caf2",4328:"c7d75768",4378:"8b8c00ac",4389:"261b748b",4430:"1371498d",4448:"abfcd627",4461:"3c564b32",4504:"177b2451",4505:"a93cf237",4530:"ce420c5c",4546:"bda40383",4673:"ff962926",4689:"4eaba250",4744:"59a5a33f",4749:"cc101466",4775:"62ea5d23",4801:"3f21b6c3",4813:"6875c492",4825:"9506ff33",4826:"f3cd0dc0",4828:"18b93cb3",4842:"690602ea",4850:"2f3ff69e",4853:"e84af1dc",4855:"c6691638",4991:"9317738f",4993:"84415e09",4997:"85f8d6a8",5017:"3116f78b",5039:"b3bfd067",5117:"98ddfb9b",5122:"55e6429c",5124:"4aa47776",5208:"97df2ae1",5250:"41bc510c",5269:"eecb3c77",5282:"e73d8426",5284:"d57001c7",5319:"2a5030af",5331:"4805635c",5341:"9809ed3b",5352:"52165f2d",5437:"82afff0e",5439:"07f371e9",5457:"3f767692",5522:"cc7281b7",5558:"1e7aef8f",5607:"ca94432f",5654:"194e0ab1",5687:"321751f7",5693:"f85e3b16",5742:"aba21aa0",5767:"c9a076d8",5907:"1df1f1fe",5946:"9176dd93",5967:"83029544",6056:"ec4a99a3",6061:"1f391b9e",6079:"195a936f",6089:"66ea2723",6124:"f87c5e9f",6151:"a7399dad",6221:"b5bf7bb0",6232:"86508316",6239:"f55ac880",6254:"8f3fafc4",6283:"70dc8051",6297:"da7ae84d",6367:"43385197",6380:"d5e72bf8",6384:"c143539c",6393:"42fa9ed1",6451:"3cf9319f",6458:"7ffa5dd6",6476:"18f4287e",6481:"a6cd7ee1",6492:"ce9e273a",6547:"e0508589",6551:"10870ede",6599:"90d2a8ae",6608:"9cdd8bd1",6620:"bf53dfeb",6634:"1af9c351",6640:"c35480f4",6650:"6cd4385b",6663:"f752fba7",6687:"a04bf919",6688:"da5208fe",6701:"276ad930",6747:"66d02352",6770:"e95d6e7a",6780:"99a9cca6",6782:"00760ae4",6798:"9f3a4faa",6801:"d8b1b829",6803:"549c7802",6840:"9de65543",6863:"3c9dc0dd",6913:"fcd991e7",6964:"98b5d3d8",6975:"98453b9f",6985:"64f8cf74",7005:"84a993c9",7033:"c6acdb69",7051:"e747ec83",7098:"a7bd4aaa",7141:"cee468a4",7168:"8561c1af",7198:"6e3e7ba2",7206:"5aed59f0",7234:"601d4a49",7252:"5d1a2949",7263:"242716f8",7272:"b12fc7e1",7275:"c75fb953",7301:"d4b8580c",7309:"53bc5dff",7310:"20723ffa",7369:"e33f29d2",7380:"47c9151a",7386:"923730dc",7397:"a1f9bdc4",7403:"ac0c26b1",7460:"00aa4d09",7472:"814f3328",7493:"4b8cf287",7549:"5957e61f",7590:"5273f3be",7622:"6fd76181",7643:"a6aa9e1f",7650:"3fadee21",7689:"5bc13194",7711:"3a9cfda9",7767:"3a97a91e",7768:"b60c2781",7782:"1ffdd7de",7793:"70f04d34",7799:"12c1ce9b",7803:"3af8c53c",7821:"3d960ce6",7839:"fb790a05",7859:"ee6fbbf8",7870:"9fcddf3f",7895:"058b8cb6",7946:"140701a3",7955:"e86885f1",7966:"37a47e84",7975:"53f7bbf3",7993:"73ba8788",7998:"3c1c61ff",8003:"45951754",8067:"f25d6f58",8106:"cae65014",8141:"91ef01f2",8143:"34b4b926",8167:"f7ca5716",8198:"977782a2",8209:"01a85c17",8214:"1f175bda",8318:"1dde6c1a",8348:"388245ef",8395:"879c32d4",8401:"17896441",8413:"1db64337",8512:"e4972855",8530:"4965e7cb",8596:"b8a60ade",8616:"6f8a752d",8618:"16639819",8625:"f7343d2a",8641:"a6ac4e5a",8655:"cfb5730b",8685:"617f6d79",8732:"ea70c07d",8749:"dbfc4782",8750:"338e3047",8803:"b4636e3e",8817:"9c2f3124",8854:"baaadf99",8857:"b7108862",8859:"cf98717e",8868:"6d4306e7",8885:"735a03fc",8901:"57d917f5",8903:"6b8fb093",8918:"34b4c58f",8929:"5928dda1",8958:"02a9c178",8969:"c4b334be",8982:"f491139f",9026:"d40ea7ec",9048:"a94703ab",9073:"06a15cdf",9081:"5b09dda1",9092:"b565383c",9095:"b1cabbcf",9123:"e66b200c",9192:"23b3163c",9262:"9dbf45f9",9264:"05d348c0",9300:"75fca3db",9336:"6cf1dc42",9415:"e4ec0e82",9417:"8dbd7dd1",9434:"0b1b165d",9484:"a435b217",9486:"da8ed49b",9551:"ac400e52",9593:"284bc205",9612:"5d4fa438",9620:"64000b03",9625:"c4902fbf",9647:"5e95c892",9670:"47b7279e",9724:"791dccb8",9818:"3120bb7f",9858:"36994c47",9891:"4fe280e0",9900:"fdae5fe9",9914:"41e838b4",9943:"37220d5e",9999:"94b8fb96"}[e]||e)+"."+{11:"82bf308f",14:"560ae1f0",36:"a9e376e3",57:"51e41d69",121:"58321a97",184:"1afd52de",185:"d1da2b0a",246:"a1efee86",258:"d1804338",284:"f8039256",336:"81748210",343:"49ce19de",363:"44d1f535",372:"4a56b770",406:"f83e4c28",421:"1b211693",449:"d9c8ea66",500:"5583d1dd",502:"a5642a62",503:"2612acea",529:"da2aa622",547:"03d12b8e",566:"b2c674a6",569:"d02d13e9",576:"35697a81",578:"57bb04fe",579:"2aa1258c",607:"0b803742",646:"916dcb53",689:"12dcbc14",696:"3f2d194d",699:"65338782",715:"fa7cec18",741:"f2c76bdc",783:"823d455c",810:"b9ad3c34",825:"14587479",880:"7b2cf45a",897:"9d441468",906:"c769bfdf",922:"9007d712",923:"61ed4494",956:"c8e0a41e",957:"894efbca",999:"bc7edb97",1001:"21b200dd",1059:"77dad0dc",1094:"97d871d9",1117:"980644fa",1122:"b6faf63f",1169:"e3c4d419",1196:"dbb8e693",1199:"1ce1c60d",1228:"590503d0",1235:"bbd1fdcd",1280:"9ca55f32",1290:"3c927371",1297:"4e58fd53",1343:"4dc348e6",1353:"a40aab99",1355:"eea96b0a",1375:"3a6e37a0",1392:"cdead96d",1414:"43a9b796",1419:"8ea1f4d7",1427:"ff7c05b4",1449:"3df64af7",1454:"30292444",1473:"878de901",1487:"d20c4a18",1488:"f8da44ff",1491:"182a8128",1557:"914cc668",1620:"b4356b4b",1621:"7f6a2eec",1672:"17f2eb6a",1675:"fcb9415c",1734:"c7e2a97b",1772:"4cb578a4",1824:"5ed269a7",1841:"255011af",1849:"b60a98a5",1858:"37ebec19",1870:"05c3eddf",1903:"819256b2",1909:"671504cd",1925:"6b888905",1928:"a8b2c40c",2006:"e2f78821",2018:"fcca4b2d",2030:"dbb72ce5",2048:"0f3da435",2059:"03186a8e",2064:"2608fa26",2119:"ef750553",2137:"14dbd111",2138:"f8c726b6",2162:"2eb6088d",2192:"10cf1e89",2217:"48533325",2239:"36ef70ab",2256:"490d9ea0",2302:"a9e6529c",2470:"fe5080ae",2532:"86218fe0",2537:"69ef0660",2564:"6d2e904e",2567:"b7610143",2575:"164f4bb5",2593:"62f5a955",2603:"280c1534",2611:"72c01108",2624:"5dd75ed1",2634:"6b3ba573",2637:"849cd86a",2711:"3443aa67",2766:"bb927d91",2794:"400cff5c",2814:"376b0140",2839:"ee0d3124",2849:"d2751cb9",2855:"47fc601f",2891:"e6b81eb3",2912:"c8634e34",2929:"50daaec0",2941:"14a9eebe",2957:"cd83fa06",2994:"441b8204",3012:"f89cccc5",3019:"41448f44",3068:"c42a14c1",3082:"4deb18b8",3083:"8d210db5",3113:"ec72e601",3119:"5c0c4765",3129:"3ece62e3",3141:"55f86e3a",3149:"0291f342",3156:"6729cb97",3157:"a8ed62fb",3177:"12197e51",3188:"ea87de12",3215:"f9bb412d",3236:"3aab3357",3249:"a24fa909",3277:"b93f0e5d",3278:"fbf2e8ce",3288:"aa8f4134",3317:"e1249021",3324:"17dd473f",3350:"242a393e",3382:"82713f70",3413:"682fbe01",3493:"0c9b8d99",3498:"b4f79634",3528:"506bf132",3530:"7952b4a9",3550:"3bbb6c85",3559:"18fad00f",3578:"3b6597a1",3580:"51324d98",3581:"8243eb8e",3595:"1d742e95",3618:"d25afdcd",3627:"ac1ca1e6",3662:"8b450dc9",3671:"77cbc9d7",3690:"cc5afd08",3698:"72f6c0ff",3778:"dc87d5f4",3785:"ece8438d",3789:"ae061c76",3793:"51b6b56a",3802:"80fc8ecb",3817:"49aa5e5d",3854:"d8f14d04",3871:"609cf8e1",3872:"5fefd23a",3949:"e6517557",3986:"3a7e963b",4027:"89ce31a2",4028:"7c5ef570",4030:"0c1f4fce",4092:"3e030ce2",4147:"69c75c01",4198:"520bc558",4212:"d0a498fb",4229:"90de3aec",4249:"e83f9cd9",4271:"fe540b38",4279:"070cb2bd",4284:"9eed290c",4311:"568e8f28",4328:"e598c5af",4378:"7ecdf19e",4389:"8aaa64fa",4430:"171d4488",4448:"ce494cb8",4461:"5e474d57",4504:"a57f13d9",4505:"0c4384e5",4530:"1d8a625e",4546:"c4a48734",4673:"016fc4de",4689:"b4346e33",4744:"2fff19df",4749:"d7f04b36",4775:"313a32d0",4801:"fa2c9cdf",4813:"be00cc3f",4825:"acf3a6be",4826:"e0b84659",4828:"adad864a",4842:"5fc08a6c",4850:"f5b93018",4853:"20a86aa3",4855:"137a0752",4991:"640bbe3b",4993:"a4823a30",4997:"fc451fad",5017:"0b1a7631",5039:"ceace99f",5117:"80e6a4b2",5122:"4151bb09",5124:"dc8fd971",5208:"70e6c486",5250:"337e52fd",5269:"2acc106c",5282:"d56fa4c7",5284:"109334bc",5319:"68dc014a",5331:"0675fab6",5341:"ee88300e",5352:"311cbce8",5437:"9382a734",5439:"264e0191",5457:"971d3b72",5522:"006aec98",5558:"b31d663a",5607:"6dc596e5",5654:"55422036",5687:"a7741f89",5693:"9ef6295f",5742:"7b7a851a",5767:"2a3f97a8",5856:"6ab87fd5",5907:"b6f4c410",5931:"9bc52efa",5946:"fa395ef0",5967:"7f926130",6056:"9782752b",6061:"3a63d7ef",6079:"b09d94da",6089:"4774df8e",6124:"81249466",6151:"ee981ef7",6221:"6ae751df",6232:"0d67693f",6239:"f064343b",6254:"91fe7f18",6283:"46eaedd6",6297:"feae61d1",6367:"a24c3a13",6380:"0ae74957",6384:"b870f0d1",6393:"766a20a7",6451:"2e7c3403",6458:"6a8c36a0",6476:"22587494",6481:"bee0db36",6492:"216be2da",6547:"52686267",6551:"a3924ea1",6599:"01a82b4e",6608:"6e312da0",6620:"088497a4",6634:"bd3734e7",6640:"13f04309",6650:"417b0114",6663:"1f1aa101",6687:"25a520db",6688:"01367dfd",6701:"5360bddf",6747:"cb9e3c25",6770:"08cd63bd",6780:"a633737c",6782:"4e75f68c",6798:"a91f1d80",6801:"feaa304a",6803:"569c3435",6840:"1bbc9593",6863:"56c0cccf",6871:"e1e6cc7a",6913:"77f7c9a6",6964:"92ca1af7",6975:"e481434d",6985:"45a34543",7005:"edba43de",7033:"2b8f414d",7051:"94131c51",7079:"ab6cdf83",7098:"da81382c",7141:"cae79bc9",7168:"ad1db94c",7198:"f7f11f3e",7206:"d8dd45cd",7234:"244058d7",7252:"8f85075b",7263:"c329941d",7272:"99ed4e65",7275:"06b7b809",7301:"c909bc3c",7309:"811e05a6",7310:"80ee5a6e",7369:"1c210c3b",7380:"c05dbac9",7386:"0e9b27dd",7397:"9ed148ad",7403:"512d2661",7460:"12a0bbcc",7472:"8637f5fd",7493:"16fb75db",7549:"94db3277",7590:"dd18e1e5",7622:"3c250288",7643:"683d59a3",7650:"4d769d2b",7689:"ff7a60d4",7711:"3072f253",7767:"20e5f500",7768:"5bdc6f99",7782:"1f54af8b",7793:"02767032",7799:"89e114a9",7803:"1b7dd9c1",7821:"b84076ac",7839:"19de27ad",7859:"456c5e6c",7870:"e1750dc6",7895:"4f395509",7946:"fceb65a1",7955:"dd8fb11a",7966:"de36f6ab",7975:"fc8479f4",7993:"e5efde6c",7998:"2c8ebdaf",8003:"0cc42937",8067:"d2dc3eb9",8106:"b0f4f742",8141:"c8754346",8143:"094417a8",8167:"27daba3e",8198:"133eb61f",8209:"0b6e9596",8214:"613228d5",8318:"ab5137c7",8348:"8c4d27d4",8395:"a12d9de0",8401:"21fd4831",8413:"67468e01",8512:"6d78c2a0",8530:"db939d84",8596:"3e4441e4",8616:"2a0cf43e",8618:"ea2e6184",8625:"19882c2a",8641:"4c03093f",8655:"f207fea4",8685:"d7324548",8732:"68b3ee5c",8749:"98710ebd",8750:"decc8406",8803:"057fe311",8817:"1acdc719",8854:"871e76a6",8857:"55340cfd",8859:"677f1ba1",8868:"44bb9440",8885:"0690dbd8",8901:"bb066c65",8903:"b57911e3",8918:"3ecd8305",8929:"5940d4d6",8958:"4490dfd0",8969:"3fa48599",8982:"3fabc0ed",9026:"7b2c34e1",9048:"f7b32154",9073:"0aeda7fd",9081:"93958511",9092:"27c9ba77",9095:"bc6d900a",9123:"06fe8e0d",9192:"0a1236f7",9262:"315c51e2",9264:"f23f2dd2",9300:"35f11ab4",9336:"c1ff0064",9415:"be12196a",9417:"0acc520e",9434:"f3da03ec",9484:"5f179bff",9486:"ff30831a",9551:"afc2bad9",9593:"1d00ddf2",9612:"d525f83d",9620:"d14a4b1b",9625:"9c355285",9630:"78440007",9647:"adea3cb6",9670:"37d43bea",9724:"bc0f4d5c",9810:"91d0046a",9818:"dd03e2d0",9858:"97f9386f",9891:"bef52506",9900:"113cc7e8",9914:"34b0b175",9943:"90714492",9999:"0e00979f"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},d="chaos-mesh-website:",r.l=(e,a,f,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(l);var d=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),d&&d.forEach((e=>e(f))),a)return a(f)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={16639819:"8618",17896441:"8401",29637022:"1199",43385197:"6367",45951754:"8003",52534247:"1375",63389418:"3595",69935607:"3662",75234536:"696",83029544:"5967",86508316:"6232",88839718:"2611",bc0eadd3:"11","104d1416":"14",c3e7c0c9:"36",b089efb6:"57",ae77e8e2:"121","02ac8add":"184","191c30c0":"185","1404d338":"246","8c78330a":"258",f759dd86:"284","217721c0":"336","12b1faf3":"343","12e8afb1":"363",d853b26e:"372",fc64b336:"406","261e8f95":"421","589bdb1e":"449",ac2bc92e:"500",de2866f0:"502","7462fa9a":"503","08af526d":"529","93eff53c":"547","06a8f81a":"566",aa5a177c:"569",abf7ef46:"576",d4b8d191:"578",cbec43f6:"579","9f09c0c4":"607","98269b50":"646","5457728b":"689",e5a3b196:"699",d3fbcd5e:"715","11eeaf94":"741",a4ee439e:"783","0c3ee269":"810",aed57c6e:"825",b516026a:"880",ea4c8659:"897","8eb0ea08":"922","99bc7767":"923",f1555dde:"956",c141421f:"957","9f0e6576":"999","8a93abd2":"1001",e671ed15:"1059","72fec000":"1094","85828edd":"1117","34d05537":"1122","85d01255":"1169","349ca830":"1196",c20650c8:"1228",a7456010:"1235","1e73a314":"1280","5233d56a":"1290",c231ae2a:"1297",fc0deac2:"1343","1147623b":"1353","2bd9a4f4":"1355",efa120a1:"1392","64db70a3":"1414","9b7cc76c":"1419","95e0ec25":"1449","42c371df":"1454",d524739c:"1473",d50e42cc:"1487",bd8b6f29:"1488",c62b7275:"1491","2a74af38":"1557",c3f65626:"1620","591059de":"1621",dd04b75e:"1672",b6f15f4b:"1675",f6e0d55d:"1734","8dc6dd8d":"1772",ecd7e5b4:"1824",b16ab538:"1841","366ada8c":"1849",fad1e435:"1858",fa551551:"1870",acecf23e:"1903","199cfc1b":"1909","5e3e1feb":"1925",dcec8022:"1928","9908821b":"2006","66463a72":"2018","0ab1f926":"2030","76776ce4":"2048",d042486d:"2059",a2188845:"2064","8ae96016":"2119","738f3c0d":"2137","1a4e3797":"2138","6828bc3e":"2162",d7ede3a0:"2192","3ebe1811":"2217",db3cf118:"2239","11b43341":"2256",e97f4c14:"2302","0a3c9d81":"2470","930c3d3d":"2532",bdb15fe9:"2537","22c99dfb":"2564","0b7a903d":"2567","804cd4d3":"2575","366fb5a9":"2593","3c03df54":"2603",c837099f:"2624",c4f5d8e4:"2634","51d6a254":"2637","9e4087bc":"2711","3fe76707":"2766",f7309d15:"2794","72e14192":"2814","3106804f":"2839",c44d6f6a:"2849","49784f7c":"2855","562c697b":"2891",a5b4bd89:"2912",d93f3ed8:"2929",eb22d371:"2941","51f60bd2":"2957",ea0178cf:"2994","8a64a7fb":"3012","6897adcd":"3019","1b232ec9":"3068","63328f1b":"3082","733580ea":"3083",b5e9f7b8:"3113","86d1f6d3":"3119","70329d25":"3129","120235e2":"3141","3c0cff8c":"3149",e91017d6:"3156","098d4173":"3157","8a5f6556":"3177","3b5985a4":"3188","2063472f":"3215","11408f98":"3236",ccc49370:"3249","529c53fa":"3277","169a7e91":"3278",fad52357:"3288",fecc65b6:"3317","8fbfdb6a":"3324",ee9abf09:"3350","7aafb598":"3382","9b6413a6":"3413","41da1ac1":"3493","7247ad55":"3498","75ba67a2":"3528","733750c7":"3530","8575fbbf":"3550","32aa1a3b":"3559",b2fca173:"3578","278c0ee7":"3580","43aabc11":"3581","7f77f4ae":"3618",b14d964f:"3627","3253b287":"3671","47be93b7":"3690","26ac8cdf":"3698","8c914af7":"3778",df0cf232:"3785","90ecb0a4":"3789",f9adc506:"3793","3955c833":"3802",b94df2e2:"3817",ad242a1d:"3854","3cf74380":"3871","22de7d29":"3872",b2eb6ad0:"3949","227412c0":"3986",bc8cb039:"4027","8ce2a1ba":"4028","01ccb5c8":"4030","4f7ce8f2":"4092",ef21a7a0:"4198","621db11d":"4212",de96c0ed:"4229",aff76f8f:"4249","891e3ffb":"4271","02489c3c":"4279",eb96136a:"4284","64a5caf2":"4311",c7d75768:"4328","8b8c00ac":"4378","261b748b":"4389","1371498d":"4430",abfcd627:"4448","3c564b32":"4461","177b2451":"4504",a93cf237:"4505",ce420c5c:"4530",bda40383:"4546",ff962926:"4673","4eaba250":"4689","59a5a33f":"4744",cc101466:"4749","62ea5d23":"4775","3f21b6c3":"4801","6875c492":"4813","9506ff33":"4825",f3cd0dc0:"4826","18b93cb3":"4828","690602ea":"4842","2f3ff69e":"4850",e84af1dc:"4853",c6691638:"4855","9317738f":"4991","84415e09":"4993","85f8d6a8":"4997","3116f78b":"5017",b3bfd067:"5039","98ddfb9b":"5117","55e6429c":"5122","4aa47776":"5124","97df2ae1":"5208","41bc510c":"5250",eecb3c77:"5269",e73d8426:"5282",d57001c7:"5284","2a5030af":"5319","4805635c":"5331","9809ed3b":"5341","52165f2d":"5352","82afff0e":"5437","07f371e9":"5439","3f767692":"5457",cc7281b7:"5522","1e7aef8f":"5558",ca94432f:"5607","194e0ab1":"5654","321751f7":"5687",f85e3b16:"5693",aba21aa0:"5742",c9a076d8:"5767","1df1f1fe":"5907","9176dd93":"5946",ec4a99a3:"6056","1f391b9e":"6061","195a936f":"6079","66ea2723":"6089",f87c5e9f:"6124",a7399dad:"6151",b5bf7bb0:"6221",f55ac880:"6239","8f3fafc4":"6254","70dc8051":"6283",da7ae84d:"6297",d5e72bf8:"6380",c143539c:"6384","42fa9ed1":"6393","3cf9319f":"6451","7ffa5dd6":"6458","18f4287e":"6476",a6cd7ee1:"6481",ce9e273a:"6492",e0508589:"6547","10870ede":"6551","90d2a8ae":"6599","9cdd8bd1":"6608",bf53dfeb:"6620","1af9c351":"6634",c35480f4:"6640","6cd4385b":"6650",f752fba7:"6663",a04bf919:"6687",da5208fe:"6688","276ad930":"6701","66d02352":"6747",e95d6e7a:"6770","99a9cca6":"6780","00760ae4":"6782","9f3a4faa":"6798",d8b1b829:"6801","549c7802":"6803","9de65543":"6840","3c9dc0dd":"6863",fcd991e7:"6913","98b5d3d8":"6964","98453b9f":"6975","64f8cf74":"6985","84a993c9":"7005",c6acdb69:"7033",e747ec83:"7051",a7bd4aaa:"7098",cee468a4:"7141","8561c1af":"7168","6e3e7ba2":"7198","5aed59f0":"7206","601d4a49":"7234","5d1a2949":"7252","242716f8":"7263",b12fc7e1:"7272",c75fb953:"7275",d4b8580c:"7301","53bc5dff":"7309","20723ffa":"7310",e33f29d2:"7369","47c9151a":"7380","923730dc":"7386",a1f9bdc4:"7397",ac0c26b1:"7403","00aa4d09":"7460","814f3328":"7472","4b8cf287":"7493","5957e61f":"7549","5273f3be":"7590","6fd76181":"7622",a6aa9e1f:"7643","3fadee21":"7650","5bc13194":"7689","3a9cfda9":"7711","3a97a91e":"7767",b60c2781:"7768","1ffdd7de":"7782","70f04d34":"7793","12c1ce9b":"7799","3af8c53c":"7803","3d960ce6":"7821",fb790a05:"7839",ee6fbbf8:"7859","9fcddf3f":"7870","058b8cb6":"7895","140701a3":"7946",e86885f1:"7955","37a47e84":"7966","53f7bbf3":"7975","73ba8788":"7993","3c1c61ff":"7998",f25d6f58:"8067",cae65014:"8106","91ef01f2":"8141","34b4b926":"8143",f7ca5716:"8167","977782a2":"8198","01a85c17":"8209","1f175bda":"8214","1dde6c1a":"8318","388245ef":"8348","879c32d4":"8395","1db64337":"8413",e4972855:"8512","4965e7cb":"8530",b8a60ade:"8596","6f8a752d":"8616",f7343d2a:"8625",a6ac4e5a:"8641",cfb5730b:"8655","617f6d79":"8685",ea70c07d:"8732",dbfc4782:"8749","338e3047":"8750",b4636e3e:"8803","9c2f3124":"8817",baaadf99:"8854",b7108862:"8857",cf98717e:"8859","6d4306e7":"8868","735a03fc":"8885","57d917f5":"8901","6b8fb093":"8903","34b4c58f":"8918","5928dda1":"8929","02a9c178":"8958",c4b334be:"8969",f491139f:"8982",d40ea7ec:"9026",a94703ab:"9048","06a15cdf":"9073","5b09dda1":"9081",b565383c:"9092",b1cabbcf:"9095",e66b200c:"9123","23b3163c":"9192","9dbf45f9":"9262","05d348c0":"9264","75fca3db":"9300","6cf1dc42":"9336",e4ec0e82:"9415","8dbd7dd1":"9417","0b1b165d":"9434",a435b217:"9484",da8ed49b:"9486",ac400e52:"9551","284bc205":"9593","5d4fa438":"9612","64000b03":"9620",c4902fbf:"9625","5e95c892":"9647","47b7279e":"9670","791dccb8":"9724","3120bb7f":"9818","36994c47":"9858","4fe280e0":"9891",fdae5fe9:"9900","41e838b4":"9914","37220d5e":"9943","94b8fb96":"9999"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,f)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)f.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var d=new Promise(((f,d)=>c=e[a]=[f,d]));f.push(c[2]=d);var b=r.p+r.u(a),t=new Error;r.l(b,(f=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var d=f&&("load"===f.type?"missing":f.type),b=f&&f.target&&f.target.src;t.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",t.name="ChunkLoadError",t.type=d,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,f)=>{var c,d,b=f[0],t=f[1],o=f[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(f);n{"use strict";var e,a,f,c,d,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var f=t[e]={exports:{}};return b[e].call(f.exports,f,f.exports,r),f.exports}r.m=b,e=[],r.O=(a,f,c,d)=>{if(!f){var b=1/0;for(i=0;i=d)&&Object.keys(r.O).every((e=>r.O[e](f[o])))?f.splice(o--,1):(t=!1,d0&&e[i-1][2]>d;i--)e[i]=e[i-1];e[i]=[f,c,d]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var d=Object.create(null);r.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(d,b),d},r.d=(e,a)=>{for(var f in a)r.o(a,f)&&!r.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,f)=>(r.f[f](e,a),a)),[])),r.u=e=>"assets/js/"+({11:"bc0eadd3",14:"104d1416",36:"c3e7c0c9",57:"b089efb6",121:"ae77e8e2",184:"02ac8add",185:"191c30c0",246:"1404d338",258:"8c78330a",284:"f759dd86",336:"217721c0",343:"12b1faf3",363:"12e8afb1",372:"d853b26e",406:"fc64b336",421:"261e8f95",449:"589bdb1e",500:"ac2bc92e",502:"de2866f0",503:"7462fa9a",529:"08af526d",547:"93eff53c",566:"06a8f81a",569:"aa5a177c",576:"abf7ef46",578:"d4b8d191",579:"cbec43f6",607:"9f09c0c4",646:"98269b50",689:"5457728b",696:"75234536",699:"e5a3b196",715:"d3fbcd5e",741:"11eeaf94",783:"a4ee439e",810:"0c3ee269",825:"aed57c6e",880:"b516026a",897:"ea4c8659",922:"8eb0ea08",923:"99bc7767",956:"f1555dde",957:"c141421f",999:"9f0e6576",1001:"8a93abd2",1059:"e671ed15",1094:"72fec000",1117:"85828edd",1122:"34d05537",1169:"85d01255",1196:"349ca830",1199:"29637022",1228:"c20650c8",1235:"a7456010",1280:"1e73a314",1290:"5233d56a",1297:"c231ae2a",1343:"fc0deac2",1353:"1147623b",1355:"2bd9a4f4",1375:"52534247",1392:"efa120a1",1414:"64db70a3",1419:"9b7cc76c",1449:"95e0ec25",1454:"42c371df",1473:"d524739c",1487:"d50e42cc",1488:"bd8b6f29",1491:"c62b7275",1557:"2a74af38",1620:"c3f65626",1621:"591059de",1672:"dd04b75e",1675:"b6f15f4b",1734:"f6e0d55d",1772:"8dc6dd8d",1824:"ecd7e5b4",1841:"b16ab538",1849:"366ada8c",1858:"fad1e435",1870:"fa551551",1903:"acecf23e",1909:"199cfc1b",1925:"5e3e1feb",1928:"dcec8022",2006:"9908821b",2018:"66463a72",2030:"0ab1f926",2048:"76776ce4",2059:"d042486d",2064:"a2188845",2119:"8ae96016",2137:"738f3c0d",2138:"1a4e3797",2162:"6828bc3e",2192:"d7ede3a0",2217:"3ebe1811",2239:"db3cf118",2256:"11b43341",2302:"e97f4c14",2470:"0a3c9d81",2532:"930c3d3d",2537:"bdb15fe9",2564:"22c99dfb",2567:"0b7a903d",2575:"804cd4d3",2593:"366fb5a9",2603:"3c03df54",2611:"88839718",2624:"c837099f",2634:"c4f5d8e4",2637:"51d6a254",2711:"9e4087bc",2766:"3fe76707",2794:"f7309d15",2814:"72e14192",2839:"3106804f",2849:"c44d6f6a",2855:"49784f7c",2891:"562c697b",2912:"a5b4bd89",2929:"d93f3ed8",2941:"eb22d371",2957:"51f60bd2",2994:"ea0178cf",3012:"8a64a7fb",3019:"6897adcd",3068:"1b232ec9",3082:"63328f1b",3083:"733580ea",3113:"b5e9f7b8",3119:"86d1f6d3",3129:"70329d25",3141:"120235e2",3149:"3c0cff8c",3156:"e91017d6",3157:"098d4173",3177:"8a5f6556",3188:"3b5985a4",3215:"2063472f",3236:"11408f98",3249:"ccc49370",3277:"529c53fa",3278:"169a7e91",3288:"fad52357",3317:"fecc65b6",3324:"8fbfdb6a",3350:"ee9abf09",3382:"7aafb598",3413:"9b6413a6",3493:"41da1ac1",3498:"7247ad55",3528:"75ba67a2",3530:"733750c7",3550:"8575fbbf",3559:"32aa1a3b",3578:"b2fca173",3580:"278c0ee7",3581:"43aabc11",3595:"63389418",3618:"7f77f4ae",3627:"b14d964f",3662:"69935607",3671:"3253b287",3690:"47be93b7",3698:"26ac8cdf",3778:"8c914af7",3785:"df0cf232",3789:"90ecb0a4",3793:"f9adc506",3802:"3955c833",3817:"b94df2e2",3854:"ad242a1d",3871:"3cf74380",3872:"22de7d29",3949:"b2eb6ad0",3986:"227412c0",4027:"bc8cb039",4028:"8ce2a1ba",4030:"01ccb5c8",4092:"4f7ce8f2",4198:"ef21a7a0",4212:"621db11d",4229:"de96c0ed",4249:"aff76f8f",4271:"891e3ffb",4279:"02489c3c",4284:"eb96136a",4311:"64a5caf2",4328:"c7d75768",4378:"8b8c00ac",4389:"261b748b",4430:"1371498d",4448:"abfcd627",4461:"3c564b32",4504:"177b2451",4505:"a93cf237",4530:"ce420c5c",4546:"bda40383",4673:"ff962926",4689:"4eaba250",4744:"59a5a33f",4749:"cc101466",4775:"62ea5d23",4801:"3f21b6c3",4813:"6875c492",4825:"9506ff33",4826:"f3cd0dc0",4828:"18b93cb3",4842:"690602ea",4850:"2f3ff69e",4853:"e84af1dc",4855:"c6691638",4991:"9317738f",4993:"84415e09",4997:"85f8d6a8",5017:"3116f78b",5039:"b3bfd067",5117:"98ddfb9b",5122:"55e6429c",5124:"4aa47776",5208:"97df2ae1",5250:"41bc510c",5269:"eecb3c77",5282:"e73d8426",5284:"d57001c7",5319:"2a5030af",5331:"4805635c",5341:"9809ed3b",5352:"52165f2d",5437:"82afff0e",5439:"07f371e9",5457:"3f767692",5522:"cc7281b7",5558:"1e7aef8f",5607:"ca94432f",5654:"194e0ab1",5687:"321751f7",5693:"f85e3b16",5742:"aba21aa0",5767:"c9a076d8",5907:"1df1f1fe",5946:"9176dd93",5967:"83029544",6056:"ec4a99a3",6061:"1f391b9e",6079:"195a936f",6089:"66ea2723",6124:"f87c5e9f",6151:"a7399dad",6221:"b5bf7bb0",6232:"86508316",6239:"f55ac880",6254:"8f3fafc4",6283:"70dc8051",6297:"da7ae84d",6367:"43385197",6380:"d5e72bf8",6384:"c143539c",6393:"42fa9ed1",6451:"3cf9319f",6458:"7ffa5dd6",6476:"18f4287e",6481:"a6cd7ee1",6492:"ce9e273a",6547:"e0508589",6551:"10870ede",6599:"90d2a8ae",6608:"9cdd8bd1",6620:"bf53dfeb",6634:"1af9c351",6640:"c35480f4",6650:"6cd4385b",6663:"f752fba7",6687:"a04bf919",6688:"da5208fe",6701:"276ad930",6747:"66d02352",6770:"e95d6e7a",6780:"99a9cca6",6782:"00760ae4",6798:"9f3a4faa",6801:"d8b1b829",6803:"549c7802",6840:"9de65543",6863:"3c9dc0dd",6913:"fcd991e7",6964:"98b5d3d8",6975:"98453b9f",6985:"64f8cf74",7005:"84a993c9",7033:"c6acdb69",7051:"e747ec83",7098:"a7bd4aaa",7141:"cee468a4",7168:"8561c1af",7198:"6e3e7ba2",7206:"5aed59f0",7234:"601d4a49",7252:"5d1a2949",7263:"242716f8",7272:"b12fc7e1",7275:"c75fb953",7301:"d4b8580c",7309:"53bc5dff",7310:"20723ffa",7369:"e33f29d2",7380:"47c9151a",7386:"923730dc",7397:"a1f9bdc4",7403:"ac0c26b1",7460:"00aa4d09",7472:"814f3328",7493:"4b8cf287",7549:"5957e61f",7590:"5273f3be",7622:"6fd76181",7643:"a6aa9e1f",7650:"3fadee21",7689:"5bc13194",7711:"3a9cfda9",7767:"3a97a91e",7768:"b60c2781",7782:"1ffdd7de",7793:"70f04d34",7799:"12c1ce9b",7803:"3af8c53c",7821:"3d960ce6",7839:"fb790a05",7859:"ee6fbbf8",7870:"9fcddf3f",7895:"058b8cb6",7946:"140701a3",7955:"e86885f1",7966:"37a47e84",7975:"53f7bbf3",7993:"73ba8788",7998:"3c1c61ff",8003:"45951754",8067:"f25d6f58",8106:"cae65014",8141:"91ef01f2",8143:"34b4b926",8167:"f7ca5716",8198:"977782a2",8209:"01a85c17",8214:"1f175bda",8318:"1dde6c1a",8348:"388245ef",8395:"879c32d4",8401:"17896441",8413:"1db64337",8512:"e4972855",8530:"4965e7cb",8596:"b8a60ade",8616:"6f8a752d",8618:"16639819",8625:"f7343d2a",8641:"a6ac4e5a",8655:"cfb5730b",8685:"617f6d79",8732:"ea70c07d",8749:"dbfc4782",8750:"338e3047",8803:"b4636e3e",8817:"9c2f3124",8854:"baaadf99",8857:"b7108862",8859:"cf98717e",8868:"6d4306e7",8885:"735a03fc",8901:"57d917f5",8903:"6b8fb093",8918:"34b4c58f",8929:"5928dda1",8958:"02a9c178",8969:"c4b334be",8982:"f491139f",9026:"d40ea7ec",9048:"a94703ab",9073:"06a15cdf",9081:"5b09dda1",9092:"b565383c",9095:"b1cabbcf",9123:"e66b200c",9192:"23b3163c",9262:"9dbf45f9",9264:"05d348c0",9300:"75fca3db",9336:"6cf1dc42",9415:"e4ec0e82",9417:"8dbd7dd1",9434:"0b1b165d",9484:"a435b217",9486:"da8ed49b",9551:"ac400e52",9593:"284bc205",9612:"5d4fa438",9620:"64000b03",9625:"c4902fbf",9647:"5e95c892",9670:"47b7279e",9724:"791dccb8",9818:"3120bb7f",9858:"36994c47",9891:"4fe280e0",9900:"fdae5fe9",9914:"41e838b4",9943:"37220d5e",9999:"94b8fb96"}[e]||e)+"."+{11:"056e1aa3",14:"560ae1f0",36:"a9e376e3",57:"51e41d69",121:"58321a97",184:"7f185f48",185:"d1da2b0a",246:"a1efee86",258:"d1804338",284:"f8039256",336:"81748210",343:"49ce19de",363:"44d1f535",372:"4a56b770",406:"f83e4c28",421:"1b211693",449:"d9c8ea66",500:"93f8feda",502:"a5642a62",503:"2612acea",529:"da2aa622",547:"03d12b8e",566:"b2c674a6",569:"f9c33358",576:"35697a81",578:"5077229f",579:"2aa1258c",607:"0b803742",646:"916dcb53",689:"12dcbc14",696:"3f2d194d",699:"65338782",715:"fa7cec18",741:"f2c76bdc",783:"823d455c",810:"b9ad3c34",825:"14587479",880:"7b2cf45a",897:"c0415969",906:"c769bfdf",922:"3ffd40a4",923:"61ed4494",956:"c8e0a41e",957:"894efbca",999:"bc7edb97",1001:"21b200dd",1059:"77dad0dc",1094:"97d871d9",1117:"980644fa",1122:"b6faf63f",1169:"e3c4d419",1196:"b8d8a21a",1199:"1ce1c60d",1228:"590503d0",1235:"bbd1fdcd",1280:"9ca55f32",1290:"3c927371",1297:"4e58fd53",1343:"4dc348e6",1353:"a40aab99",1355:"eea96b0a",1375:"3a6e37a0",1392:"d97a7b05",1414:"43a9b796",1419:"8ea1f4d7",1427:"ff7c05b4",1449:"a5e23818",1454:"30292444",1473:"878de901",1487:"d20c4a18",1488:"f8da44ff",1491:"182a8128",1557:"914cc668",1620:"b4356b4b",1621:"7f6a2eec",1672:"17f2eb6a",1675:"fcb9415c",1734:"c7e2a97b",1772:"4cb578a4",1824:"5ed269a7",1841:"255011af",1849:"b60a98a5",1858:"37ebec19",1870:"05c3eddf",1903:"819256b2",1909:"671504cd",1925:"6b888905",1928:"a8b2c40c",2006:"e2f78821",2018:"fcca4b2d",2030:"dbb72ce5",2048:"0f3da435",2059:"03186a8e",2064:"2608fa26",2119:"ef750553",2137:"14dbd111",2138:"f8c726b6",2162:"2eb6088d",2192:"10cf1e89",2217:"48533325",2239:"36ef70ab",2256:"a6adf343",2302:"a9e6529c",2470:"fe5080ae",2532:"86218fe0",2537:"69ef0660",2564:"6d2e904e",2567:"b7610143",2575:"164f4bb5",2593:"62f5a955",2603:"280c1534",2611:"72c01108",2624:"5dd75ed1",2634:"6b3ba573",2637:"849cd86a",2711:"3443aa67",2766:"bb927d91",2794:"dea33b92",2814:"376b0140",2839:"ee0d3124",2849:"4f6883d2",2855:"47fc601f",2891:"590e65bf",2912:"c8634e34",2929:"50daaec0",2941:"14a9eebe",2957:"cd83fa06",2994:"441b8204",3012:"f89cccc5",3019:"41448f44",3068:"c42a14c1",3082:"4deb18b8",3083:"8d210db5",3113:"ec72e601",3119:"5c0c4765",3129:"5e2a5308",3141:"55f86e3a",3149:"0291f342",3156:"6729cb97",3157:"a8ed62fb",3177:"12197e51",3188:"ea87de12",3215:"f9bb412d",3236:"3aab3357",3249:"a24fa909",3277:"b93f0e5d",3278:"fbf2e8ce",3288:"aa8f4134",3317:"e1249021",3324:"17dd473f",3350:"242a393e",3382:"82713f70",3413:"682fbe01",3493:"0c9b8d99",3498:"b4f79634",3528:"506bf132",3530:"7952b4a9",3550:"3bbb6c85",3559:"18fad00f",3578:"3b6597a1",3580:"51324d98",3581:"8243eb8e",3595:"1d742e95",3618:"d25afdcd",3627:"be35c3ea",3662:"8b450dc9",3671:"77cbc9d7",3690:"cc5afd08",3698:"72f6c0ff",3778:"dc87d5f4",3785:"ece8438d",3789:"ae061c76",3793:"51b6b56a",3802:"80fc8ecb",3817:"49aa5e5d",3854:"d8f14d04",3871:"609cf8e1",3872:"5fefd23a",3949:"e6517557",3986:"3a7e963b",4027:"89ce31a2",4028:"7c5ef570",4030:"0c1f4fce",4092:"3e030ce2",4147:"69c75c01",4198:"b88f7ae6",4212:"d0a498fb",4229:"90de3aec",4249:"e83f9cd9",4271:"fe540b38",4279:"070cb2bd",4284:"9eed290c",4311:"1ca274de",4328:"e598c5af",4378:"7ecdf19e",4389:"8aaa64fa",4430:"171d4488",4448:"ce494cb8",4461:"5e474d57",4504:"a57f13d9",4505:"0c4384e5",4530:"1d8a625e",4546:"8efb3d1f",4673:"016fc4de",4689:"b4346e33",4744:"2fff19df",4749:"d7f04b36",4775:"313a32d0",4801:"fa2c9cdf",4813:"be00cc3f",4825:"acf3a6be",4826:"e0b84659",4828:"adad864a",4842:"5fc08a6c",4850:"f5b93018",4853:"23a0ff3c",4855:"137a0752",4991:"640bbe3b",4993:"a4823a30",4997:"fc451fad",5017:"7182acc4",5039:"ceace99f",5117:"80e6a4b2",5122:"4151bb09",5124:"dc8fd971",5208:"70e6c486",5250:"337e52fd",5269:"2acc106c",5282:"d56fa4c7",5284:"109334bc",5319:"68dc014a",5331:"0675fab6",5341:"ee88300e",5352:"311cbce8",5437:"9382a734",5439:"264e0191",5457:"971d3b72",5522:"006aec98",5558:"b31d663a",5607:"ee175ffd",5654:"55422036",5687:"a7741f89",5693:"9ef6295f",5742:"7b7a851a",5767:"2a3f97a8",5856:"6ab87fd5",5907:"b6f4c410",5931:"9bc52efa",5946:"fa395ef0",5967:"7f926130",6056:"9782752b",6061:"3a63d7ef",6079:"b09d94da",6089:"4774df8e",6124:"81249466",6151:"ee981ef7",6221:"6ae751df",6232:"0d67693f",6239:"f064343b",6254:"91fe7f18",6283:"46eaedd6",6297:"feae61d1",6367:"a24c3a13",6380:"0ae74957",6384:"0a08ab3a",6393:"766a20a7",6451:"2e7c3403",6458:"6a8c36a0",6476:"22587494",6481:"bee0db36",6492:"216be2da",6547:"87880677",6551:"a3924ea1",6599:"01a82b4e",6608:"6e312da0",6620:"088497a4",6634:"bd3734e7",6640:"13f04309",6650:"417b0114",6663:"1f1aa101",6687:"25a520db",6688:"01367dfd",6701:"5360bddf",6747:"bb93fa24",6770:"08cd63bd",6780:"a633737c",6782:"4e75f68c",6798:"a91f1d80",6801:"feaa304a",6803:"569c3435",6840:"1bbc9593",6863:"56c0cccf",6871:"e1e6cc7a",6913:"77f7c9a6",6964:"92ca1af7",6975:"e481434d",6985:"45a34543",7005:"edba43de",7033:"2b8f414d",7051:"94131c51",7079:"ab6cdf83",7098:"da81382c",7141:"cae79bc9",7168:"ad1db94c",7198:"f7f11f3e",7206:"d8dd45cd",7234:"2443b106",7252:"8f85075b",7263:"c329941d",7272:"99ed4e65",7275:"06b7b809",7301:"c909bc3c",7309:"811e05a6",7310:"80ee5a6e",7369:"1c210c3b",7380:"c05dbac9",7386:"0e9b27dd",7397:"9ed148ad",7403:"512d2661",7460:"12a0bbcc",7472:"8637f5fd",7493:"16fb75db",7549:"5253e8ab",7590:"dd18e1e5",7622:"3c250288",7643:"683d59a3",7650:"4d769d2b",7689:"ff7a60d4",7711:"3072f253",7767:"20e5f500",7768:"28c8fa79",7782:"1f54af8b",7793:"d2ca0803",7799:"89e114a9",7803:"1b7dd9c1",7821:"8a1cc7bc",7839:"7f8c4ca7",7859:"456c5e6c",7870:"e1750dc6",7895:"4f395509",7946:"fceb65a1",7955:"7339d991",7966:"de36f6ab",7975:"fc8479f4",7993:"68e69870",7998:"2c8ebdaf",8003:"0cc42937",8067:"b6279740",8106:"b0f4f742",8141:"c8754346",8143:"094417a8",8167:"27daba3e",8198:"133eb61f",8209:"0b6e9596",8214:"613228d5",8318:"ab5137c7",8348:"8c4d27d4",8395:"a12d9de0",8401:"21fd4831",8413:"67468e01",8512:"6d78c2a0",8530:"a8972dd3",8596:"3e4441e4",8616:"2a0cf43e",8618:"ea2e6184",8625:"19882c2a",8641:"4c03093f",8655:"f207fea4",8685:"d7324548",8732:"68b3ee5c",8749:"98710ebd",8750:"decc8406",8803:"057fe311",8817:"1acdc719",8854:"871e76a6",8857:"55340cfd",8859:"677f1ba1",8868:"44bb9440",8885:"0690dbd8",8901:"bb066c65",8903:"b57911e3",8918:"3ecd8305",8929:"5940d4d6",8958:"4490dfd0",8969:"3fa48599",8982:"3fabc0ed",9026:"7b2c34e1",9048:"f7b32154",9073:"65afaa9c",9081:"93958511",9092:"27c9ba77",9095:"bc6d900a",9123:"06fe8e0d",9192:"0a1236f7",9262:"315c51e2",9264:"f23f2dd2",9300:"35f11ab4",9336:"c1ff0064",9415:"be12196a",9417:"0acc520e",9434:"f3da03ec",9484:"5f179bff",9486:"ff30831a",9551:"c663705e",9593:"1d00ddf2",9612:"d525f83d",9620:"d14a4b1b",9625:"9c355285",9630:"78440007",9647:"adea3cb6",9670:"37d43bea",9724:"bc0f4d5c",9810:"91d0046a",9818:"dd03e2d0",9858:"97f9386f",9891:"bef52506",9900:"113cc7e8",9914:"34b0b175",9943:"90714492",9999:"0e00979f"}[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},d="chaos-mesh-website:",r.l=(e,a,f,b)=>{if(c[e])c[e].push(a);else{var t,o;if(void 0!==f)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(l);var d=c[e];if(delete c[e],t.parentNode&&t.parentNode.removeChild(t),d&&d.forEach((e=>e(f))),a)return a(f)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",r.gca=function(e){return e={16639819:"8618",17896441:"8401",29637022:"1199",43385197:"6367",45951754:"8003",52534247:"1375",63389418:"3595",69935607:"3662",75234536:"696",83029544:"5967",86508316:"6232",88839718:"2611",bc0eadd3:"11","104d1416":"14",c3e7c0c9:"36",b089efb6:"57",ae77e8e2:"121","02ac8add":"184","191c30c0":"185","1404d338":"246","8c78330a":"258",f759dd86:"284","217721c0":"336","12b1faf3":"343","12e8afb1":"363",d853b26e:"372",fc64b336:"406","261e8f95":"421","589bdb1e":"449",ac2bc92e:"500",de2866f0:"502","7462fa9a":"503","08af526d":"529","93eff53c":"547","06a8f81a":"566",aa5a177c:"569",abf7ef46:"576",d4b8d191:"578",cbec43f6:"579","9f09c0c4":"607","98269b50":"646","5457728b":"689",e5a3b196:"699",d3fbcd5e:"715","11eeaf94":"741",a4ee439e:"783","0c3ee269":"810",aed57c6e:"825",b516026a:"880",ea4c8659:"897","8eb0ea08":"922","99bc7767":"923",f1555dde:"956",c141421f:"957","9f0e6576":"999","8a93abd2":"1001",e671ed15:"1059","72fec000":"1094","85828edd":"1117","34d05537":"1122","85d01255":"1169","349ca830":"1196",c20650c8:"1228",a7456010:"1235","1e73a314":"1280","5233d56a":"1290",c231ae2a:"1297",fc0deac2:"1343","1147623b":"1353","2bd9a4f4":"1355",efa120a1:"1392","64db70a3":"1414","9b7cc76c":"1419","95e0ec25":"1449","42c371df":"1454",d524739c:"1473",d50e42cc:"1487",bd8b6f29:"1488",c62b7275:"1491","2a74af38":"1557",c3f65626:"1620","591059de":"1621",dd04b75e:"1672",b6f15f4b:"1675",f6e0d55d:"1734","8dc6dd8d":"1772",ecd7e5b4:"1824",b16ab538:"1841","366ada8c":"1849",fad1e435:"1858",fa551551:"1870",acecf23e:"1903","199cfc1b":"1909","5e3e1feb":"1925",dcec8022:"1928","9908821b":"2006","66463a72":"2018","0ab1f926":"2030","76776ce4":"2048",d042486d:"2059",a2188845:"2064","8ae96016":"2119","738f3c0d":"2137","1a4e3797":"2138","6828bc3e":"2162",d7ede3a0:"2192","3ebe1811":"2217",db3cf118:"2239","11b43341":"2256",e97f4c14:"2302","0a3c9d81":"2470","930c3d3d":"2532",bdb15fe9:"2537","22c99dfb":"2564","0b7a903d":"2567","804cd4d3":"2575","366fb5a9":"2593","3c03df54":"2603",c837099f:"2624",c4f5d8e4:"2634","51d6a254":"2637","9e4087bc":"2711","3fe76707":"2766",f7309d15:"2794","72e14192":"2814","3106804f":"2839",c44d6f6a:"2849","49784f7c":"2855","562c697b":"2891",a5b4bd89:"2912",d93f3ed8:"2929",eb22d371:"2941","51f60bd2":"2957",ea0178cf:"2994","8a64a7fb":"3012","6897adcd":"3019","1b232ec9":"3068","63328f1b":"3082","733580ea":"3083",b5e9f7b8:"3113","86d1f6d3":"3119","70329d25":"3129","120235e2":"3141","3c0cff8c":"3149",e91017d6:"3156","098d4173":"3157","8a5f6556":"3177","3b5985a4":"3188","2063472f":"3215","11408f98":"3236",ccc49370:"3249","529c53fa":"3277","169a7e91":"3278",fad52357:"3288",fecc65b6:"3317","8fbfdb6a":"3324",ee9abf09:"3350","7aafb598":"3382","9b6413a6":"3413","41da1ac1":"3493","7247ad55":"3498","75ba67a2":"3528","733750c7":"3530","8575fbbf":"3550","32aa1a3b":"3559",b2fca173:"3578","278c0ee7":"3580","43aabc11":"3581","7f77f4ae":"3618",b14d964f:"3627","3253b287":"3671","47be93b7":"3690","26ac8cdf":"3698","8c914af7":"3778",df0cf232:"3785","90ecb0a4":"3789",f9adc506:"3793","3955c833":"3802",b94df2e2:"3817",ad242a1d:"3854","3cf74380":"3871","22de7d29":"3872",b2eb6ad0:"3949","227412c0":"3986",bc8cb039:"4027","8ce2a1ba":"4028","01ccb5c8":"4030","4f7ce8f2":"4092",ef21a7a0:"4198","621db11d":"4212",de96c0ed:"4229",aff76f8f:"4249","891e3ffb":"4271","02489c3c":"4279",eb96136a:"4284","64a5caf2":"4311",c7d75768:"4328","8b8c00ac":"4378","261b748b":"4389","1371498d":"4430",abfcd627:"4448","3c564b32":"4461","177b2451":"4504",a93cf237:"4505",ce420c5c:"4530",bda40383:"4546",ff962926:"4673","4eaba250":"4689","59a5a33f":"4744",cc101466:"4749","62ea5d23":"4775","3f21b6c3":"4801","6875c492":"4813","9506ff33":"4825",f3cd0dc0:"4826","18b93cb3":"4828","690602ea":"4842","2f3ff69e":"4850",e84af1dc:"4853",c6691638:"4855","9317738f":"4991","84415e09":"4993","85f8d6a8":"4997","3116f78b":"5017",b3bfd067:"5039","98ddfb9b":"5117","55e6429c":"5122","4aa47776":"5124","97df2ae1":"5208","41bc510c":"5250",eecb3c77:"5269",e73d8426:"5282",d57001c7:"5284","2a5030af":"5319","4805635c":"5331","9809ed3b":"5341","52165f2d":"5352","82afff0e":"5437","07f371e9":"5439","3f767692":"5457",cc7281b7:"5522","1e7aef8f":"5558",ca94432f:"5607","194e0ab1":"5654","321751f7":"5687",f85e3b16:"5693",aba21aa0:"5742",c9a076d8:"5767","1df1f1fe":"5907","9176dd93":"5946",ec4a99a3:"6056","1f391b9e":"6061","195a936f":"6079","66ea2723":"6089",f87c5e9f:"6124",a7399dad:"6151",b5bf7bb0:"6221",f55ac880:"6239","8f3fafc4":"6254","70dc8051":"6283",da7ae84d:"6297",d5e72bf8:"6380",c143539c:"6384","42fa9ed1":"6393","3cf9319f":"6451","7ffa5dd6":"6458","18f4287e":"6476",a6cd7ee1:"6481",ce9e273a:"6492",e0508589:"6547","10870ede":"6551","90d2a8ae":"6599","9cdd8bd1":"6608",bf53dfeb:"6620","1af9c351":"6634",c35480f4:"6640","6cd4385b":"6650",f752fba7:"6663",a04bf919:"6687",da5208fe:"6688","276ad930":"6701","66d02352":"6747",e95d6e7a:"6770","99a9cca6":"6780","00760ae4":"6782","9f3a4faa":"6798",d8b1b829:"6801","549c7802":"6803","9de65543":"6840","3c9dc0dd":"6863",fcd991e7:"6913","98b5d3d8":"6964","98453b9f":"6975","64f8cf74":"6985","84a993c9":"7005",c6acdb69:"7033",e747ec83:"7051",a7bd4aaa:"7098",cee468a4:"7141","8561c1af":"7168","6e3e7ba2":"7198","5aed59f0":"7206","601d4a49":"7234","5d1a2949":"7252","242716f8":"7263",b12fc7e1:"7272",c75fb953:"7275",d4b8580c:"7301","53bc5dff":"7309","20723ffa":"7310",e33f29d2:"7369","47c9151a":"7380","923730dc":"7386",a1f9bdc4:"7397",ac0c26b1:"7403","00aa4d09":"7460","814f3328":"7472","4b8cf287":"7493","5957e61f":"7549","5273f3be":"7590","6fd76181":"7622",a6aa9e1f:"7643","3fadee21":"7650","5bc13194":"7689","3a9cfda9":"7711","3a97a91e":"7767",b60c2781:"7768","1ffdd7de":"7782","70f04d34":"7793","12c1ce9b":"7799","3af8c53c":"7803","3d960ce6":"7821",fb790a05:"7839",ee6fbbf8:"7859","9fcddf3f":"7870","058b8cb6":"7895","140701a3":"7946",e86885f1:"7955","37a47e84":"7966","53f7bbf3":"7975","73ba8788":"7993","3c1c61ff":"7998",f25d6f58:"8067",cae65014:"8106","91ef01f2":"8141","34b4b926":"8143",f7ca5716:"8167","977782a2":"8198","01a85c17":"8209","1f175bda":"8214","1dde6c1a":"8318","388245ef":"8348","879c32d4":"8395","1db64337":"8413",e4972855:"8512","4965e7cb":"8530",b8a60ade:"8596","6f8a752d":"8616",f7343d2a:"8625",a6ac4e5a:"8641",cfb5730b:"8655","617f6d79":"8685",ea70c07d:"8732",dbfc4782:"8749","338e3047":"8750",b4636e3e:"8803","9c2f3124":"8817",baaadf99:"8854",b7108862:"8857",cf98717e:"8859","6d4306e7":"8868","735a03fc":"8885","57d917f5":"8901","6b8fb093":"8903","34b4c58f":"8918","5928dda1":"8929","02a9c178":"8958",c4b334be:"8969",f491139f:"8982",d40ea7ec:"9026",a94703ab:"9048","06a15cdf":"9073","5b09dda1":"9081",b565383c:"9092",b1cabbcf:"9095",e66b200c:"9123","23b3163c":"9192","9dbf45f9":"9262","05d348c0":"9264","75fca3db":"9300","6cf1dc42":"9336",e4ec0e82:"9415","8dbd7dd1":"9417","0b1b165d":"9434",a435b217:"9484",da8ed49b:"9486",ac400e52:"9551","284bc205":"9593","5d4fa438":"9612","64000b03":"9620",c4902fbf:"9625","5e95c892":"9647","47b7279e":"9670","791dccb8":"9724","3120bb7f":"9818","36994c47":"9858","4fe280e0":"9891",fdae5fe9:"9900","41e838b4":"9914","37220d5e":"9943","94b8fb96":"9999"}[e]||e,r.p+r.u(e)},(()=>{var e={5354:0,1869:0};r.f.j=(a,f)=>{var c=r.o(e,a)?e[a]:void 0;if(0!==c)if(c)f.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var d=new Promise(((f,d)=>c=e[a]=[f,d]));f.push(c[2]=d);var b=r.p+r.u(a),t=new Error;r.l(b,(f=>{if(r.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var d=f&&("load"===f.type?"missing":f.type),b=f&&f.target&&f.target.src;t.message="Loading chunk "+a+" failed.\n("+d+": "+b+")",t.name="ChunkLoadError",t.type=d,t.request=b,c[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,f)=>{var c,d,b=f[0],t=f[1],o=f[2],n=0;if(b.some((a=>0!==e[a]))){for(c in t)r.o(t,c)&&(r.m[c]=t[c]);if(o)var i=o(r)}for(a&&a(f);n - + diff --git a/blog/Securing-Online-Gaming-Combine-Chaos-Engineering-with-DevOps-Practices/index.html b/blog/Securing-Online-Gaming-Combine-Chaos-Engineering-with-DevOps-Practices/index.html index 09bf4cd209..5192ad3b75 100644 --- a/blog/Securing-Online-Gaming-Combine-Chaos-Engineering-with-DevOps-Practices/index.html +++ b/blog/Securing-Online-Gaming-Combine-Chaos-Engineering-with-DevOps-Practices/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/archive/index.html b/blog/archive/index.html index ea3862c160..28e7ff8e67 100644 --- a/blog/archive/index.html +++ b/blog/archive/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/authors/index.html b/blog/authors/index.html index c6734341f9..3c61952d04 100644 --- a/blog/authors/index.html +++ b/blog/authors/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/better-observability-for-chaos-engineering/index.html b/blog/better-observability-for-chaos-engineering/index.html index fb26589266..887384158a 100644 --- a/blog/better-observability-for-chaos-engineering/index.html +++ b/blog/better-observability-for-chaos-engineering/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/building_automated_testing_framework/index.html b/blog/building_automated_testing_framework/index.html index f0bba3c1e0..ef53a734a3 100644 --- a/blog/building_automated_testing_framework/index.html +++ b/blog/building_automated_testing_framework/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/celebrating-one-year-of-chaos-mesh-looking-back-and-ahead/index.html b/blog/celebrating-one-year-of-chaos-mesh-looking-back-and-ahead/index.html index e104adb8ff..0a1bfd9dbc 100644 --- a/blog/celebrating-one-year-of-chaos-mesh-looking-back-and-ahead/index.html +++ b/blog/celebrating-one-year-of-chaos-mesh-looking-back-and-ahead/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-engineering-breaking-things-intentionally/index.html b/blog/chaos-engineering-breaking-things-intentionally/index.html index 9c83135ac4..e54f2f8687 100644 --- a/blog/chaos-engineering-breaking-things-intentionally/index.html +++ b/blog/chaos-engineering-breaking-things-intentionally/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-1.0-chaos-engineering-on-kubernetes-made-easier/index.html b/blog/chaos-mesh-1.0-chaos-engineering-on-kubernetes-made-easier/index.html index 01dabe6bdf..458d83996c 100644 --- a/blog/chaos-mesh-1.0-chaos-engineering-on-kubernetes-made-easier/index.html +++ b/blog/chaos-mesh-1.0-chaos-engineering-on-kubernetes-made-easier/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-2.0-to-a-chaos-engineering-ecology/index.html b/blog/chaos-mesh-2.0-to-a-chaos-engineering-ecology/index.html index 27827067d4..08504f028c 100644 --- a/blog/chaos-mesh-2.0-to-a-chaos-engineering-ecology/index.html +++ b/blog/chaos-mesh-2.0-to-a-chaos-engineering-ecology/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-action-integrate-chaos-engineering-into-your-ci/index.html b/blog/chaos-mesh-action-integrate-chaos-engineering-into-your-ci/index.html index 1318062882..1c33fccc84 100644 --- a/blog/chaos-mesh-action-integrate-chaos-engineering-into-your-ci/index.html +++ b/blog/chaos-mesh-action-integrate-chaos-engineering-into-your-ci/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-celebrates-100th-contributor/index.html b/blog/chaos-mesh-celebrates-100th-contributor/index.html index f806b3a256..cb7311d890 100644 --- a/blog/chaos-mesh-celebrates-100th-contributor/index.html +++ b/blog/chaos-mesh-celebrates-100th-contributor/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-hacktoberfest-2021/index.html b/blog/chaos-mesh-hacktoberfest-2021/index.html index 7ea8f54d06..3732d46396 100644 --- a/blog/chaos-mesh-hacktoberfest-2021/index.html +++ b/blog/chaos-mesh-hacktoberfest-2021/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-join-cncf-sandbox-project/index.html b/blog/chaos-mesh-join-cncf-sandbox-project/index.html index d18c63e47b..8ca74f0431 100644 --- a/blog/chaos-mesh-join-cncf-sandbox-project/index.html +++ b/blog/chaos-mesh-join-cncf-sandbox-project/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-q&a/index.html b/blog/chaos-mesh-q&a/index.html index b76de21f46..dbbf31c992 100644 --- a/blog/chaos-mesh-q&a/index.html +++ b/blog/chaos-mesh-q&a/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-qa-at-kubecon-eu-2022/index.html b/blog/chaos-mesh-qa-at-kubecon-eu-2022/index.html index e22827f2a8..b1528c853d 100644 --- a/blog/chaos-mesh-qa-at-kubecon-eu-2022/index.html +++ b/blog/chaos-mesh-qa-at-kubecon-eu-2022/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-remake-one-step-closer-towards-chaos-as-a-service/index.html b/blog/chaos-mesh-remake-one-step-closer-towards-chaos-as-a-service/index.html index 10d32953dd..858be37e45 100644 --- a/blog/chaos-mesh-remake-one-step-closer-towards-chaos-as-a-service/index.html +++ b/blog/chaos-mesh-remake-one-step-closer-towards-chaos-as-a-service/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos-mesh-x-hacktoberfest-2020/index.html b/blog/chaos-mesh-x-hacktoberfest-2020/index.html index 4e9c69380f..61849e3c71 100644 --- a/blog/chaos-mesh-x-hacktoberfest-2020/index.html +++ b/blog/chaos-mesh-x-hacktoberfest-2020/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/chaos_mesh_your_chaos_engineering_solution/index.html b/blog/chaos_mesh_your_chaos_engineering_solution/index.html index b48ba9d269..a3a613e483 100644 --- a/blog/chaos_mesh_your_chaos_engineering_solution/index.html +++ b/blog/chaos_mesh_your_chaos_engineering_solution/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/deploy-chaos-mesh-on-kubesphere/index.html b/blog/deploy-chaos-mesh-on-kubesphere/index.html index c1d5e6fbb4..54b8ef2488 100644 --- a/blog/deploy-chaos-mesh-on-kubesphere/index.html +++ b/blog/deploy-chaos-mesh-on-kubesphere/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/develop-a-daily-reporting-system/index.html b/blog/develop-a-daily-reporting-system/index.html index 8613755d29..a30699ceb0 100644 --- a/blog/develop-a-daily-reporting-system/index.html +++ b/blog/develop-a-daily-reporting-system/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/experience-as-a-chaos-mesh-lfx-mentee/index.html b/blog/experience-as-a-chaos-mesh-lfx-mentee/index.html index c8052d9ea6..2d4f8fe850 100644 --- a/blog/experience-as-a-chaos-mesh-lfx-mentee/index.html +++ b/blog/experience-as-a-chaos-mesh-lfx-mentee/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/how-a-top-game-company-uses-chaos-engineering-to-improve-testing/index.html b/blog/how-a-top-game-company-uses-chaos-engineering-to-improve-testing/index.html index d9bb157028..a15684c307 100644 --- a/blog/how-a-top-game-company-uses-chaos-engineering-to-improve-testing/index.html +++ b/blog/how-a-top-game-company-uses-chaos-engineering-to-improve-testing/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/how-to-efficiently-stress-test-pod-memory/index.html b/blog/how-to-efficiently-stress-test-pod-memory/index.html index 061c31c738..f017ad1cf4 100644 --- a/blog/how-to-efficiently-stress-test-pod-memory/index.html +++ b/blog/how-to-efficiently-stress-test-pod-memory/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/how-to-simulate-io-faults-at-runtime/index.html b/blog/how-to-simulate-io-faults-at-runtime/index.html index e06eabca14..c49aa7d13f 100644 --- a/blog/how-to-simulate-io-faults-at-runtime/index.html +++ b/blog/how-to-simulate-io-faults-at-runtime/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/implement-chaos-engineering-in-k8s/index.html b/blog/implement-chaos-engineering-in-k8s/index.html index d0b898969f..98189ab2d8 100644 --- a/blog/implement-chaos-engineering-in-k8s/index.html +++ b/blog/implement-chaos-engineering-in-k8s/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/index.html b/blog/index.html index 3a27dc2b26..9c8d1c68de 100644 --- a/blog/index.html +++ b/blog/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/lfx-mentorship-enriching-awschaos/index.html b/blog/lfx-mentorship-enriching-awschaos/index.html index ef7fb2d8bd..464b46ce2d 100644 --- a/blog/lfx-mentorship-enriching-awschaos/index.html +++ b/blog/lfx-mentorship-enriching-awschaos/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/page/2/index.html b/blog/page/2/index.html index 4e4218736b..60f6589284 100644 --- a/blog/page/2/index.html +++ b/blog/page/2/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/page/3/index.html b/blog/page/3/index.html index 61b0d95949..d0eae1c124 100644 --- a/blog/page/3/index.html +++ b/blog/page/3/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/run-chaos-experiments-on-physical-machines/index.html b/blog/run-chaos-experiments-on-physical-machines/index.html index ab1c7c6916..728230f9cf 100644 --- a/blog/run-chaos-experiments-on-physical-machines/index.html +++ b/blog/run-chaos-experiments-on-physical-machines/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/run_your_first_chaos_experiment/index.html b/blog/run_your_first_chaos_experiment/index.html index d94177ef15..cefe3e32d6 100644 --- a/blog/run_your_first_chaos_experiment/index.html +++ b/blog/run_your_first_chaos_experiment/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/securing-tenant-namespaces-using-restrict-authorization-feature/index.html b/blog/securing-tenant-namespaces-using-restrict-authorization-feature/index.html index 405376e1f1..a5d688322f 100644 --- a/blog/securing-tenant-namespaces-using-restrict-authorization-feature/index.html +++ b/blog/securing-tenant-namespaces-using-restrict-authorization-feature/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/share-your-chaos-mesh-story/index.html b/blog/share-your-chaos-mesh-story/index.html index 4971985ccf..7da6dfa243 100644 --- a/blog/share-your-chaos-mesh-story/index.html +++ b/blog/share-your-chaos-mesh-story/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/simulating-clock-skew-in-k8s-without-affecting-other-containers-on-node/index.html b/blog/simulating-clock-skew-in-k8s-without-affecting-other-containers-on-node/index.html index 2930cca73d..a6f94d4a28 100644 --- a/blog/simulating-clock-skew-in-k8s-without-affecting-other-containers-on-node/index.html +++ b/blog/simulating-clock-skew-in-k8s-without-affecting-other-containers-on-node/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/announcement/index.html b/blog/tags/announcement/index.html index 7450634ff4..3a870371b3 100644 --- a/blog/tags/announcement/index.html +++ b/blog/tags/announcement/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/aws-chaos/index.html b/blog/tags/aws-chaos/index.html index 7ad3481361..cdac5e9dcf 100644 --- a/blog/tags/aws-chaos/index.html +++ b/blog/tags/aws-chaos/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaos-engineering/index.html b/blog/tags/chaos-engineering/index.html index ab9abdc90d..ff35b2e4f3 100644 --- a/blog/tags/chaos-engineering/index.html +++ b/blog/tags/chaos-engineering/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaos-engineering/page/2/index.html b/blog/tags/chaos-engineering/page/2/index.html index 079d4975e3..7f4554bf58 100644 --- a/blog/tags/chaos-engineering/page/2/index.html +++ b/blog/tags/chaos-engineering/page/2/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaos-engineering/page/3/index.html b/blog/tags/chaos-engineering/page/3/index.html index 8bbd6add25..5b793476f2 100644 --- a/blog/tags/chaos-engineering/page/3/index.html +++ b/blog/tags/chaos-engineering/page/3/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaos-mesh/index.html b/blog/tags/chaos-mesh/index.html index 71e1a25cac..93c3ae1394 100644 --- a/blog/tags/chaos-mesh/index.html +++ b/blog/tags/chaos-mesh/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaos-mesh/page/2/index.html b/blog/tags/chaos-mesh/page/2/index.html index 2ea2110579..21ec3f239b 100644 --- a/blog/tags/chaos-mesh/page/2/index.html +++ b/blog/tags/chaos-mesh/page/2/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaos-mesh/page/3/index.html b/blog/tags/chaos-mesh/page/3/index.html index 8481f66ae1..333ea49187 100644 --- a/blog/tags/chaos-mesh/page/3/index.html +++ b/blog/tags/chaos-mesh/page/3/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/chaosd/index.html b/blog/tags/chaosd/index.html index ed1a18275d..096f5fccde 100644 --- a/blog/tags/chaosd/index.html +++ b/blog/tags/chaosd/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/ci/index.html b/blog/tags/ci/index.html index 338b174566..21271cca8e 100644 --- a/blog/tags/ci/index.html +++ b/blog/tags/ci/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/cloud-native-con/index.html b/blog/tags/cloud-native-con/index.html index 9a0b54c900..6e69f71aaa 100644 --- a/blog/tags/cloud-native-con/index.html +++ b/blog/tags/cloud-native-con/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/cloud-native/index.html b/blog/tags/cloud-native/index.html index f37a033bbe..0eef56e34d 100644 --- a/blog/tags/cloud-native/index.html +++ b/blog/tags/cloud-native/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/cncf/index.html b/blog/tags/cncf/index.html index 65bb9d0603..45e33b73e4 100644 --- a/blog/tags/cncf/index.html +++ b/blog/tags/cncf/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/community/index.html b/blog/tags/community/index.html index 626eb83399..f7a1dc9af6 100644 --- a/blog/tags/community/index.html +++ b/blog/tags/community/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/distributed-system/index.html b/blog/tags/distributed-system/index.html index 6b5c3379fe..a43040a30a 100644 --- a/blog/tags/distributed-system/index.html +++ b/blog/tags/distributed-system/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/fault-injection/index.html b/blog/tags/fault-injection/index.html index 9a448ccdf4..338622a089 100644 --- a/blog/tags/fault-injection/index.html +++ b/blog/tags/fault-injection/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/git-hub-actions/index.html b/blog/tags/git-hub-actions/index.html index a53533bdd6..cd32df0216 100644 --- a/blog/tags/git-hub-actions/index.html +++ b/blog/tags/git-hub-actions/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/index.html b/blog/tags/index.html index 76d830f901..937ddec75d 100644 --- a/blog/tags/index.html +++ b/blog/tags/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/kube-con/index.html b/blog/tags/kube-con/index.html index a4d6d78dd0..561e2372ae 100644 --- a/blog/tags/kube-con/index.html +++ b/blog/tags/kube-con/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/kubernetes/index.html b/blog/tags/kubernetes/index.html index 9571e64caa..968d3cbbe2 100644 --- a/blog/tags/kubernetes/index.html +++ b/blog/tags/kubernetes/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/lfx-mentorship/index.html b/blog/tags/lfx-mentorship/index.html index b742ec6ec6..ec0773fa53 100644 --- a/blog/tags/lfx-mentorship/index.html +++ b/blog/tags/lfx-mentorship/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/monitoring-metrics/index.html b/blog/tags/monitoring-metrics/index.html index 1438fb6d19..df57458d07 100644 --- a/blog/tags/monitoring-metrics/index.html +++ b/blog/tags/monitoring-metrics/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/open-source/index.html b/blog/tags/open-source/index.html index a067356390..cdb46c3f5a 100644 --- a/blog/tags/open-source/index.html +++ b/blog/tags/open-source/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/stress-chaos/index.html b/blog/tags/stress-chaos/index.html index 6c44265951..9048bf1b01 100644 --- a/blog/tags/stress-chaos/index.html +++ b/blog/tags/stress-chaos/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/stress-testing/index.html b/blog/tags/stress-testing/index.html index 9585f6d1e7..16ad0cf726 100644 --- a/blog/tags/stress-testing/index.html +++ b/blog/tags/stress-testing/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/test-automation/index.html b/blog/tags/test-automation/index.html index ee2cabd359..ad7694ed33 100644 --- a/blog/tags/test-automation/index.html +++ b/blog/tags/test-automation/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/tutorials/index.html b/blog/tags/tutorials/index.html index c7677bb213..fb73a495bd 100644 --- a/blog/tags/tutorials/index.html +++ b/blog/tags/tutorials/index.html @@ -16,7 +16,7 @@ - + diff --git a/blog/tags/use-cases/index.html b/blog/tags/use-cases/index.html index 4b73fc444a..193f21269b 100644 --- a/blog/tags/use-cases/index.html +++ b/blog/tags/use-cases/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/add-new-chaos-experiment-type/index.html b/docs/2.4.3/add-new-chaos-experiment-type/index.html index e3c0ec4a2d..3f52db57e4 100644 --- a/docs/2.4.3/add-new-chaos-experiment-type/index.html +++ b/docs/2.4.3/add-new-chaos-experiment-type/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/basic-features/index.html b/docs/2.4.3/basic-features/index.html index 382928a3fb..f91130c399 100644 --- a/docs/2.4.3/basic-features/index.html +++ b/docs/2.4.3/basic-features/index.html @@ -16,7 +16,7 @@ - + @@ -26,7 +26,7 @@

Fault
  • Basic resource faults:
      -
    • PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod.
    • +
    • PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailability, and certain container failures in a specific Pod.
    • NetworkChaos: simulates network failures, such as network latency, packet loss, packet disorder, and network partitions.
    • DNSChaos: simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned.
    • HTTPChaos: simulates HTTP communication failures, such as HTTP communication latency.
    • diff --git a/docs/2.4.3/chaos-engineering-principles/index.html b/docs/2.4.3/chaos-engineering-principles/index.html index 3c10b38531..a42bf0d621 100644 --- a/docs/2.4.3/chaos-engineering-principles/index.html +++ b/docs/2.4.3/chaos-engineering-principles/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/chaosctl-tool/index.html b/docs/2.4.3/chaosctl-tool/index.html index 683e84b292..59c120652c 100644 --- a/docs/2.4.3/chaosctl-tool/index.html +++ b/docs/2.4.3/chaosctl-tool/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/chaosd-overview/index.html b/docs/2.4.3/chaosd-overview/index.html index 27b1957697..d2a943b4db 100644 --- a/docs/2.4.3/chaosd-overview/index.html +++ b/docs/2.4.3/chaosd-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/chaosd-search-recover/index.html b/docs/2.4.3/chaosd-search-recover/index.html index 3fe4e6c15d..4125078293 100644 --- a/docs/2.4.3/chaosd-search-recover/index.html +++ b/docs/2.4.3/chaosd-search-recover/index.html @@ -3,7 +3,7 @@ -Search and Recover Experiments of Chaosd | Chaos Mesh +Search and Recover Experiments of Chaosd | Chaos Mesh @@ -16,11 +16,11 @@ - + -
      Version: 2.4.3

      Search and Recover Experiments of Chaosd

      You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.

      +
      Version: 2.4.3

      Search and Recover Experiments of Chaosd

      You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.

      Search experiments of Chaosd

      This section introduces how to use command-line mode and service mode to find experiments of Chaosd.

      Search experiments using the command-line mode

      diff --git a/docs/2.4.3/check-workflow-status/index.html b/docs/2.4.3/check-workflow-status/index.html index be981df0e8..c19e4f3d15 100644 --- a/docs/2.4.3/check-workflow-status/index.html +++ b/docs/2.4.3/check-workflow-status/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/clean-up-chaos-experiments/index.html b/docs/2.4.3/clean-up-chaos-experiments/index.html index 0213495d83..a0792fa090 100644 --- a/docs/2.4.3/clean-up-chaos-experiments/index.html +++ b/docs/2.4.3/clean-up-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/configure-development-environment/index.html b/docs/2.4.3/configure-development-environment/index.html index 985ba21f19..d6805f26ea 100644 --- a/docs/2.4.3/configure-development-environment/index.html +++ b/docs/2.4.3/configure-development-environment/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/configure-enabled-namespace/index.html b/docs/2.4.3/configure-enabled-namespace/index.html index 63102d8c27..e3496ff867 100644 --- a/docs/2.4.3/configure-enabled-namespace/index.html +++ b/docs/2.4.3/configure-enabled-namespace/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/create-chaos-mesh-workflow/index.html b/docs/2.4.3/create-chaos-mesh-workflow/index.html index 1b0136a5f3..62ab10ef50 100644 --- a/docs/2.4.3/create-chaos-mesh-workflow/index.html +++ b/docs/2.4.3/create-chaos-mesh-workflow/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/define-chaos-experiment-scope/index.html b/docs/2.4.3/define-chaos-experiment-scope/index.html index e279e15475..b3f9f07681 100644 --- a/docs/2.4.3/define-chaos-experiment-scope/index.html +++ b/docs/2.4.3/define-chaos-experiment-scope/index.html @@ -16,7 +16,7 @@ - + @@ -30,7 +30,7 @@

      Define the experiment scope in a YAML configuration file

      -

      This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

      +

      This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

      Namespace selectors

      • Specifies the namespace of the experiment's target Pod.
      • @@ -49,7 +49,7 @@

        Label
        spec:
        selector:
        labelSelectors:
        'app.kubernetes.io/component': 'tikv'

        Expression selectors

          -
        • Specifies a set of expressions that define the label's rules to specifiy the experiment's target Pod.
        • +
        • Specifies a set of expressions that define the label's rules to specify the experiment's target Pod.
        • You can use this selector to set up the experiment's target Pod that does not meet some labels.

        When creating the experiment using the YAML file, you need to configure selectors. For example:

        @@ -111,7 +111,7 @@

        note

        PhysicalMachine is a CRD (CustomResourcesDefinition) that represents a physical machine. To create PhysicalMachine, Chaos Mesh uses Chaosctl.

      When creating the experiment using the YAML file, you need to configure selectors. For example:

      -
      spec:
      selector:
      physicalMachines:
      default: # namespace of the target PhysicalMachines
      - physcial-machine-a
      - physcial-machine-b
      +
      spec:
      selector:
      physicalMachines:
      default: # namespace of the target PhysicalMachines
      - physical-machine-a
      - physical-machine-b

      Define the experiment scope on Chaos Dashboard

      If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information.

      The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:

      diff --git a/docs/2.4.3/define-scheduling-rules/index.html b/docs/2.4.3/define-scheduling-rules/index.html index 836753ffdf..71c1ea2964 100644 --- a/docs/2.4.3/define-scheduling-rules/index.html +++ b/docs/2.4.3/define-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/define-workflow-scheduling-rules/index.html b/docs/2.4.3/define-workflow-scheduling-rules/index.html index 65472b4027..2b1f4588e4 100644 --- a/docs/2.4.3/define-workflow-scheduling-rules/index.html +++ b/docs/2.4.3/define-workflow-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/developer-guide-overview/index.html b/docs/2.4.3/developer-guide-overview/index.html index 97af517a7a..03fb2c238d 100644 --- a/docs/2.4.3/developer-guide-overview/index.html +++ b/docs/2.4.3/developer-guide-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/extend-chaos-daemon-interface/index.html b/docs/2.4.3/extend-chaos-daemon-interface/index.html index 4b8382d9d4..984663268a 100644 --- a/docs/2.4.3/extend-chaos-daemon-interface/index.html +++ b/docs/2.4.3/extend-chaos-daemon-interface/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/extend-chaosd/index.html b/docs/2.4.3/extend-chaosd/index.html index c28fd23b0b..d0b77fa746 100644 --- a/docs/2.4.3/extend-chaosd/index.html +++ b/docs/2.4.3/extend-chaosd/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/faqs/index.html b/docs/2.4.3/faqs/index.html index f4134a4a97..a09cc69929 100644 --- a/docs/2.4.3/faqs/index.html +++ b/docs/2.4.3/faqs/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/gcp-authentication/index.html b/docs/2.4.3/gcp-authentication/index.html index 7d9458da7b..ed1763a69d 100644 --- a/docs/2.4.3/gcp-authentication/index.html +++ b/docs/2.4.3/gcp-authentication/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/glossary/index.html b/docs/2.4.3/glossary/index.html index 9faf3f3205..9f7bcda0a3 100644 --- a/docs/2.4.3/glossary/index.html +++ b/docs/2.4.3/glossary/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/go-client/index.html b/docs/2.4.3/go-client/index.html index 4533b3f9c1..0a62c0bb85 100644 --- a/docs/2.4.3/go-client/index.html +++ b/docs/2.4.3/go-client/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/index.html b/docs/2.4.3/index.html index 1f2e367e84..ff3f8555a6 100644 --- a/docs/2.4.3/index.html +++ b/docs/2.4.3/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/inspect-chaos-experiments/index.html b/docs/2.4.3/inspect-chaos-experiments/index.html index 52ebb97e5d..409d2bf137 100644 --- a/docs/2.4.3/inspect-chaos-experiments/index.html +++ b/docs/2.4.3/inspect-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + @@ -59,7 +59,7 @@

      inject latency to specified method

      Usage:
      chaosd attack jvm latency [options] [flags]

      Flags:
      -c, --class string Java class name
      -h, --help help for latency
      --latency int the latency duration, unit ms
      -m, --method string the method name in Java class

      Global Flags:
      --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
      --pid int the pid of Java process which needs to attach
      --port int the port of agent server (default 9288)
      --uid string the experiment ID

      Configuration description for increasing method latency

      -
      Configuration itemAbbreviationDescriptionValue
      classcThe name of the Java classstring type, required
      latencyNoneThe duration of increasing method latencyint type, required. The unit is milisecond.
      methodmThe name of the methodstring type, required
      pidNoneThe Java process ID where the fault is to be injectedint type, required
      portNoneThe port number attached to the Java process agent. The fault is injected into the Java process through this port number.int type. The default value is 9288.
      uidNoneThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.
      +
      Configuration itemAbbreviationDescriptionValue
      classcThe name of the Java classstring type, required
      latencyNoneThe duration of increasing method latencyint type, required. The unit is millisecond.
      methodmThe name of the methodstring type, required
      pidNoneThe Java process ID where the fault is to be injectedint type, required
      portNoneThe port number attached to the Java process agent. The fault is injected into the Java process through this port number.int type. The default value is 9288.
      uidNoneThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.

      Example for increasing method latency

      chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840

      The result is as follows:

      @@ -142,7 +142,7 @@

      Increase method latency using service mode

      Parameters for increasing method latency

      -
      ParameterDescriptionValue
      actionThe action of the experimentSet to "latency"
      classThe name of the Java classstring type, required
      latencyThe duration of increasing method latencyint type, required. The unit is milisecond.
      methodThe name of the methodstring type, required
      pidThe Java process ID where the fault is to be injectedint type, required
      portThe Java process ID where the fault is needed to be injectedint type, required
      uidThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.
      +
      ParameterDescriptionValue
      actionThe action of the experimentSet to "latency"
      classThe name of the Java classstring type, required
      latencyThe duration of increasing method latencyint type, required. The unit is millisecond.
      methodThe name of the methodstring type, required
      pidThe Java process ID where the fault is to be injectedint type, required
      portThe Java process ID where the fault is needed to be injectedint type, required
      uidThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.

      Example for increasing method latency using the service mode

      curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d '{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}'

      The result is as follows:

      @@ -155,7 +155,7 @@

      {"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}

      Trigger faults by setting Byteman configuration files using service mode

      -

      You can set the fault rules according to the Byteman rule configuration. Regarding to the Byteman rule configuration, refer to byteman-rule-language.

      +

      You can set the fault rules according to the Byteman rule configuration. For more information about the Byteman rule configuration,, refer to byteman-rule-language.

      Parameters for triggering faults by setting Byteman configuration files

      ParameterDescriptionValue
      actionThe action of the experimentSet to "rule-data"
      rule-dataSpecifies the Byteman configuration datastring type, required
      pidThe Java process ID where the fault is to be injectedint type, required
      portThe port number attached to the Java process agent. The fault is injected into the Java process through this port number.int type. The default value is 9288.
      uidThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.

      Example for triggering faults by setting Byteman configuration files using the service mode

      diff --git a/docs/2.4.3/simulate-jvm-application-chaos/index.html b/docs/2.4.3/simulate-jvm-application-chaos/index.html index 5b8ca96932..420a733e02 100644 --- a/docs/2.4.3/simulate-jvm-application-chaos/index.html +++ b/docs/2.4.3/simulate-jvm-application-chaos/index.html @@ -16,7 +16,7 @@ - + @@ -102,7 +102,7 @@

      Fiel
      ValueMeaning
      latencyIncrease method latency
      returnModify return values of a method
      exceptionThrow custom exceptions
      stressIncrease CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)
      gcTrigger garbage collection
      ruleDataTrigger faults by setting Byteman configuration files

      For different action values, there are different configuration items that can be filled in.

      Parameters for latency

      -
      ParameterTypeDescriptionRequired
      classstringThe name of the Java classYes
      methodstringThe name of the methodYes
      latencyintThe duration of increasing method latency. The unit is milisecond.Yes
      portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No
      +
      ParameterTypeDescriptionRequired
      classstringThe name of the Java classYes
      methodstringThe name of the methodYes
      latencyintThe duration of increasing method latency. The unit is millisecond.Yes
      portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

      Parameters for return

      ParameterTypeDescriptionRequired
      classstringThe name of the Java classYes
      methodstringThe name of the methodYes
      valuestringSpecifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".Yes
      portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

      Parameters for exception

      @@ -112,7 +112,7 @@

      Parameters for gc

      ParameterTypeDescriptionRequired
      portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

      Parameters for ruleData

      -
      ParameterTypeDescriptionRequired
      ruleDatasrtingSpecifies the Byteman configuration dataYes
      portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No
      +
      ParameterTypeDescriptionRequired
      ruleDatastringSpecifies the Byteman configuration dataYes
      portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

      When you write the rule configuration file, take into account the specific Java program and the byteman-rule-language. For example:

      RULE modify return value
      CLASS Main
      METHOD getnum
      AT ENTRY
      IF true
      DO
      return 9999
      ENDRULE

      You need to escape the line breaks in the configuration file to the newline character "\n", and use the escaped text as the value of "rule-data" as follows:

      diff --git a/docs/2.4.3/simulate-kernel-chaos-on-kubernetes/index.html b/docs/2.4.3/simulate-kernel-chaos-on-kubernetes/index.html index 8c66d68ebd..38b078a3a8 100644 --- a/docs/2.4.3/simulate-kernel-chaos-on-kubernetes/index.html +++ b/docs/2.4.3/simulate-kernel-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + @@ -26,7 +26,7 @@

      Prerequisites

      Configuration file

      diff --git a/docs/2.4.3/simulate-network-chaos-in-physical-nodes/index.html b/docs/2.4.3/simulate-network-chaos-in-physical-nodes/index.html index 80f2560160..6255a57abb 100644 --- a/docs/2.4.3/simulate-network-chaos-in-physical-nodes/index.html +++ b/docs/2.4.3/simulate-network-chaos-in-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/simulate-network-chaos-on-kubernetes/index.html b/docs/2.4.3/simulate-network-chaos-on-kubernetes/index.html index 92d0208be4..a022a6a1e1 100644 --- a/docs/2.4.3/simulate-network-chaos-on-kubernetes/index.html +++ b/docs/2.4.3/simulate-network-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + @@ -91,7 +91,7 @@

      Band

      Field description

      -
      ParameterTypeDescriptionDefault valueRequiredExample
      actionstringIndicates the specific fault type. Available types include: netem, delay (network delay), loss (packet loss), duplicate (packet duplicating), corrupt (packet corrupt), partition (network partition), and bandwidth (network bandwidth limit). After you specify action field, refer to Description for action-related fields for other necessary field configuration.NoneYesPartition
      targetSelectorUsed in combination with direction, making Chaos only effective for some packets.NoneNo
      directionenumIndicates the direction of target packets. Available vaules include from (the packets from target), to (the packets to target), and both ( the packets from or to target). This parameter makes Chaos only take effect for a specific direction of packets.toNoboth
      modestringSpecifies the mode of the experiment. The mode options include one (selecting a random Pod), all (selecting all eligible Pods), fixed (selecting a specified number of eligible Pods), fixed-percent (selecting a specified percentage of Pods from the eligible Pods), and random-max-percent (selecting the maximum percentage of Pods from the eligible Pods).NoneYesone
      valuestringProvides a parameter for the mode configuration, depending on mode. For example, when mode is set to fixed-percent, value specifies the percentage of Pods.NoneNo1
      selectorstructSpecifies the target Pod. For details, refer to Define the experiment scope.NoneYes
      externalTargets[]stringIndicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with direction: to.NoneNo1.1.1.1, google.com
      devicestringSpecifies the affected network interfaceNoneNo"eth0"
      +
      ParameterTypeDescriptionDefault valueRequiredExample
      actionstringIndicates the specific fault type. Available types include: netem, delay (network delay), loss (packet loss), duplicate (packet duplicating), corrupt (packet corrupt), partition (network partition), and bandwidth (network bandwidth limit). After you specify action field, refer to Description for action-related fields for other necessary field configuration.NoneYesPartition
      targetSelectorUsed in combination with direction, making Chaos only effective for some packets.NoneNo
      directionenumIndicates the direction of target packets. Available values include from (the packets from target), to (the packets to target), and both ( the packets from or to target). This parameter makes Chaos only take effect for a specific direction of packets.toNoboth
      modestringSpecifies the mode of the experiment. The mode options include one (selecting a random Pod), all (selecting all eligible Pods), fixed (selecting a specified number of eligible Pods), fixed-percent (selecting a specified percentage of Pods from the eligible Pods), and random-max-percent (selecting the maximum percentage of Pods from the eligible Pods).NoneYesone
      valuestringProvides a parameter for the mode configuration, depending on mode. For example, when mode is set to fixed-percent, value specifies the percentage of Pods.NoneNo1
      selectorstructSpecifies the target Pod. For details, refer to Define the experiment scope.NoneYes
      externalTargets[]stringIndicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with direction: to.NoneNo1.1.1.1, google.com
      devicestringSpecifies the affected network interfaceNoneNo"eth0"

      For the Net Emulation and Bandwidth fault types, you can further configure the action related parameters according to the following description.

        diff --git a/docs/2.4.3/simulate-physical-machine-chaos/index.html b/docs/2.4.3/simulate-physical-machine-chaos/index.html index 2e12306206..2a00e9af2b 100644 --- a/docs/2.4.3/simulate-physical-machine-chaos/index.html +++ b/docs/2.4.3/simulate-physical-machine-chaos/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/simulate-pod-chaos-on-kubernetes/index.html b/docs/2.4.3/simulate-pod-chaos-on-kubernetes/index.html index 55360a131e..48fa52bb0f 100644 --- a/docs/2.4.3/simulate-pod-chaos-on-kubernetes/index.html +++ b/docs/2.4.3/simulate-pod-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/simulate-process-chaos-in-physical-nodes/index.html b/docs/2.4.3/simulate-process-chaos-in-physical-nodes/index.html index 6c96a58d9b..faa15e66f2 100644 --- a/docs/2.4.3/simulate-process-chaos-in-physical-nodes/index.html +++ b/docs/2.4.3/simulate-process-chaos-in-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/simulate-redis-chaos-on-physical-nodes/index.html b/docs/2.4.3/simulate-redis-chaos-on-physical-nodes/index.html index d448e1516e..07216c8f25 100644 --- a/docs/2.4.3/simulate-redis-chaos-on-physical-nodes/index.html +++ b/docs/2.4.3/simulate-redis-chaos-on-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/simulate-time-chaos-on-kubernetes/index.html b/docs/2.4.3/simulate-time-chaos-on-kubernetes/index.html index 157a66f3ae..6f12bb12dc 100644 --- a/docs/2.4.3/simulate-time-chaos-on-kubernetes/index.html +++ b/docs/2.4.3/simulate-time-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/simulate-time-chaos-on-physical-nodes/index.html b/docs/2.4.3/simulate-time-chaos-on-physical-nodes/index.html index e58e950cbc..752e713195 100644 --- a/docs/2.4.3/simulate-time-chaos-on-physical-nodes/index.html +++ b/docs/2.4.3/simulate-time-chaos-on-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/status-check-in-workflow/index.html b/docs/2.4.3/status-check-in-workflow/index.html index 8b101c7193..65251a25e8 100644 --- a/docs/2.4.3/status-check-in-workflow/index.html +++ b/docs/2.4.3/status-check-in-workflow/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/troubleshooting-guide/index.html b/docs/2.4.3/troubleshooting-guide/index.html index 883718749a..3ed14e930d 100644 --- a/docs/2.4.3/troubleshooting-guide/index.html +++ b/docs/2.4.3/troubleshooting-guide/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/uninstallation/index.html b/docs/2.4.3/uninstallation/index.html index db246b6c3a..5164c024fd 100644 --- a/docs/2.4.3/uninstallation/index.html +++ b/docs/2.4.3/uninstallation/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/upgrade-from-2.1-to-2.2/index.html b/docs/2.4.3/upgrade-from-2.1-to-2.2/index.html index ced134186c..76f4a34847 100644 --- a/docs/2.4.3/upgrade-from-2.1-to-2.2/index.html +++ b/docs/2.4.3/upgrade-from-2.1-to-2.2/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/upgrade-to-2.0/index.html b/docs/2.4.3/upgrade-to-2.0/index.html index d96f7dc01b..f99b4705c7 100644 --- a/docs/2.4.3/upgrade-to-2.0/index.html +++ b/docs/2.4.3/upgrade-to-2.0/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/use-argo-to-orchestrate-chaos-experiments/index.html b/docs/2.4.3/use-argo-to-orchestrate-chaos-experiments/index.html index d91637eed2..213d1a5aa7 100644 --- a/docs/2.4.3/use-argo-to-orchestrate-chaos-experiments/index.html +++ b/docs/2.4.3/use-argo-to-orchestrate-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.4.3/use-grafana-data-source/index.html b/docs/2.4.3/use-grafana-data-source/index.html index 3a71d06652..bb44aa22fe 100644 --- a/docs/2.4.3/use-grafana-data-source/index.html +++ b/docs/2.4.3/use-grafana-data-source/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/add-new-chaos-experiment-type/index.html b/docs/2.5.2/add-new-chaos-experiment-type/index.html index 1d4d86bb60..07a6ad5e32 100644 --- a/docs/2.5.2/add-new-chaos-experiment-type/index.html +++ b/docs/2.5.2/add-new-chaos-experiment-type/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/basic-features/index.html b/docs/2.5.2/basic-features/index.html index a9f41bdcc7..69868053b3 100644 --- a/docs/2.5.2/basic-features/index.html +++ b/docs/2.5.2/basic-features/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/chaos-engineering-principles/index.html b/docs/2.5.2/chaos-engineering-principles/index.html index 028720a048..2002583ce2 100644 --- a/docs/2.5.2/chaos-engineering-principles/index.html +++ b/docs/2.5.2/chaos-engineering-principles/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/chaosctl-tool/index.html b/docs/2.5.2/chaosctl-tool/index.html index 9f81480243..8864a78d5f 100644 --- a/docs/2.5.2/chaosctl-tool/index.html +++ b/docs/2.5.2/chaosctl-tool/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/chaosd-overview/index.html b/docs/2.5.2/chaosd-overview/index.html index f2fed2efaa..5b814efd36 100644 --- a/docs/2.5.2/chaosd-overview/index.html +++ b/docs/2.5.2/chaosd-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/chaosd-search-recover/index.html b/docs/2.5.2/chaosd-search-recover/index.html index 77caddb952..4d68aac997 100644 --- a/docs/2.5.2/chaosd-search-recover/index.html +++ b/docs/2.5.2/chaosd-search-recover/index.html @@ -3,7 +3,7 @@ -Search and Recover Experiments of Chaosd | Chaos Mesh +Search and Recover Experiments of Chaosd | Chaos Mesh @@ -16,11 +16,11 @@ - + -
        Version: 2.5.2

        Search and Recover Experiments of Chaosd

        You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.

        +
        Version: 2.5.2

        Search and Recover Experiments of Chaosd

        You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.

        Search experiments of Chaosd

        This section introduces how to use command-line mode and service mode to find experiments of Chaosd.

        Search experiments using the command-line mode

        diff --git a/docs/2.5.2/check-workflow-status/index.html b/docs/2.5.2/check-workflow-status/index.html index ce8de51ced..b729d6d03e 100644 --- a/docs/2.5.2/check-workflow-status/index.html +++ b/docs/2.5.2/check-workflow-status/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/clean-up-chaos-experiments/index.html b/docs/2.5.2/clean-up-chaos-experiments/index.html index 132ac1e7a2..2e02286dbe 100644 --- a/docs/2.5.2/clean-up-chaos-experiments/index.html +++ b/docs/2.5.2/clean-up-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/configure-development-environment/index.html b/docs/2.5.2/configure-development-environment/index.html index d67cb3dadd..cfe3d775cd 100644 --- a/docs/2.5.2/configure-development-environment/index.html +++ b/docs/2.5.2/configure-development-environment/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/configure-enabled-namespace/index.html b/docs/2.5.2/configure-enabled-namespace/index.html index 66a41ab974..78fbf3dd90 100644 --- a/docs/2.5.2/configure-enabled-namespace/index.html +++ b/docs/2.5.2/configure-enabled-namespace/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/create-chaos-mesh-workflow/index.html b/docs/2.5.2/create-chaos-mesh-workflow/index.html index 29e22e75bf..57660356bf 100644 --- a/docs/2.5.2/create-chaos-mesh-workflow/index.html +++ b/docs/2.5.2/create-chaos-mesh-workflow/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/define-chaos-experiment-scope/index.html b/docs/2.5.2/define-chaos-experiment-scope/index.html index 1247f9724c..d4b0f3481b 100644 --- a/docs/2.5.2/define-chaos-experiment-scope/index.html +++ b/docs/2.5.2/define-chaos-experiment-scope/index.html @@ -16,7 +16,7 @@ - + @@ -30,7 +30,7 @@

        Define the experiment scope in a YAML configuration file

        -

        This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

        +

        This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

        Namespace selectors

        • Specifies the namespace of the experiment's target Pod.
        • @@ -49,7 +49,7 @@

          Label
          spec:
          selector:
          labelSelectors:
          'app.kubernetes.io/component': 'tikv'

          Expression selectors

            -
          • Specifies a set of expressions that define the label's rules to specifiy the experiment's target Pod.
          • +
          • Specifies a set of expressions that define the label's rules to specify the experiment's target Pod.
          • You can use this selector to set up the experiment's target Pod that does not meet some labels.

          When creating the experiment using the YAML file, you need to configure selectors. For example:

          @@ -111,7 +111,7 @@

          note

          PhysicalMachine is a CRD (CustomResourcesDefinition) that represents a physical machine. To create PhysicalMachine, Chaos Mesh uses Chaosctl.

        When creating the experiment using the YAML file, you need to configure selectors. For example:

        -
        spec:
        selector:
        physicalMachines:
        default: # namespace of the target PhysicalMachines
        - physcial-machine-a
        - physcial-machine-b
        +
        spec:
        selector:
        physicalMachines:
        default: # namespace of the target PhysicalMachines
        - physical-machine-a
        - physical-machine-b

        Define the experiment scope on Chaos Dashboard

        If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information.

        The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:

        diff --git a/docs/2.5.2/define-scheduling-rules/index.html b/docs/2.5.2/define-scheduling-rules/index.html index b7a272d370..a59a93f3ef 100644 --- a/docs/2.5.2/define-scheduling-rules/index.html +++ b/docs/2.5.2/define-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/define-workflow-scheduling-rules/index.html b/docs/2.5.2/define-workflow-scheduling-rules/index.html index 197c7f41ba..b7dc5aa68f 100644 --- a/docs/2.5.2/define-workflow-scheduling-rules/index.html +++ b/docs/2.5.2/define-workflow-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/developer-guide-overview/index.html b/docs/2.5.2/developer-guide-overview/index.html index 5db5ac7c37..db512a5eca 100644 --- a/docs/2.5.2/developer-guide-overview/index.html +++ b/docs/2.5.2/developer-guide-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/extend-chaos-daemon-interface/index.html b/docs/2.5.2/extend-chaos-daemon-interface/index.html index acf54e8ec2..0cc824e2ff 100644 --- a/docs/2.5.2/extend-chaos-daemon-interface/index.html +++ b/docs/2.5.2/extend-chaos-daemon-interface/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/extend-chaosd/index.html b/docs/2.5.2/extend-chaosd/index.html index 86a6c95942..91e6d010d4 100644 --- a/docs/2.5.2/extend-chaosd/index.html +++ b/docs/2.5.2/extend-chaosd/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/faqs/index.html b/docs/2.5.2/faqs/index.html index 7b7a7e75ab..00f65e028e 100644 --- a/docs/2.5.2/faqs/index.html +++ b/docs/2.5.2/faqs/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/gcp-authentication/index.html b/docs/2.5.2/gcp-authentication/index.html index 557a1017d5..21d097efe2 100644 --- a/docs/2.5.2/gcp-authentication/index.html +++ b/docs/2.5.2/gcp-authentication/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/glossary/index.html b/docs/2.5.2/glossary/index.html index aafef12161..a5d289966b 100644 --- a/docs/2.5.2/glossary/index.html +++ b/docs/2.5.2/glossary/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/go-client/index.html b/docs/2.5.2/go-client/index.html index 8072493f25..b876a9d83c 100644 --- a/docs/2.5.2/go-client/index.html +++ b/docs/2.5.2/go-client/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/index.html b/docs/2.5.2/index.html index b449680d6f..791acfd45c 100644 --- a/docs/2.5.2/index.html +++ b/docs/2.5.2/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/inspect-chaos-experiments/index.html b/docs/2.5.2/inspect-chaos-experiments/index.html index 082b9433d7..31bb12e5dc 100644 --- a/docs/2.5.2/inspect-chaos-experiments/index.html +++ b/docs/2.5.2/inspect-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + @@ -59,7 +59,7 @@

        inject latency to specified method

        Usage:
        chaosd attack jvm latency [options] [flags]

        Flags:
        -c, --class string Java class name
        -h, --help help for latency
        --latency int the latency duration, unit ms
        -m, --method string the method name in Java class

        Global Flags:
        --log-level string the log level of chaosd. The value can be 'debug', 'info', 'warn' and 'error'
        --pid int the pid of Java process which needs to attach
        --port int the port of agent server (default 9288)
        --uid string the experiment ID

        Configuration description for increasing method latency

        -
        Configuration itemAbbreviationDescriptionValue
        classcThe name of the Java classstring type, required
        latencyNoneThe duration of increasing method latencyint type, required. The unit is milisecond.
        methodmThe name of the methodstring type, required
        pidNoneThe Java process ID where the fault is to be injectedint type, required
        portNoneThe port number attached to the Java process agent. The fault is injected into the Java process through this port number.int type. The default value is 9288.
        uidNoneThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.
        +
        Configuration itemAbbreviationDescriptionValue
        classcThe name of the Java classstring type, required
        latencyNoneThe duration of increasing method latencyint type, required. The unit is millisecond.
        methodmThe name of the methodstring type, required
        pidNoneThe Java process ID where the fault is to be injectedint type, required
        portNoneThe port number attached to the Java process agent. The fault is injected into the Java process through this port number.int type. The default value is 9288.
        uidNoneThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.

        Example for increasing method latency

        chaosd attack jvm latency --class Main --method sayhello --latency 5000 --pid 100840

        The result is as follows:

        @@ -142,7 +142,7 @@

        Increase method latency using service mode

        Parameters for increasing method latency

        -
        ParameterDescriptionValue
        actionThe action of the experimentSet to "latency"
        classThe name of the Java classstring type, required
        latencyThe duration of increasing method latencyint type, required. The unit is milisecond.
        methodThe name of the methodstring type, required
        pidThe Java process ID where the fault is to be injectedint type, required
        portThe Java process ID where the fault is needed to be injectedint type, required
        uidThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.
        +
        ParameterDescriptionValue
        actionThe action of the experimentSet to "latency"
        classThe name of the Java classstring type, required
        latencyThe duration of increasing method latencyint type, required. The unit is millisecond.
        methodThe name of the methodstring type, required
        pidThe Java process ID where the fault is to be injectedint type, required
        portThe Java process ID where the fault is needed to be injectedint type, required
        uidThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.

        Example for increasing method latency using the service mode

        curl -X POST 172.16.112.130:31767/api/attack/jvm -H "Content-Type:application/json" -d '{"action":"latency","class":"Main","method":"sayhello","latency":5000,"pid":1828622}'

        The result is as follows:

        @@ -155,7 +155,7 @@

        {"status":200,"message":"attack successfully","uid":"a551206c-960d-4ac5-9056-518e512d4d0d"}

        Trigger faults by setting Byteman configuration files using service mode

        -

        You can set the fault rules according to the Byteman rule configuration. Regarding to the Byteman rule configuration, refer to byteman-rule-language.

        +

        You can set the fault rules according to the Byteman rule configuration. For more information about the Byteman rule configuration, refer to byteman-rule-language.

        Parameters for triggering faults by setting Byteman configuration files

        ParameterDescriptionValue
        actionThe action of the experimentSet to "rule-data"
        rule-dataSpecifies the Byteman configuration datastring type, required
        pidThe Java process ID where the fault is to be injectedint type, required
        portThe port number attached to the Java process agent. The fault is injected into the Java process through this port number.int type. The default value is 9288.
        uidThe experiment IDstring type. This item is not required to be configured, because Chaosd randomly creates one.

        Example for triggering faults by setting Byteman configuration files using the service mode

        diff --git a/docs/2.5.2/simulate-jvm-application-chaos/index.html b/docs/2.5.2/simulate-jvm-application-chaos/index.html index b653fb8cd3..5797032878 100644 --- a/docs/2.5.2/simulate-jvm-application-chaos/index.html +++ b/docs/2.5.2/simulate-jvm-application-chaos/index.html @@ -16,7 +16,7 @@ - + @@ -102,7 +102,7 @@

        Fiel
        ValueMeaning
        latencyIncrease method latency
        returnModify return values of a method
        exceptionThrow custom exceptions
        stressIncrease CPU usage of Java process, or cause memory overflow (support heap overflow and stack overflow)
        gcTrigger garbage collection
        ruleDataTrigger faults by setting Byteman configuration files

        For different action values, there are different configuration items that can be filled in.

        Parameters for latency

        -
        ParameterTypeDescriptionRequired
        classstringThe name of the Java classYes
        methodstringThe name of the methodYes
        latencyintThe duration of increasing method latency. The unit is milisecond.Yes
        portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No
        +
        ParameterTypeDescriptionRequired
        classstringThe name of the Java classYes
        methodstringThe name of the methodYes
        latencyintThe duration of increasing method latency. The unit is millisecond.Yes
        portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

        Parameters for return

        ParameterTypeDescriptionRequired
        classstringThe name of the Java classYes
        methodstringThe name of the methodYes
        valuestringSpecifies the return value of the method. Currently, the item can be numeric and string types. If the item (return value) is string, double quotes are required, like "chaos".Yes
        portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

        Parameters for exception

        @@ -112,7 +112,7 @@

        Parameters for gc

        ParameterTypeDescriptionRequired
        portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

        Parameters for ruleData

        -
        ParameterTypeDescriptionRequired
        ruleDatasrtingSpecifies the Byteman configuration dataYes
        portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No
        +
        ParameterTypeDescriptionRequired
        ruleDatastringSpecifies the Byteman configuration dataYes
        portintThe port ID attached to the Java process agent. The faults are injected into the Java process through this ID.No

        When you write the rule configuration file, take into account the specific Java program and the byteman-rule-language. For example:

        RULE modify return value
        CLASS Main
        METHOD getnum
        AT ENTRY
        IF true
        DO
        return 9999
        ENDRULE

        You need to escape the line breaks in the configuration file to the newline character "\n", and use the escaped text as the value of "rule-data" as follows:

        diff --git a/docs/2.5.2/simulate-kernel-chaos-on-kubernetes/index.html b/docs/2.5.2/simulate-kernel-chaos-on-kubernetes/index.html index 975030390e..b0e5436114 100644 --- a/docs/2.5.2/simulate-kernel-chaos-on-kubernetes/index.html +++ b/docs/2.5.2/simulate-kernel-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + @@ -26,7 +26,7 @@

        Prerequisites

        Configuration file

        diff --git a/docs/2.5.2/simulate-network-chaos-in-physical-nodes/index.html b/docs/2.5.2/simulate-network-chaos-in-physical-nodes/index.html index 00d2ea6c15..ba61817d74 100644 --- a/docs/2.5.2/simulate-network-chaos-in-physical-nodes/index.html +++ b/docs/2.5.2/simulate-network-chaos-in-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/simulate-network-chaos-on-kubernetes/index.html b/docs/2.5.2/simulate-network-chaos-on-kubernetes/index.html index 9700d33e5a..b4daa2e45d 100644 --- a/docs/2.5.2/simulate-network-chaos-on-kubernetes/index.html +++ b/docs/2.5.2/simulate-network-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + @@ -91,7 +91,7 @@

        Band

        Field description

        -
        ParameterTypeDescriptionDefault valueRequiredExample
        actionstringIndicates the specific fault type. Available types include: netem, delay (network delay), loss (packet loss), duplicate (packet duplicating), corrupt (packet corrupt), partition (network partition), and bandwidth (network bandwidth limit). After you specify action field, refer to Description for action-related fields for other necessary field configuration.NoneYesPartition
        targetSelectorUsed in combination with direction, making Chaos only effective for some packets.NoneNo
        directionenumIndicates the direction of target packets. Available vaules include from (the packets from target), to (the packets to target), and both ( the packets from or to target). This parameter makes Chaos only take effect for a specific direction of packets.toNoboth
        modestringSpecifies the mode of the experiment. The mode options include one (selecting a random Pod), all (selecting all eligible Pods), fixed (selecting a specified number of eligible Pods), fixed-percent (selecting a specified percentage of Pods from the eligible Pods), and random-max-percent (selecting the maximum percentage of Pods from the eligible Pods).NoneYesone
        valuestringProvides a parameter for the mode configuration, depending on mode. For example, when mode is set to fixed-percent, value specifies the percentage of Pods.NoneNo1
        selectorstructSpecifies the target Pod. For details, refer to Define the experiment scope.NoneYes
        externalTargets[]stringIndicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with direction: to.NoneNo1.1.1.1, google.com
        devicestringSpecifies the affected network interfaceNoneNo"eth0"
        +
        ParameterTypeDescriptionDefault valueRequiredExample
        actionstringIndicates the specific fault type. Available types include: netem, delay (network delay), loss (packet loss), duplicate (packet duplicating), corrupt (packet corrupt), partition (network partition), and bandwidth (network bandwidth limit). After you specify action field, refer to Description for action-related fields for other necessary field configuration.NoneYesPartition
        targetSelectorUsed in combination with direction, making Chaos only effective for some packets.NoneNo
        directionenumIndicates the direction of target packets. Available values include from (the packets from target), to (the packets to target), and both ( the packets from or to target). This parameter makes Chaos only take effect for a specific direction of packets.toNoboth
        modestringSpecifies the mode of the experiment. The mode options include one (selecting a random Pod), all (selecting all eligible Pods), fixed (selecting a specified number of eligible Pods), fixed-percent (selecting a specified percentage of Pods from the eligible Pods), and random-max-percent (selecting the maximum percentage of Pods from the eligible Pods).NoneYesone
        valuestringProvides a parameter for the mode configuration, depending on mode. For example, when mode is set to fixed-percent, value specifies the percentage of Pods.NoneNo1
        selectorstructSpecifies the target Pod. For details, refer to Define the experiment scope.NoneYes
        externalTargets[]stringIndicates the network targets except for Kubernetes, which can be IPv4 addresses or domains. This parameter only works with direction: to.NoneNo1.1.1.1, google.com
        devicestringSpecifies the affected network interfaceNoneNo"eth0"

        For the Net Emulation and Bandwidth fault types, you can further configure the action related parameters according to the following description.

          diff --git a/docs/2.5.2/simulate-physical-machine-chaos/index.html b/docs/2.5.2/simulate-physical-machine-chaos/index.html index cf6b80e298..cbc8b6006e 100644 --- a/docs/2.5.2/simulate-physical-machine-chaos/index.html +++ b/docs/2.5.2/simulate-physical-machine-chaos/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/simulate-pod-chaos-on-kubernetes/index.html b/docs/2.5.2/simulate-pod-chaos-on-kubernetes/index.html index ac0c6f70af..1764265895 100644 --- a/docs/2.5.2/simulate-pod-chaos-on-kubernetes/index.html +++ b/docs/2.5.2/simulate-pod-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/simulate-process-chaos-in-physical-nodes/index.html b/docs/2.5.2/simulate-process-chaos-in-physical-nodes/index.html index 6169f13d50..aa8c5e7637 100644 --- a/docs/2.5.2/simulate-process-chaos-in-physical-nodes/index.html +++ b/docs/2.5.2/simulate-process-chaos-in-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/simulate-redis-chaos-on-physical-nodes/index.html b/docs/2.5.2/simulate-redis-chaos-on-physical-nodes/index.html index 1872fac6f3..11dac41979 100644 --- a/docs/2.5.2/simulate-redis-chaos-on-physical-nodes/index.html +++ b/docs/2.5.2/simulate-redis-chaos-on-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/simulate-time-chaos-on-kubernetes/index.html b/docs/2.5.2/simulate-time-chaos-on-kubernetes/index.html index 82ab0ff6b9..b75b5a42e0 100644 --- a/docs/2.5.2/simulate-time-chaos-on-kubernetes/index.html +++ b/docs/2.5.2/simulate-time-chaos-on-kubernetes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/simulate-time-chaos-on-physical-nodes/index.html b/docs/2.5.2/simulate-time-chaos-on-physical-nodes/index.html index 2f1367f26d..a1583e5190 100644 --- a/docs/2.5.2/simulate-time-chaos-on-physical-nodes/index.html +++ b/docs/2.5.2/simulate-time-chaos-on-physical-nodes/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/status-check-in-workflow/index.html b/docs/2.5.2/status-check-in-workflow/index.html index 7b7d464039..968b931cf5 100644 --- a/docs/2.5.2/status-check-in-workflow/index.html +++ b/docs/2.5.2/status-check-in-workflow/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/troubleshooting-guide/index.html b/docs/2.5.2/troubleshooting-guide/index.html index 92698a50fc..fab55eed5a 100644 --- a/docs/2.5.2/troubleshooting-guide/index.html +++ b/docs/2.5.2/troubleshooting-guide/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/uninstallation/index.html b/docs/2.5.2/uninstallation/index.html index 9c70658763..bc85e67ab9 100644 --- a/docs/2.5.2/uninstallation/index.html +++ b/docs/2.5.2/uninstallation/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/upgrade-from-2.1-to-2.2/index.html b/docs/2.5.2/upgrade-from-2.1-to-2.2/index.html index 860abe906d..19910ce607 100644 --- a/docs/2.5.2/upgrade-from-2.1-to-2.2/index.html +++ b/docs/2.5.2/upgrade-from-2.1-to-2.2/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/upgrade-to-2.0/index.html b/docs/2.5.2/upgrade-to-2.0/index.html index 7940a1018e..c95d534d7c 100644 --- a/docs/2.5.2/upgrade-to-2.0/index.html +++ b/docs/2.5.2/upgrade-to-2.0/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/use-argo-to-orchestrate-chaos-experiments/index.html b/docs/2.5.2/use-argo-to-orchestrate-chaos-experiments/index.html index a9d6c51663..be97c2d00f 100644 --- a/docs/2.5.2/use-argo-to-orchestrate-chaos-experiments/index.html +++ b/docs/2.5.2/use-argo-to-orchestrate-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/2.5.2/use-grafana-data-source/index.html b/docs/2.5.2/use-grafana-data-source/index.html index ab039c301a..0f7363ae3f 100644 --- a/docs/2.5.2/use-grafana-data-source/index.html +++ b/docs/2.5.2/use-grafana-data-source/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/add-new-chaos-experiment-type/index.html b/docs/add-new-chaos-experiment-type/index.html index a691f479f5..0d5ab0aba6 100644 --- a/docs/add-new-chaos-experiment-type/index.html +++ b/docs/add-new-chaos-experiment-type/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/basic-features/index.html b/docs/basic-features/index.html index 3616d8dc6d..3d0c8eeefd 100644 --- a/docs/basic-features/index.html +++ b/docs/basic-features/index.html @@ -16,7 +16,7 @@ - + @@ -26,7 +26,7 @@

          Fault
          • Basic resource faults:
              -
            • PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod.
            • +
            • PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailability, and certain container failures in a specific Pod.
            • NetworkChaos: simulates network failures, such as network latency, packet loss, packet disorder, and network partitions.
            • DNSChaos: simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned.
            • HTTPChaos: simulates HTTP communication failures, such as HTTP communication latency.
            • diff --git a/docs/chaos-engineering-principles/index.html b/docs/chaos-engineering-principles/index.html index af6ce46e52..11b47c9ebf 100644 --- a/docs/chaos-engineering-principles/index.html +++ b/docs/chaos-engineering-principles/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/chaosctl-tool/index.html b/docs/chaosctl-tool/index.html index 8604b23d74..cd6c2c9bb5 100644 --- a/docs/chaosctl-tool/index.html +++ b/docs/chaosctl-tool/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/chaosd-overview/index.html b/docs/chaosd-overview/index.html index 25122b8fac..1a05146938 100644 --- a/docs/chaosd-overview/index.html +++ b/docs/chaosd-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/chaosd-search-recover/index.html b/docs/chaosd-search-recover/index.html index d78cc560cf..b65042f863 100644 --- a/docs/chaosd-search-recover/index.html +++ b/docs/chaosd-search-recover/index.html @@ -3,7 +3,7 @@ -Search and Recover Experiments of Chaosd | Chaos Mesh +Search and Recover Experiments of Chaosd | Chaos Mesh @@ -16,11 +16,11 @@ - + -
              Version: 2.6.4

              Search and Recover Experiments of Chaosd

              You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.

              +
              Version: 2.6.4

              Search and Recover Experiments of Chaosd

              You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.

              Search experiments of Chaosd

              This section introduces how to use command-line mode and service mode to find experiments of Chaosd.

              Search experiments using the command-line mode

              diff --git a/docs/check-workflow-status/index.html b/docs/check-workflow-status/index.html index c0141bd42e..4b22d3a250 100644 --- a/docs/check-workflow-status/index.html +++ b/docs/check-workflow-status/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/clean-up-chaos-experiments/index.html b/docs/clean-up-chaos-experiments/index.html index 7155765202..b97748ef69 100644 --- a/docs/clean-up-chaos-experiments/index.html +++ b/docs/clean-up-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/configure-development-environment/index.html b/docs/configure-development-environment/index.html index 85ed3a95c7..033b3e888d 100644 --- a/docs/configure-development-environment/index.html +++ b/docs/configure-development-environment/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/configure-enabled-namespace/index.html b/docs/configure-enabled-namespace/index.html index 1fbd9e853a..e223c21b0b 100644 --- a/docs/configure-enabled-namespace/index.html +++ b/docs/configure-enabled-namespace/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/create-chaos-mesh-workflow/index.html b/docs/create-chaos-mesh-workflow/index.html index 1c4bbb34b2..a02ad0c04f 100644 --- a/docs/create-chaos-mesh-workflow/index.html +++ b/docs/create-chaos-mesh-workflow/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/define-chaos-experiment-scope/index.html b/docs/define-chaos-experiment-scope/index.html index d509e19142..28e74b0d38 100644 --- a/docs/define-chaos-experiment-scope/index.html +++ b/docs/define-chaos-experiment-scope/index.html @@ -16,7 +16,7 @@ - + @@ -30,7 +30,7 @@

              Define the experiment scope in a YAML configuration file

              -

              This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

              +

              This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

              Namespace selectors

              • Specifies the namespace of the experiment's target Pod.
              • @@ -49,7 +49,7 @@

                Label
                spec:
                selector:
                labelSelectors:
                'app.kubernetes.io/component': 'tikv'

                Expression selectors

                  -
                • Specifies a set of expressions that define the label's rules to specifiy the experiment's target Pod.
                • +
                • Specifies a set of expressions that define the label's rules to specify the experiment's target Pod.
                • You can use this selector to set up the experiment's target Pod that does not meet some labels.

                When creating the experiment using the YAML file, you need to configure selectors. For example:

                @@ -111,7 +111,7 @@

                note

                PhysicalMachine is a CRD (CustomResourcesDefinition) that represents a physical machine. To create PhysicalMachine, Chaos Mesh uses Chaosctl.

              When creating the experiment using the YAML file, you need to configure selectors. For example:

              -
              spec:
              selector:
              physicalMachines:
              default: # namespace of the target PhysicalMachines
              - physcial-machine-a
              - physcial-machine-b
              +
              spec:
              selector:
              physicalMachines:
              default: # namespace of the target PhysicalMachines
              - physical-machine-a
              - physical-machine-b

              Define the experiment scope on Chaos Dashboard

              If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information.

              The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:

              diff --git a/docs/define-scheduling-rules/index.html b/docs/define-scheduling-rules/index.html index 32673894ec..b2ae1b59d8 100644 --- a/docs/define-scheduling-rules/index.html +++ b/docs/define-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/define-workflow-scheduling-rules/index.html b/docs/define-workflow-scheduling-rules/index.html index 4ac5b46791..93299ac028 100644 --- a/docs/define-workflow-scheduling-rules/index.html +++ b/docs/define-workflow-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/developer-guide-overview/index.html b/docs/developer-guide-overview/index.html index 4e40ae4981..66f8627c14 100644 --- a/docs/developer-guide-overview/index.html +++ b/docs/developer-guide-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/expose-dashboard-with-ingress/index.html b/docs/expose-dashboard-with-ingress/index.html index 0db080ccc9..2d61057b0d 100644 --- a/docs/expose-dashboard-with-ingress/index.html +++ b/docs/expose-dashboard-with-ingress/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/extend-chaos-daemon-interface/index.html b/docs/extend-chaos-daemon-interface/index.html index b457e950b9..139f09e413 100644 --- a/docs/extend-chaos-daemon-interface/index.html +++ b/docs/extend-chaos-daemon-interface/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/extend-chaosd/index.html b/docs/extend-chaosd/index.html index ea32b7f200..9dbc19f2a6 100644 --- a/docs/extend-chaosd/index.html +++ b/docs/extend-chaosd/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/faqs/index.html b/docs/faqs/index.html index 1c9808a327..4d2af03168 100644 --- a/docs/faqs/index.html +++ b/docs/faqs/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/gcp-authentication/index.html b/docs/gcp-authentication/index.html index ba7374255c..4b1ae2ef14 100644 --- a/docs/gcp-authentication/index.html +++ b/docs/gcp-authentication/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/glossary/index.html b/docs/glossary/index.html index 99f74ed2dd..6a0825a596 100644 --- a/docs/glossary/index.html +++ b/docs/glossary/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/go-client/index.html b/docs/go-client/index.html index aacf6bc153..38f2685bad 100644 --- a/docs/go-client/index.html +++ b/docs/go-client/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/index.html b/docs/index.html index 08ab0bf688..5a2ae7c12b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/inspect-chaos-experiments/index.html b/docs/inspect-chaos-experiments/index.html index be51eda92b..a647705f82 100644 --- a/docs/inspect-chaos-experiments/index.html +++ b/docs/inspect-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + @@ -59,7 +59,7 @@

              Fault
              • Basic resource faults:
                  -
                • PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod.
                • +
                • PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailability, and certain container failures in a specific Pod.
                • NetworkChaos: simulates network failures, such as network latency, packet loss, packet disorder, and network partitions.
                • DNSChaos: simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned.
                • HTTPChaos: simulates HTTP communication failures, such as HTTP communication latency.
                • diff --git a/docs/next/chaos-engineering-principles/index.html b/docs/next/chaos-engineering-principles/index.html index a3be40383f..6d476ff5c6 100644 --- a/docs/next/chaos-engineering-principles/index.html +++ b/docs/next/chaos-engineering-principles/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/chaosctl-tool/index.html b/docs/next/chaosctl-tool/index.html index e5ab200fb9..41758baf8b 100644 --- a/docs/next/chaosctl-tool/index.html +++ b/docs/next/chaosctl-tool/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/chaosd-overview/index.html b/docs/next/chaosd-overview/index.html index 2532812f2f..e3d7f0d25e 100644 --- a/docs/next/chaosd-overview/index.html +++ b/docs/next/chaosd-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/chaosd-search-recover/index.html b/docs/next/chaosd-search-recover/index.html index 942fd4b7ec..dc966935a4 100644 --- a/docs/next/chaosd-search-recover/index.html +++ b/docs/next/chaosd-search-recover/index.html @@ -3,7 +3,7 @@ -Search and Recover Experiments of Chaosd | Chaos Mesh +Search and Recover Experiments of Chaosd | Chaos Mesh @@ -16,11 +16,11 @@ - + -
                  Version: Next

                  Search and Recover Experiments of Chaosd

                  You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides releated examples.

                  +
                  Version: Next

                  Search and Recover Experiments of Chaosd

                  You can search experiments by conditions and recover the experiments corresponding to specified UIDs using Chaosd. This document describes how to search and recover experiments of Chaosd, and provides related examples.

                  Search experiments of Chaosd

                  This section introduces how to use command-line mode and service mode to find experiments of Chaosd.

                  Search experiments using the command-line mode

                  diff --git a/docs/next/check-workflow-status/index.html b/docs/next/check-workflow-status/index.html index cb902495fe..a68b2d4224 100644 --- a/docs/next/check-workflow-status/index.html +++ b/docs/next/check-workflow-status/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/clean-up-chaos-experiments/index.html b/docs/next/clean-up-chaos-experiments/index.html index 6b00990f93..9d8782f908 100644 --- a/docs/next/clean-up-chaos-experiments/index.html +++ b/docs/next/clean-up-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/configure-development-environment/index.html b/docs/next/configure-development-environment/index.html index 938fe065ae..bc0654043f 100644 --- a/docs/next/configure-development-environment/index.html +++ b/docs/next/configure-development-environment/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/configure-enabled-namespace/index.html b/docs/next/configure-enabled-namespace/index.html index f6e577427f..da90107737 100644 --- a/docs/next/configure-enabled-namespace/index.html +++ b/docs/next/configure-enabled-namespace/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/create-chaos-mesh-workflow/index.html b/docs/next/create-chaos-mesh-workflow/index.html index 65219ea8c4..95244b1e1b 100644 --- a/docs/next/create-chaos-mesh-workflow/index.html +++ b/docs/next/create-chaos-mesh-workflow/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/define-chaos-experiment-scope/index.html b/docs/next/define-chaos-experiment-scope/index.html index bc80c49d04..0ca325f6fc 100644 --- a/docs/next/define-chaos-experiment-scope/index.html +++ b/docs/next/define-chaos-experiment-scope/index.html @@ -16,7 +16,7 @@ - + @@ -30,7 +30,7 @@

                  Define the experiment scope in a YAML configuration file

                  -

                  This section introduces the meanings of different selector types and their the usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

                  +

                  This section introduces the meanings of different selector types and their usages, and provides the configuration examples in the YAML file. When defining the experiment scope in the YAML file, you can specify one or more selectors according to your need of scope filtering.

                  Namespace selectors

                  • Specifies the namespace of the experiment's target Pod.
                  • @@ -49,7 +49,7 @@

                    Label
                    spec:
                    selector:
                    labelSelectors:
                    'app.kubernetes.io/component': 'tikv'

                    Expression selectors

                      -
                    • Specifies a set of expressions that define the label's rules to specifiy the experiment's target Pod.
                    • +
                    • Specifies a set of expressions that define the label's rules to specify the experiment's target Pod.
                    • You can use this selector to set up the experiment's target Pod that does not meet some labels.

                    When creating the experiment using the YAML file, you need to configure selectors. For example:

                    @@ -111,7 +111,7 @@

                    note

                    PhysicalMachine is a CRD (CustomResourcesDefinition) that represents a physical machine. To create PhysicalMachine, Chaos Mesh uses Chaosctl.

                  When creating the experiment using the YAML file, you need to configure selectors. For example:

                  -
                  spec:
                  selector:
                  physicalMachines:
                  default: # namespace of the target PhysicalMachines
                  - physcial-machine-a
                  - physcial-machine-b
                  +
                  spec:
                  selector:
                  physicalMachines:
                  default: # namespace of the target PhysicalMachines
                  - physical-machine-a
                  - physical-machine-b

                  Define the experiment scope on Chaos Dashboard

                  If you use Chaos Dashboard to create a Chaos experiment, you can configure the Chaos experiment scope when filling out the experiment information.

                  The following selectors are currently available on Chaos Dashboard. You can specify one or more selectors according to the filtering requirements of the experiment scope:

                  diff --git a/docs/next/define-scheduling-rules/index.html b/docs/next/define-scheduling-rules/index.html index dcce9da5e3..7ea9225ca6 100644 --- a/docs/next/define-scheduling-rules/index.html +++ b/docs/next/define-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/define-workflow-scheduling-rules/index.html b/docs/next/define-workflow-scheduling-rules/index.html index ff8650e535..1f0f6a99ba 100644 --- a/docs/next/define-workflow-scheduling-rules/index.html +++ b/docs/next/define-workflow-scheduling-rules/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/developer-guide-overview/index.html b/docs/next/developer-guide-overview/index.html index 25c95f191d..fa7be8703a 100644 --- a/docs/next/developer-guide-overview/index.html +++ b/docs/next/developer-guide-overview/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/expose-dashboard-with-ingress/index.html b/docs/next/expose-dashboard-with-ingress/index.html index 80b316299a..85f0fc8213 100644 --- a/docs/next/expose-dashboard-with-ingress/index.html +++ b/docs/next/expose-dashboard-with-ingress/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/extend-chaos-daemon-interface/index.html b/docs/next/extend-chaos-daemon-interface/index.html index 2e5bf95b3b..20d2192683 100644 --- a/docs/next/extend-chaos-daemon-interface/index.html +++ b/docs/next/extend-chaos-daemon-interface/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/extend-chaosd/index.html b/docs/next/extend-chaosd/index.html index 9cb29c3f92..ccd269cee1 100644 --- a/docs/next/extend-chaosd/index.html +++ b/docs/next/extend-chaosd/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/faqs/index.html b/docs/next/faqs/index.html index e46e12c80b..0d2fcc6417 100644 --- a/docs/next/faqs/index.html +++ b/docs/next/faqs/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/gcp-authentication/index.html b/docs/next/gcp-authentication/index.html index 02455e7a96..20c231983a 100644 --- a/docs/next/gcp-authentication/index.html +++ b/docs/next/gcp-authentication/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/glossary/index.html b/docs/next/glossary/index.html index e94fecef02..6be12a30f5 100644 --- a/docs/next/glossary/index.html +++ b/docs/next/glossary/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/go-client/index.html b/docs/next/go-client/index.html index 3cebdafb65..ebd8141dbe 100644 --- a/docs/next/go-client/index.html +++ b/docs/next/go-client/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/index.html b/docs/next/index.html index ce2d01e5ab..3f2c020173 100644 --- a/docs/next/index.html +++ b/docs/next/index.html @@ -16,7 +16,7 @@ - + diff --git a/docs/next/inspect-chaos-experiments/index.html b/docs/next/inspect-chaos-experiments/index.html index 35e997589f..d0394f85fe 100644 --- a/docs/next/inspect-chaos-experiments/index.html +++ b/docs/next/inspect-chaos-experiments/index.html @@ -16,7 +16,7 @@ - + @@ -59,7 +59,7 @@