diff --git a/content/zh/docs/pluggable-components/service-mesh.md b/content/zh/docs/pluggable-components/service-mesh.md index 9b0bfa5af..c677eaad2 100644 --- a/content/zh/docs/pluggable-components/service-mesh.md +++ b/content/zh/docs/pluggable-components/service-mesh.md @@ -1,6 +1,6 @@ --- title: "KubeSphere 服务网格" -keywords: "Kubernetes, istio, KubeSphere, service-mesh, microservices" +keywords: "Kubernetes, Istio, KubeSphere, 服务网格, 微服务" description: "如何启用 KubeSphere 服务网格" linkTitle: "KubeSphere 服务网格" @@ -9,102 +9,95 @@ weight: 6800 ## 什么是 KubeSphere 服务网格 -在 [Istio](https://istio.io/) 的基础上,KubeSphere 服务网格将微服务治理和流量管理可视化。它拥有强大的工具包,包括**断路、蓝绿部署、金丝雀发布、流量镜像、分布式跟踪、可观察性和流量控制**。开发者无需任何代码黑客,即可轻松上手服务网格,Istio 的学习曲线大大降低。KubeSphere 服务网格的所有功能都是为了满足用户的业务需求。 +在 [Istio](https://istio.io/) 的基础上,KubeSphere 服务网格将微服务治理和流量管理可视化。它拥有强大的工具包,包括**断路、蓝绿部署、金丝雀发布、流量镜像、分布式追踪、可观察性和流量控制**等。开发者无需植入任何代码,即可轻松上手服务网格,Istio 的学习曲线大大降低。KubeSphere 服务网格的所有功能都旨在满足用户的业务需求。 -更多信息请参见项目管理与使用中的相关章节。 +有关更多信息,请参见[灰度发布](../../project-user-guide/grayscale-release/overview/)。 ## 在安装前启用服务网格 ### 在 Linux 上安装 -当您在 Linux 上安装 KubeSphere 时,你需要创建一个配置文件,该文件列出了所有 KubeSphere 组件。 +当您在 Linux 上安装多节点 KubeSphere 时,需要创建一个配置文件,该文件列出了所有 KubeSphere 组件。 -1. 基于[在 Linux 上安装 KubeSphere](.../.../installing-on-linux/introduction/multioverview/) 的教程,您创建了一个默认文件 **config-sample.yaml**。通过执行以下命令修改该文件: +1. 基于[在 Linux 上安装 KubeSphere](../../installing-on-linux/introduction/multioverview/) 的教程,您需要创建一个默认文件 `config-sample.yaml`。执行以下命令修改该文件: -```bash -vi config-sample.yaml -``` + ```bash + vi config-sample.yaml + ``` -{{< notice note >}} - -如果采用 [All-in-one 安装](.../.../quick-start/all-in-one-on-linux/),则不需要创建 `config-sample.yaml` 文件,因为可以直接创建集群。一般来说,All-in-one 模式是为那些刚刚接触 KubeSphere 并希望熟悉系统的用户准备的。如果您想在这个模式下启用服务网格(比如出于测试的目的),可以参考下面的部分,看看安装后如何启用服务网格。 - -{{}} + {{< notice note >}} +如果您采用 [All-in-One 安装](../../quick-start/all-in-one-on-linux/),则不需要创建 `config-sample.yaml` 文件,因为可以直接创建集群。一般来说,All-in-One 模式是为那些刚接触 KubeSphere 并希望熟悉系统的用户而准备的。如果您想在该模式下启用服务网格(例如用于测试),请参考[下面的部分](#在安装后启用服务网格),查看如何在安装后启用服务网格。 + {{}} 2. 在该文件中,搜寻到 `servicemesh`,并将 `enabled` 的 `false` 改为 `true`。完成后保存文件。 -```bash -servicemesh: - enabled: true # Change "false" to "true" -``` + ```yaml + servicemesh: + enabled: true # Change "false" to "true" + ``` -3. 使用配置文件创建一个集群: +3. 使用配置文件创建集群: -```bash -./kk create cluster -f config-sample.yaml -``` + ```bash + ./kk create cluster -f config-sample.yaml + ``` ### 在 Kubernetes 上安装 -在 Kubernetes 上安装 KubeSphere 时,需要下载文件 [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) 进行集群设置。如果要安装网络策略,不要直接使用 `kubectl apply -f` 对这个文件进行设置。 +在 Kubernetes 上安装 KubeSphere 的过程和教程[在 Kubernetes 上安装 KubeSphere](../../installing-on-kubernetes/introduction/overview/) 中的说明大致相同,不同之处是需要先在 [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) 文件中启用服务网格(可选组件)。 -1. 参照[在 Kubernetes 上安装 KubeSphere](.../.../installing-on-kubernetes/introduction/overview/) 的教程,先对文件 [kubesphere-installer.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml) 执行 `kubectl apply -f`。之后,为了启用服务网格,创建一个本地文件 `cluster-configuration.yaml`。 +1. 下载 [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) 文件,然后打开并开始编辑。 -```bash -vi cluster-configuration.yaml -``` + ```bash + vi cluster-configuration.yaml + ``` -2. 将 [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) 文件中的所有内容复制到刚才创建的本地文件中。 - -3. 在这个本地 `cluster-configuration.yaml` 文件中,搜寻到 `servicemesh`,并将 `enabled` 的 `false` 改为 `true`,启用它们。完成后保存文件。 +2. 在该本地 `cluster-configuration.yaml` 文件中,搜寻到 `servicemesh`,并将 `enabled` 的 `false` 改为 `true`,启用该功能。完成后保存文件。 -```bash -servicemesh: - enabled: true # Change "false" to "true" -``` + ```yaml + servicemesh: + enabled: true # Change "false" to "true" + ``` -4. 执行以下命令开始安装: +3. 执行以下命令开始安装: -```bash -kubectl apply -f cluster-configuration.yaml -``` + ```bash + kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml + + kubectl apply -f cluster-configuration.yaml + ``` ## 在安装后启用服务网格 1. 以 `admin` 身份登录控制台。点击左上角的**平台管理**,选择**集群管理**。 + + ![集群管理](/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/clusters-management.png) + +2. 点击**自定义资源 CRD**,在搜索栏中输入 `clusterconfiguration`。点击结果查看其详细页面。 -![集群管理](https://ap3.qingstor.com/kubesphere-website/docs/20200828111130.png) + {{< notice info >}} +自定义资源定义 (CRD) 允许用户在不新增 API 服务器的情况下创建一种新的资源类型,用户可以像使用其他 Kubernetes 原生对象一样使用这些自定义资源。 + {{}} -2. 点击 **自定义资源 CRD**,在搜索栏中输入 `clusterconfiguration`。点击结果查看其详细页面。 +3. 在**资源列表**中,点击 `ks-installer` 右边的三个点,选择**编辑配置文件**。 + ![编辑 YAML](/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/edit-yaml.PNG) -{{< notice info >}} +4. 在该 YAML 文件中,搜寻到 `servicemesh`,将 `enabled` 的 `false` 改为 `true`。完成后,点击右下角的**更新**,保存配置。 -自定义资源定义(CRD)允许用户在不增加另一个 API 服务器的情况下创建一种新的资源类型。他们可以像其他任何本地 Kubernetes 对象一样使用这些资源。 + ```yaml + servicemesh: + enabled: true # Change "false" to "true" + ``` -{{}} +5. 您可以执行以下命令,使用 Web Kubectl 工具来检查安装过程: -3. 在**资源列表**中,点击 `ks-installer` 右边的三个点,选择**编辑 YAML**。 + ```bash + kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f + ``` -![编辑 YAML](https://ap3.qingstor.com/kubesphere-website/docs/20200827182002.png) - -4. 在这个 YAML 文件中,搜寻到 `servicemesh`,将 `enabled` 的 `false` 改为 `true`。完成后,点击右下角的**更新**,保存配置。 - -```bash -servicemesh: - enabled: true # Change "false" to "true" -``` - -5. 您可以通过执行以下命令,使用 Web Kubectl 工具来检查安装过程: - -```bash -kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath='{.items[0].metadata.name}') -f -``` - -{{< notice tip >}} - -您可以通过点击控制台右下角的锤子图标找到 Kubectl 工具。 - -{{}} + {{< notice tip >}} +您可以通过点击控制台右下角的锤子图标找到 Web Kubectl 工具。 + {{}} ## 验证组件的安装 @@ -112,9 +105,9 @@ kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app= {{< tab "在仪表板中验证组件的安装" >}} -进入**服务组件**,检查 Logging 的状态。你可能会看到如下图片: +进入**服务组件**,查看 **Istio** 的状态。您可能会看到如下图所示的界面: -![Istio](https://ap3.qingstor.com/kubesphere-website/docs/20200829130918.png) +![Istio](/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/Istio.PNG) {{}} diff --git a/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/Istio.PNG b/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/Istio.PNG new file mode 100644 index 000000000..8b7ab2421 Binary files /dev/null and b/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/Istio.PNG differ diff --git a/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/clusters-management.png b/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/clusters-management.png new file mode 100644 index 000000000..ee8935e1c Binary files /dev/null and b/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/clusters-management.png differ diff --git a/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/edit-yaml.PNG b/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/edit-yaml.PNG new file mode 100644 index 000000000..0475c20ea Binary files /dev/null and b/static/images/docs/zh-cn/enable-pluggable-components/kubesphere-service-mesh/edit-yaml.PNG differ