From 01c2cdb582eb587ba6b47475fc18e74b9ef5e172 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Fri, 6 Sep 2024 12:28:28 +0800 Subject: [PATCH] [zh] Sync #15651 update platform prereqs to use platform helm values into Chinese (#15658) * Sync #15651 update platform prereqs to use platform helm values into Chinese * fix * fix --- .../install/platform-prerequisites/index.md | 74 +++++++++++++------ .../setup/additional-setup/gateway/index.md | 43 ++++++----- .../setup/platform-setup/openshift/index.md | 2 +- 3 files changed, 76 insertions(+), 43 deletions(-) diff --git a/content/zh/docs/ambient/install/platform-prerequisites/index.md b/content/zh/docs/ambient/install/platform-prerequisites/index.md index b96e772c16..06e1e2f4e0 100644 --- a/content/zh/docs/ambient/install/platform-prerequisites/index.md +++ b/content/zh/docs/ambient/install/platform-prerequisites/index.md @@ -45,8 +45,9 @@ spec: ### k3d -如果您使用 [k3d](https://k3d.io/) 时采用默认的 Flannel CNI, -则必须在安装命令中追加一些值,因为 k3d 使用非标准位置来存放 CNI 配置和二进制文件。 +当使用 [k3d](https://k3d.io/) 与默认的 Flannel CNI 时, +您必须将正确的 `platform` 值附加到安装命令中, +因为 k3d 使用非标准位置进行 CNI 配置和二进制文件,这需要一些 Helm 覆盖。 1. 创建一个禁用 Traefik 的集群,以免与 Istio 的入口网关冲突: @@ -54,14 +55,14 @@ spec: $ k3d cluster create --api-port 6550 -p '9080:80@loadbalancer' -p '9443:443@loadbalancer' --agents 2 --k3s-arg '--disable=traefik@server:*' {{< /text >}} -1. 在安装 Istio 时设置 `cniConfDir` 和 `cniBinDir` 值。例如: +1. 安装 Istio Chart 时设置 `global.platform=k3d`。例如: {{< tabset category-name="install-method" >}} {{< tab name="Helm" category-value="helm" >}} {{< text syntax=bash >}} - $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --wait --set cniConfDir=/var/lib/rancher/k3s/agent/etc/cni/net.d --set cniBinDir=/bin + $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --set global.platform=k3d --wait {{< /text >}} {{< /tab >}} @@ -69,7 +70,7 @@ spec: {{< tab name="istioctl" category-value="istioctl" >}} {{< text syntax=bash >}} - $ istioctl install --set profile=ambient --set values.cni.cniConfDir=/var/lib/rancher/k3s/agent/etc/cni/net.d --set values.cni.cniBinDir=/bin + $ istioctl install --set profile=ambient --set values.global.platform=k3d {{< /text >}} {{< /tab >}} @@ -78,11 +79,34 @@ spec: ### K3s -当使用 [K3s](https://k3s.io/) 及其捆绑的 CNI 之一时, -您必须在安装命令中追加一些值,这是因为 K3s 使用非标准位置来存放 CNI 配置和二进制文件。 -根据 K3s 文档,这些非标准位置也可能会被覆盖。如果您将 K3s 与自定义的非捆绑 CNI 一起使用, -则必须为这些 CNI 使用正确的路径,例如 `/etc/cni/net.d` - -[有关细节请参阅 K3s 文档](https://docs.k3s.io/zh/networking/basic-network-options#custom-cni)。例如: +使用 [K3s](https://k3s.io/) 及其绑定的 CNI 之一时, +您必须将正确的 `platform` 值附加到安装命令中, +因为 K3s 对 CNI 配置和二进制文件使用非标准位置,这需要一些 Helm 覆盖。 +对于默认的 K3s 路径,Istio 根据 `global.platform` 值提供内置覆盖。 + +{{< tabset category-name="install-method" >}} + +{{< tab name="Helm" category-value="helm" >}} + + {{< text syntax=bash >}} + $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --set global.platform=k3s --wait + {{< /text >}} + +{{< /tab >}} + +{{< tab name="istioctl" category-value="istioctl" >}} + + {{< text syntax=bash >}} + $ istioctl install --set profile=ambient --set values.global.platform=k3s + {{< /text >}} + +{{< /tab >}} + +{{< /tabset >}} + +但是,根据 K3s 文档,这些位置可能会在 K3s 中被覆盖。 +如果您将 K3s 与自定义、非捆绑的 CNI 一起使用,则必须手动为这些 CNI 指定正确的路径, +比如 `/etc/cni/net.d` - [有关详细信息,请参阅 K3s 文档](https://docs.k3s.io/zh/networking/basic-network-options#custom-cni)。例如: {{< tabset category-name="install-method" >}} @@ -106,16 +130,16 @@ spec: ### MicroK8s -如果您在 [MicroK8s](https://microk8s.io/) 上安装 Istio, -则必须在安装命令后附加一个值,因为 MicroK8s -[使用非标准位置来存放 CNI 配置和二进制文件](https://microk8s.io/docs/change-cidr)。例如: +如果您要在 [MicroK8s](https://microk8s.io/) 上安装 Istio, +则必须在安装命令中附加正确的 `platform` 值, +因为 MicroK8s [使用非标准位置来存放 CNI 配置和二进制文件](https://microk8s.io/docs/change-cidr)。例如: {{< tabset category-name="install-method" >}} {{< tab name="Helm" category-value="helm" >}} {{< text syntax=bash >}} - $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --wait --set cniConfDir=/var/snap/microk8s/current/args/cni-network --set cniBinDir=/var/snap/microk8s/current/opt/cni/bin + $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --set global.platform=microk8s --wait {{< /text >}} @@ -124,7 +148,7 @@ spec: {{< tab name="istioctl" category-value="istioctl" >}} {{< text syntax=bash >}} - $ istioctl install --set profile=ambient --set values.cni.cniConfDir=/var/snap/microk8s/current/args/cni-network --set values.cni.cniBinDir=/var/snap/microk8s/current/opt/cni/bin + $ istioctl install --set profile=ambient --set values.global.platform=microk8s {{< /text >}} {{< /tab >}} @@ -135,14 +159,15 @@ spec: 如果您正在使用 [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) 和 [Docker 驱动程序](https://minikube.sigs.k8s.io/docs/drivers/docker/), -则必须在安装命令中追加一些值,以便 Istio CNI 节点代理可以正确管理和捕获节点上的 Pod。例如: +您必须将正确的 `platform` 值附加到安装命令中, +因为带有 Docker 的 minikube 使用非标准的容器绑定挂载路径。例如: {{< tabset category-name="install-method" >}} {{< tab name="Helm" category-value="helm" >}} {{< text syntax=bash >}} - $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --wait --set cniNetnsDir="/var/run/docker/netns" + $ helm install istio-cni istio/cni -n istio-system --set profile=ambient --set global.platform=minikube --wait" {{< /text >}} {{< /tab >}} @@ -150,25 +175,28 @@ spec: {{< tab name="istioctl" category-value="istioctl" >}} {{< text syntax=bash >}} - $ istioctl install --set profile=ambient --set cni.cniNetnsDir="/var/run/docker/netns" + $ istioctl install --set profile=ambient --set values.global.platform=minikube" {{< /text >}} {{< /tab >}} {{< /tabset >}} -### Red Hat OpenShift +### Red Hat OpenShift {#red-hat-openshift} -OpenShift 要求在 `kube-system` 命名空间中安装 `ztunnel` 和 `istio-cni` 组件。 -如果提供了 `openshift-ambient` 安装配置文件,它将为您进行此更改。 -在安装命令中将 `profile=ambient` 实例替换为 `profile=openshift-ambient`。例如: +OpenShift 要求在 `kube-system` 命名空间中安装 `ztunnel` 和 `istio-cni` 组件, +并且要求为所有 Chart 设置 `global.platform=openshift`。 + +如果您使用 `helm`,您可以直接设置目标命名空间和 `global.platform` 值。 + +如果您使用 `istioctl`,则必须使用名为 `openshift-ambient` 的特殊配置文件来完成相同的操作。 {{< tabset category-name="install-method" >}} {{< tab name="Helm" category-value="helm" >}} {{< text syntax=bash >}} - $ helm install istio-cni istio/cni -n istio-system --set profile=openshift-ambient --wait + $ helm install istio-cni istio/cni -n kube-system --set profile=ambient --set global.platform=openshift --wait {{< /text >}} {{< /tab >}} diff --git a/content/zh/docs/setup/additional-setup/gateway/index.md b/content/zh/docs/setup/additional-setup/gateway/index.md index 862ad491fc..37cd6a9e17 100644 --- a/content/zh/docs/setup/additional-setup/gateway/index.md +++ b/content/zh/docs/setup/additional-setup/gateway/index.md @@ -20,8 +20,9 @@ test: yes Istio 内置的一些[配置文件](/zh/docs/setup/additional-setup/config-profiles/)在安装期间部署网关。 例如通过[默认设置](/zh/docs/setup/install/istioctl/#install-istio-using-the-default-profile)对 `istioctl install` 的调用将部署 Ingress 网关和控制面。 -尽管在评估和简单使用场景中这个够用了,但耦合到控制面的网关后,会让管理和升级变得复杂。 -对于生产环境中的 Istio 部署,强烈推荐将这些解耦,以便进行独立的操作。 +尽管在评估和简单使用场景中这个够用了,但耦合到控制面的网关后, +会让管理和升级变得复杂。对于生产环境中的 Istio 部署, +强烈推荐将这些解耦,以便进行独立的操作。 遵循本指南在 Istio 的生产安装环境中分别部署和管理一个或多个网关。 @@ -39,7 +40,8 @@ Istio 内置的一些[配置文件](/zh/docs/setup/additional-setup/config-profi 使用与 [Istio Sidecar 注入](/zh/docs/setup/additional-setup/sidecar-injection/#automatic-sidecar-injection)相同的机制, 可以用类似的方式自动注入网关所用的 Envoy 代理配置。 -对于网关 Deployment 推荐使用自动注入,因为这样可以让开发者完全控制网关 Deployment,简化了操作。 +对于网关 Deployment 推荐使用自动注入, +因为这样可以让开发者完全控制网关 Deployment,简化了操作。 当新的升级可用时或配置发生变化时,只需重启就能更新网关 Pod。 这使得操作网关 Deployment 的体验与操作 Sidecar 的体验相同。 @@ -51,8 +53,8 @@ Istio 内置的一些[配置文件](/zh/docs/setup/additional-setup/config-profi {{< /tip >}} 以下列出的所有方法均依赖于[注入](/zh/docs/setup/additional-setup/sidecar-injection/), -在运行时填充附加的 Pod 设置。 -为此,部署网关所在的命名空间不得带有 `istio-injection=disabled` 标签。 +在运行时填充附加的 Pod 设置。为此, +部署网关所在的命名空间不得带有 `istio-injection=disabled` 标签。 如果带有此标签,您会看到 Pod 在尝试拉取 `auto` 镜像时失败, 此镜像是创建 Pod 时将要替换的占位符。 @@ -108,10 +110,11 @@ Helm 代码仓库中的 [README](https://artifacthub.io/packages/helm/istio-offi {{< tip >}} -在一个 OpenShift 集群中部署网关时,请使用 `openshift` 配置文件覆盖默认值,例如: +在一个 OpenShift 集群中部署网关时, +请使用 `openshift` 配置文件覆盖默认值,例如: {{< text bash >}} -$ helm install istio-ingressgateway istio/gateway -n istio-ingress --set profile=openshift +$ helm install istio-ingressgateway istio/gateway -n istio-ingress --set global.platform=openshift {{< /text >}} {{< /tip >}} @@ -201,8 +204,8 @@ subjects: {{< warning >}} 本例显示了让网关运行所需的最小资源。对于生产环境, -推荐进行 `HorizontalPodAutoscaler`、`PodDisruptionBudget` 和资源请求/限制等更多配置。 -这些会在使用其他网关安装方法时自动完成配置。 +推荐进行 `HorizontalPodAutoscaler`、`PodDisruptionBudget` +和资源请求/限制等更多配置。这些会在使用其他网关安装方法时自动完成配置。 {{< /warning >}} {{< tip >}} @@ -225,8 +228,8 @@ $ kubectl apply -f ingress.yaml ## 管理网关 {#manage-gateway} 本节说明了如何在安装之后管理网关。有关具体用法的更多信息,请参阅 -[Ingress](/zh/docs/tasks/traffic-management/ingress/) 和 -[Egress](/zh/docs/tasks/traffic-management/egress/) 任务。 +[Ingress](/zh/docs/tasks/traffic-management/ingress/) +和 [Egress](/zh/docs/tasks/traffic-management/egress/) 任务。 ### Gateway 选择算符 {#gateway-selectors} @@ -289,12 +292,13 @@ IP 地址,这可能会让 DNS 配置变得复杂。 ### 金丝雀升级 {#canary-upgrade-advanced} {{< warning >}} -此升级方法取决于控制面修订版,且因此只能结合[控制面金丝雀升级](/zh/docs/setup/upgrade/canary/)一起使用。 +此升级方法取决于控制面修订版, +且因此只能结合[控制面金丝雀升级](/zh/docs/setup/upgrade/canary/)一起使用。 {{< /warning >}} -如果想要延后新控制面修订版的发版时间,您可以运行多个版本的网关 Deployment。 -例如如果您想要推出一个新修订版 `canary`,可以设置 `istio.io/rev=canary` -标签后创建网关 Deployment 的副本。 +如果想要延后新控制面修订版的发版时间, +您可以运行多个版本的网关 Deployment。例如如果您想要推出一个新修订版 `canary`, +可以设置 `istio.io/rev=canary` 标签后创建网关 Deployment 的副本。 {{< text yaml >}} apiVersion: apps/v1 @@ -331,8 +335,8 @@ istio-ingressgateway istio-ingressgateway-...,istio-ingressgateway-canary-... 与网格内部署的应用程序服务不同,您不能使用 [Istio 流量转移](/zh/docs/tasks/traffic-management/traffic-shifting/)在网格版本之间分发流量, -因为流量直接来自 Istio 控制之外的外部客户端。 -作为替代方案,您可以通过每个 Deployment 的副本数来控制流量的分发。 +因为流量直接来自 Istio 控制之外的外部客户端。作为替代方案, +您可以通过每个 Deployment 的副本数来控制流量的分发。 如果您在 Istio 之前使用另一个负载均衡器,您还可以使用此负载均衡器来控制流量分发。 {{< warning >}} @@ -340,9 +344,10 @@ istio-ingressgateway istio-ingressgateway-...,istio-ingressgateway-canary-... [Kubernetes YAML](/zh/docs/setup/additional-setup/gateway/#tabset-docs-setup-additional-setup-gateway-1-2-tab) 方法。 {{< /warning >}} -### 通过外部流量转移进行金丝雀升级(高级){#canary-upgrade-with-external-traffic-shifting} +### 通过外部流量转移进行金丝雀升级(高级) {#canary-upgrade-with-external-traffic-shifting} -[金丝雀升级](#canary-upgrade)的各种方法在 Istio 外使用高级组件(例如外部负载均衡器或 DNS)在各版本之间转移流量。 +[金丝雀升级](#canary-upgrade-advanced)的各种方法在 Istio +外使用高级组件(例如外部负载均衡器或 DNS)在各版本之间转移流量。 {{< image width="50%" link="high-level-canary.svg" caption="正在用外部流量转移进行金丝雀升级" >}} diff --git a/content/zh/docs/setup/platform-setup/openshift/index.md b/content/zh/docs/setup/platform-setup/openshift/index.md index 1676b3ed69..21e4421129 100644 --- a/content/zh/docs/setup/platform-setup/openshift/index.md +++ b/content/zh/docs/setup/platform-setup/openshift/index.md @@ -16,7 +16,7 @@ test: no 使用 OpenShift 配置文件进行安装 Istio: {{< text bash >}} -$ istioctl install --set profile=openshift +$ istioctl install --set global.platform=openshift {{< /text >}} 安装 Istio 完成后,通过以下命令为 Ingress Gateway 暴露 OpenShift 路由: