diff --git a/content/zh/docs/application-store/external-apps/deploy-chaos-mesh.md b/content/zh/docs/application-store/external-apps/deploy-chaos-mesh.md new file mode 100644 index 000000000..af0ff2e3d --- /dev/null +++ b/content/zh/docs/application-store/external-apps/deploy-chaos-mesh.md @@ -0,0 +1,93 @@ +--- +title: "在 KubeSphere 中部署 Chaos Mesh" +keywords: 'KubeSphere, Kubernetes, Chaos Mesh, Chaos Engineering' +description: '了解如何在 KubeSphere 中部署 Chaos Mesh 并进行混沌实验。' +linkTitle: "部署 Chaos Mesh" +--- + +[Chaos Mesh](https://github.com/chaos-mesh/chaos-mesh) 是一个开源的云原生混沌工程平台,提供丰富的故障模拟类型,具有强大的故障场景编排能力,方便用户在开发测试中以及生产环境中模拟现实世界中可能出现的各类异常,帮助用户发现系统潜在的问题。 + +![Chaos Mesh architecture](/images/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-architecture-v2.png) + +本教程演示了如何在 KubeSphere 上部署 Chaos Mesh 进行混沌实验。 + +## **准备工作** + +* 部署 [KubeSphere 应用商店](https://kubesphere.io/zh/docs/pluggable-components/app-store/) +* 您需要为本教程创建一个企业空间、一个项目和两个帐户(ws-admin 和 project-regular)。帐户 ws-admin 必须在企业空间中被赋予 workspace-admin 角色,帐户 project-regular 必须被邀请至项目中赋予 operator 角色。若还未创建好,请参考[创建企业空间、项目、用户和角色](https://kubesphere.io/zh/docs/quick-start/create-workspace-and-project/)。 + + +## **开始混沌实验** + +### 步骤1: 部署 Chaos Mesh + +1. 使用 `project-regular` 身份登陆,在应用市场中搜索 `chaos-mesh`,点击搜索结果进入应用。 + + ![Chaos Mesh app](/images/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-app.png) + + +2. 进入应用信息页后,点击右上角**安装**按钮。 + + ![Install Chaos Mesh](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/install-chaos-mesh.png) + +3. 进入应用设置页面,可以设置应用**名称**(默认会随机一个唯一的名称)和选择安装的**位置**(对应的 Namespace) 和**版本**,然后点击右上角**下一步**。 + + ![Chaos Mesh basic information](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-basic-info.png) + +4. 根据实际需要编辑 `values.yaml` 文件,也可以直接点击**安装**使用默认配置。 + + ![Chaos Mesh configurations](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-config.png) + +5. 等待 Chaos Mesh 开始正常运行。 + + ![Chaos Mesh deployed](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployed.png) + +6. 访问**应用负载**, 可以看到 Chaos Mesh 创建的三个部署。 + + ![Chaos Mesh deployments](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployments.png) + +### 步骤 2: 访问 Chaos Mesh + +1. 前往**应用负载**下服务页面,复制 chaos-dashboard 的 **NodePort**。 + + ![Chaos Mesh NodePort](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-nodeport.png) + +2. 您可以通过 `${NodeIP}:${NODEPORT}` 方式访问 Chaos Dashboard。并参考[管理用户权限](https://chaos-mesh.org/zh/docs/manage-user-permissions/)文档,生成 Token,并登陆 Chaos Dashboard。 + + ![Login to Chaos Dashboard](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/login-to-dashboard.png) + +### 步骤 3: 创建混沌实验 + +1. 在开始混沌实验之前,需要先确定并部署您的实验目标,比如,测试某应用在网络延时下的工作状态。本文使用了一个 demo 应用 `web-show` 作为待测试目标,观测系统网络延迟。 你可以使用下面命令部署一个 Demo 应用 `web-show` : + + ```bash + curl -sSL https://mirrors.chaos-mesh.org/latest/web-show/deploy.sh | bash + ``` + + {{< notice note >}} + + web-show 应用页面上可以直接观察到自身到 kube-system 命名空间下 Pod 的网络延迟。 + + {{}} + +2. 访问 **web-show** 应用程序。从您的网络浏览器,进入 `${NodeIP}:8081`。 + + ![Chaos Mesh web show app](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/web-show-app.png) + +3. 登陆 Chaos Dashboard 创建混沌实验,为了更好的观察混沌实验效果,这里只创建一个独立的混沌实验,混沌实验的类型选择**网络攻击**,模拟网络延迟的场景: + + ![Chaos Dashboard](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-dashboard-networkchaos.png) + + 实验范围设置为 web-show 应用: + + ![Chaos Experiment scope](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/chaos-experiment-scope.png) + +4. 提交混沌实验后,查看实验状态: + + ![Chaos Experiment status](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/experiment-status.png) + +5. 访问 web-show 应用观察实验结果 : + + ![Chaos Experiment result](/images/zh-cn/docs/appstore/external-apps/deploy-chaos-mesh/experiment-result.png) + +更多详情参考 [Chaos Mesh 使用文档](https://chaos-mesh.org/zh/docs/)。 \ No newline at end of file diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-dashboard-networkchaos.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-dashboard-networkchaos.png new file mode 100644 index 000000000..566869282 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-dashboard-networkchaos.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-experiment-scope.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-experiment-scope.png new file mode 100644 index 000000000..d9ea4c933 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-experiment-scope.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-app.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-app.png new file mode 100644 index 000000000..149b52cc5 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-app.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-basic-info.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-basic-info.png new file mode 100644 index 000000000..02d469e7e Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-basic-info.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-config.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-config.png new file mode 100644 index 000000000..7265ffc1e Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-config.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployed.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployed.png new file mode 100644 index 000000000..f3bf39e16 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployed.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployments.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployments.png new file mode 100644 index 000000000..51ba2b22f Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-deployments.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-nodeport.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-nodeport.png new file mode 100644 index 000000000..91a43cc18 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/chaos-mesh-nodeport.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/experiment-result.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/experiment-result.png new file mode 100644 index 000000000..2c3cfad42 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/experiment-result.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/experiment-status.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/experiment-status.png new file mode 100644 index 000000000..5c12e48c4 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/experiment-status.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/install-chaos-mesh.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/install-chaos-mesh.png new file mode 100644 index 000000000..c85b4598a Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/install-chaos-mesh.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/login-to-dashboard.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/login-to-dashboard.png new file mode 100644 index 000000000..7af4952ed Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/login-to-dashboard.png differ diff --git a/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/web-show-app.png b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/web-show-app.png new file mode 100644 index 000000000..4f7969400 Binary files /dev/null and b/static/images/docs/zh-cn/appstore/external-apps/deploy-chaos-mesh/web-show-app.png differ