mirror of https://github.com/istio/istio.io.git
* Sync #15483 part of improve ambient docs into Chinese * translate
This commit is contained in:
parent
c78bf1dc30
commit
6617af8468
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
title: 平台特定先决条件
|
||||
description: 在 Ambient 模式下安装 Istio 的平台特定先决条件。
|
||||
weight: 4
|
||||
weight: 2
|
||||
aliases:
|
||||
- /zh/docs/ops/ambient/install/platform-prerequisites
|
||||
- /zh/latest/docs/ops/ambient/install/platform-prerequisites
|
||||
|
@ -9,83 +9,180 @@ owner: istio/wg-environments-maintainers
|
|||
test: no
|
||||
---
|
||||
|
||||
本文档涵盖了在 Ambient 模式下安装 Istio 的任何特定于平台或环境的先决条件。
|
||||
本文档涵盖了在 Ambient 模式下安装 Istio 的任何平台或环境特定的先决条件。
|
||||
|
||||
## 平台 {#platform}
|
||||
|
||||
某些 Kubernetes 环境需要您设置各种 Istio 配置选项来支持它们。
|
||||
|
||||
### Google Kubernetes Engine(GKE) {#google-kubernetes-engine-gke}
|
||||
|
||||
1. 在 GKE 上,具有 [system-node-critical](https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/)
|
||||
`priorityClassName` 的 Istio 组件只能被安装在定义了[资源配额](https://kubernetes.io/zh-cn/docs/concepts/policy/resource-quotas/)的命名空间中。
|
||||
默认情况下,在 GKE 中,只有 `kube-system` 为 `node-critical`
|
||||
类定义了资源配额。`istio-cni` 和 `ztunnel` 都需要 `node-ritic` 类,
|
||||
因此在 GKE 中,这两个组件需要:
|
||||
在 GKE 上,具有 [system-node-critical](https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/)
|
||||
`priorityClassName` 的 Istio 组件只能安装在定义了 [ResourceQuota](https://kubernetes.io/zh-cn/docs/concepts/policy/resource-quotas/)
|
||||
的命名空间中。默认情况下,在 GKE 中,只有 `kube-system` 为 `node-critical` 类定义了 ResourceQuota。
|
||||
Istio CNI 节点代理和 `ztunnel` 都需要 `node-critical` 类,因此在 GKE 中,两个组件都必须满足以下任一条件:
|
||||
|
||||
- 被安装到 `kube-system`(**不是** `istio-system`)
|
||||
- 被安装到另一个已手动创建资源配额的命名空间中(如 `istio-system`),例如:
|
||||
- 安装到 `kube-system`(**不是** `istio-system`)
|
||||
- 安装到另一个已手动创建 ResourceQuota 的命名空间(如 `istio-system`),例如:
|
||||
|
||||
{{< text syntax=yaml snip_id=none >}}
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: gcp-critical-pods
|
||||
namespace: istio-system
|
||||
spec:
|
||||
hard:
|
||||
pods: 1000
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- operator: In
|
||||
scopeName: PriorityClass
|
||||
values:
|
||||
- system-node-critical
|
||||
{{< /text >}}
|
||||
{{< text syntax=yaml >}}
|
||||
apiVersion: v1
|
||||
kind: ResourceQuota
|
||||
metadata:
|
||||
name: gcp-critical-pods
|
||||
namespace: istio-system
|
||||
spec:
|
||||
hard:
|
||||
pods: 1000
|
||||
scopeSelector:
|
||||
matchExpressions:
|
||||
- operator: In
|
||||
scopeName: PriorityClass
|
||||
values:
|
||||
- system-node-critical
|
||||
{{< /text >}}
|
||||
|
||||
### Minikube {#minikube}
|
||||
### k3d {#k3d}
|
||||
|
||||
1. 如果您使用 [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)
|
||||
以及 [Docker 驱动](https://minikube.sigs.k8s.io/docs/drivers/docker/),
|
||||
必须在 `helm install` 命令后追加 `--set cni.cniNetnsDir="/var/run/docker/netns"`,
|
||||
以便 `istio-cni` 节点代理能够正确管理和捕获节点上的 Pod。
|
||||
如果您将 [k3d](https://k3d.io/) 与默认 Flannel CNI 结合使用,
|
||||
则必须在安装命令中附加一些值,因为 k3d 使用非标准位置来存储 CNI 配置和二进制文件。
|
||||
|
||||
### MicroK8s {#microk8s}
|
||||
|
||||
1. 如果您使用的是 [MicroK8s](https://microk8s.io/),
|
||||
由于 MicroK8s [对于 CNI 配置和二进制文件使用了非标准位置](https://microk8s.io/docs/change-cidr),
|
||||
则必须在 `helm install` 命令附加
|
||||
`--set values.cni.cniConfDir=/var/snap/microk8s/current/args/cni-network --set values.cni.cniBinDir=/var/snap/microk8s/current/opt/cni/bin`。
|
||||
|
||||
### K3D {#k3d}
|
||||
|
||||
1. 如果您使用 [k3d](https://k3d.io/) 和默认的 flannel CNI,
|
||||
则必须在您的 `istioctl install` 或 `helm install` 命令中附加
|
||||
`--set values.cni.cniConfDir=/var/lib/rancher/k3s/agent/etc/cni/net.d --set values.cni.cniBinDir=/bin/`
|
||||
以使用 `ambient` 配置文件安装 Istio。
|
||||
|
||||
1. 创建一个集群并禁用 `Traefik`,这样它就不会与 Istio 的入口网关冲突:
|
||||
1. 创建一个禁用 Traefik 的集群,以免与 Istio 的入口网关冲突:
|
||||
|
||||
{{< text bash >}}
|
||||
$ k3d cluster create --api-port 6550 -p '9080:80@loadbalancer' -p '9443:443@loadbalancer' --agents 2 --k3s-arg '--disable=traefik@server:*'
|
||||
{{< /text >}}
|
||||
|
||||
1. 使用 `istioctl` 通过 `ambient` 配置文件安装 Istio:
|
||||
1. 在安装 Istio 时设置 `cniConfDir` 和 `cniBinDir` 值。例如:
|
||||
|
||||
{{< text bash >}}
|
||||
$ istioctl install --set profile=ambient --skip-confirmation --set values.cni.cniConfDir=/var/lib/rancher/k3s/agent/etc/cni/net.d --set values.cni.cniBinDir=/bin
|
||||
{{< 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
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< 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
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabset >}}
|
||||
|
||||
### K3s {#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)。例如:
|
||||
|
||||
{{< 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=/var/lib/rancher/k3s/data/current/bin/
|
||||
{{< /text >}}
|
||||
|
||||
### K3S {#k3s}
|
||||
{{< /tab >}}
|
||||
|
||||
1. 如果您使用 [K3S](https://k3s.io/) 及其捆绑的 CNI 之一,
|
||||
则必须在 `helm install` 命令中附加
|
||||
`--set values.cni.cniConfDir=/var/lib/rancher/k3s/agent/etc/cni/net.d --set values.cni.cniBinDir=/var/lib/rancher/k3s/data/current/bin/`,
|
||||
因为 K3S 使用非标准位置来存储 CNI 配置和二进制文件。
|
||||
[根据 K3S 文档](https://docs.k3s.io/zh/cli/server#k3s-server-cli-%E5%B8%AE%E5%8A%A9)这些非标准位置也可以被覆盖。
|
||||
如果您将 K3S 与自定义的非捆绑 CNI 一起使用,
|
||||
则必须为这些 CNI 配置使用正确的路径,例如 `/etc/cni/net.d` -
|
||||
[有关详细信息,请参阅 K3S 文档](https://docs.k3s.io/zh/networking/basic-network-options#custom-cni)。
|
||||
{{< tab name="istioctl" category-value="istioctl" >}}
|
||||
|
||||
## CNI {#cni}
|
||||
{{< 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=/var/lib/rancher/k3s/data/current/bin/
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabset >}}
|
||||
|
||||
### MicroK8s {#microk8s}
|
||||
|
||||
如果你在 [MicroK8s](https://microk8s.io/) 上安装 Istio,
|
||||
则必须在安装命令后附加一个值,因为 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
|
||||
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< 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
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabset >}}
|
||||
|
||||
### minikube {#minikube}
|
||||
|
||||
如果你正在使用 [minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)
|
||||
和 [Docker 驱动程序](https://minikube.sigs.k8s.io/docs/drivers/docker/),
|
||||
则必须在安装命令中附加一些值,以便 Istio CNI 节点代理可以正确管理和捕获节点上的 Pod。例如:
|
||||
|
||||
{{< 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"
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="istioctl" category-value="istioctl" >}}
|
||||
|
||||
{{< text syntax=bash >}}
|
||||
$ istioctl install --set profile=ambient --set cni.cniNetnsDir="/var/run/docker/netns"
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabset >}}
|
||||
|
||||
### Red Hat OpenShift {#red-hat-openshift}
|
||||
|
||||
OpenShift 要求在 `kube-system` 命名空间中安装 `ztunnel` 和 `istio-cni` 组件。
|
||||
提供了 `openshift-ambient` 安装配置文件,它将为您进行此更改。
|
||||
在安装命令中将 `profile=ambient` 实例替换为 `profile=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
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< tab name="istioctl" category-value="istioctl" >}}
|
||||
|
||||
{{< text syntax=bash >}}
|
||||
$ istioctl install --set profile=openshift-ambient --skip-confirmation
|
||||
{{< /text >}}
|
||||
|
||||
{{< /tab >}}
|
||||
|
||||
{{< /tabset >}}
|
||||
|
||||
## CNI plugins {#cni-plugins}
|
||||
|
||||
当使用某些 {{< gloss "CNI" >}}CNI 插件{{< /gloss >}}时,以下配置适用于所有平台:
|
||||
|
||||
### Cilium {#cilium}
|
||||
|
||||
|
@ -104,7 +201,7 @@ test: no
|
|||
|
||||
这可以通过应用以下 `CiliumClusterWideNetworkPolicy` 来解决:
|
||||
|
||||
{{< text syntax=yaml snip_id=none >}}
|
||||
{{< text syntax=yaml >}}
|
||||
apiVersion: "cilium.io/v2"
|
||||
kind: CiliumClusterwideNetworkPolicy
|
||||
metadata:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: 升级指南
|
||||
description: Istio Ambient 模式升级指南。
|
||||
description: Ambient 模式下的 Istio 升级指南。
|
||||
weight: 10
|
||||
aliases:
|
||||
- /zh/docs/ops/ambient/upgrade
|
||||
|
|
|
@ -5,6 +5,8 @@ weight: 5
|
|||
aliases:
|
||||
- /zh/docs/ops/ambient/upgrade/helm-upgrade
|
||||
- /zh/latest/docs/ops/ambient/upgrade/helm-upgrade
|
||||
- /zh/docs/ambient/upgrade/helm
|
||||
- /zh/latest/docs/ambient/upgrade/helm
|
||||
owner: istio/wg-environments-maintainers
|
||||
test: yes
|
||||
status: Experimental
|
||||
|
@ -12,7 +14,7 @@ status: Experimental
|
|||
|
||||
按照本指南使用 [Helm](https://helm.sh/docs/) 对 Ambient 模式的安装进行升级和配置。
|
||||
本指南假设您已经使用之前的 Istio 版本执行了
|
||||
[Helm Ambient 模式安装](/zh/docs/ambient/install/helm-installation/)。
|
||||
[Helm Ambient 模式安装](/zh/docs/ambient/install/helm/)。
|
||||
|
||||
{{< warning >}}
|
||||
与 Sidecar 模式相比,Ambient 模式支持将应用程序 Pod 移动到升级后的 ztunnel 代理,
|
||||
|
@ -23,7 +25,7 @@ status: Experimental
|
|||
有关详细信息,请参阅 Kubernetes 提供商文档。
|
||||
{{< /warning >}}
|
||||
|
||||
## 了解 Ambient 升级 {#understanding-ambient-upgrades}
|
||||
## 了解 Ambient 模式升级 {#understanding-ambient-mode-upgrades}
|
||||
|
||||
所有 Istio 升级都涉及升级控制平面、数据平面和 Istio CRD。
|
||||
由于 Ambient 数据平面分为[两个组件](/zh/docs/ambient/architecture/data-plane),
|
||||
|
@ -87,7 +89,9 @@ $ export REVISION=istio-1-22-1
|
|||
$ export OLD_REVISION=istio-1-21-2
|
||||
{{< /text >}}
|
||||
|
||||
## 升级 Istio CRD {#upgrade-the-istio-crds}
|
||||
## 升级控制平面 {#upgrade-the-control-plane}
|
||||
|
||||
### 基本组件 {#base-components}
|
||||
|
||||
在部署新版本的控制平面之前,必须升级集群范围的 Custom Resource Definitions(CRD):
|
||||
|
||||
|
@ -95,7 +99,7 @@ $ export OLD_REVISION=istio-1-21-2
|
|||
$ kubectl apply -f manifests/charts/base/crds
|
||||
{{< /text >}}
|
||||
|
||||
## 安装新的控制平面 {#install-the-new-control-plane}
|
||||
### istiod 控制平面 {#istiod-control-plane}
|
||||
|
||||
[Istiod](/zh/docs/ops/deployment/architecture/#istiod) 控制平面管理和配置在网格内路由流量的代理。
|
||||
以下命令将在当前实例旁边安装控制平面的新实例,但不会引入任何新代理,也不会接管现有代理的控制权。
|
||||
|
@ -106,45 +110,49 @@ $ kubectl apply -f manifests/charts/base/crds
|
|||
$ helm install istiod-"$REVISION" istio/istiod -n istio-system --set revision="$REVISION" --set profile=ambient --wait
|
||||
{{< /text >}}
|
||||
|
||||
## 升级 ztunnel DaemonSet {#upgrade-the-ztunnel-daemonset}
|
||||
### CNI 节点代理 {#cni-node-agent}
|
||||
|
||||
{{< gloss >}}ztunnel{{< /gloss >}} DaemonSet 是节点代理组件。
|
||||
1.x 版本的 ztunnel 与 1.x+1 和 1.x 版本的控制平面兼容。这意味着,
|
||||
只要控制平面的版本差异在一个次要版本以内,就必须在升级 ztunnel 之前升级控制平面。
|
||||
如果您之前已自定义 ztunnel 安装,则可以重用以前升级或安装中的 `values.yaml` 文件,
|
||||
以保持{{< gloss "data plane" >}}数据平面{{< /gloss >}}的一致性。
|
||||
|
||||
{{< warning >}}
|
||||
就地升级 ztunnel 将短暂中断节点上的所有 Ambient 模式流量。
|
||||
建议使用节点封锁和蓝/绿节点池来减轻生产环境升级期间的影响范围。
|
||||
有关详细信息,请参阅您的 Kubernetes 提供商文档。
|
||||
{{< /warning >}}
|
||||
|
||||
{{< text syntax=bash snip_id=upgrade_ztunnel >}}
|
||||
$ helm upgrade ztunnel istio/ztunnel -n istio-system --set revision="$REVISION" --wait
|
||||
{{< /text >}}
|
||||
|
||||
## 升级 CNI DaemonSet {#upgrade-the-cni-daemonset}
|
||||
|
||||
Istio CNI 代理负责检测添加到 Ambient 网格的 Pod,
|
||||
Istio CNI 节点代理负责检测添加到 Ambient 网格的 Pod,
|
||||
通知 ztunnel 应在添加的 Pod 内建立代理端口,并在 Pod 网络命名空间内配置流量重定向。
|
||||
它不是数据平面或控制平面的一部分。
|
||||
|
||||
1.x 版本的 CNI 与 1.x+1 和 1.x 版本的控制平面兼容。这意味着,
|
||||
只要控制平面和 Istio CNI 的版本差异在一个小版本以内,就必须在升级控制平面之前对其进行升级。
|
||||
只要控制平面和 Istio CNI 的版本差异在一个小版本以内,就必须在升级控制平面之前对其升级。
|
||||
|
||||
{{< warning >}}
|
||||
将 Istio CNI 代理就地升级到兼容版本不会中断已成功添加到一个 Ambient 网格中正在运行 Pod 的网络,
|
||||
但在节点上 Istio CNI 代理成功升级并完成就绪检查之前,
|
||||
不会有任何 Ambient 捕获的 Pod 可以在节点上被成功调度(或重新调度)。
|
||||
如果这是一个重大的中断问题,或者需要对 CNI 升级进行更严格的影响范围控制,则建议使用节点污染和/或节点警戒线。
|
||||
将 Istio CNI 节点代理就地升级到兼容版本不会中断已成功添加到 Ambient 网格的正在运行的 Pod 的网络,
|
||||
但在升级完成且节点上升级的 Istio CNI 代理通过就绪性检查之前,
|
||||
不会在节点上成功调度(或重新调度)任何环境捕获的 Pod。如果这是一个严重的中断问题,
|
||||
或者需要对 CNI 升级进行更严格的影响范围控制,建议使用节点污点和/或节点警戒线。
|
||||
{{< /warning >}}
|
||||
|
||||
{{< text syntax=bash snip_id=upgrade_cni >}}
|
||||
$ helm upgrade istio-cni istio/cni -n istio-system
|
||||
{{< /text >}}
|
||||
|
||||
## 通过标签升级 waypoint 和网关 {#upgrade-waypoints-and-gateways-using-tags}
|
||||
## 升级数据平面 {#upgrade-the-data-plane}
|
||||
|
||||
### ztunnel DaemonSet {#ztunnel-daemonset}
|
||||
|
||||
{{< gloss >}}ztunnel{{< /gloss >}} DaemonSet 是节点代理组件。
|
||||
1.x 版本的 ztunnel 与 1.x+1 和 1.x 版本的控制平面兼容。这意味着,
|
||||
只要控制平面的版本差异在一个小版本以内,就必须在升级 ztunnel 之前升级控制平面。
|
||||
如果您之前已自定义 ztunnel 安装,则可以重用以前升级或安装中的 `values.yaml` 文件,
|
||||
以保持{{< gloss "data plane" >}}数据平面{{< /gloss >}}的一致性。
|
||||
|
||||
{{< warning >}}
|
||||
无论使用何种修订版本,就地升级 ztunnel 都会短暂中断节点上的所有 Ambient 网格流量。
|
||||
实际上,中断时间非常短,主要影响长时间运行的连接。
|
||||
|
||||
建议使用节点封锁和蓝/绿节点池来减轻生产升级期间的影响范围风险。
|
||||
有关详细信息,请参阅 Kubernetes 提供商文档。
|
||||
{{< /warning >}}
|
||||
|
||||
{{< text syntax=bash snip_id=upgrade_ztunnel >}}
|
||||
$ helm upgrade ztunnel istio/ztunnel -n istio-system --set revision="$REVISION" --wait
|
||||
{{< /text >}}
|
||||
|
||||
### 使用标签升级 waypoint 和网关 {#upgrade-waypoints-and-gateways-using-tags}
|
||||
|
||||
如果您遵循了最佳实践,则所有网关、工作负载和命名空间都使用默认修订版本(实际上是名为 `default` 的标签)
|
||||
或 `istio.io/rev` 标签,其值设置为标签名称。
|
|
@ -515,8 +515,8 @@ $ kubectl delete --ignore-not-found=true -f @samples/httpbin/httpbin.yaml@
|
|||
删除 `Gateway` 和 `HTTPRoute` 配置,并关闭 [httpbin]({{< github_tree >}}/samples/httpbin) 服务:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl delete gtw httpbin-gateway
|
||||
$ kubectl delete httproute httpbin
|
||||
$ kubectl delete gtw httpbin-gateway
|
||||
$ kubectl delete --ignore-not-found=true -f @samples/httpbin/httpbin.yaml@
|
||||
{{< /text >}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue