多主架构的安装
按照本指南在 cluster1
和 cluster2
两个集群上安装 Istio 控制平面,
将每一个集群都设置为主集群(primary cluster)。
两个集群都运行在网络
network1
上,所以两个集群中的 Pod 可以直接通信。继续安装之前,确保完成了准备工作6中的步骤。
在此配置中,每一个控制平面都会监测两个集群 API 服务器的服务端点。
服务的工作负载(pod 到 pod)跨集群边界直接通讯。
将 cluster1
设为主集群
为 cluster1
创建 istioctl
配置:
使用 istioctl 和 IstioOperator
API 在 cluster1
中将 Istio 安装为主节点。
将配置文件应用到 cluster1
:
使用以下 Helm 命令在 cluster1
中将 Istio 安装为主节点:
在 cluster1
中安装 base
Chart:
然后,使用以下多集群设置在 cluster1
中安装 istiod
Chart:
将 cluster2
设为主集群
为 cluster2
创建 istioctl
配置:
使用 istioctl 和 IstioOperator
API 在 cluster2
中将 Istio 安装为主节点。
将配置文件应用到 cluster2
:
使用以下 Helm 命令在 cluster2
中将 Istio 安装为主节点:
在 cluster2
中安装 base
Chart:
然后,使用以下多集群设置在 cluster2
中安装 istiod
Chart:
开启端点发现
在 cluster2
中安装从集群的 secret,该 secret 提供 cluster1
的 API 服务器的访问权限。
在 cluster1
中安装从集群的 secret,该 secret 提供 cluster2
的 API 服务器的访问权限。
恭喜! 您已经成功地安装了跨多个主集群 Istio 网格!
后续步骤
现在,您可以验证此次安装7。
清理
使用与安装 Istio 相同的机制(istioctl 或 Helm)从
cluster1
和 cluster2
中卸载 Istio。
在 cluster1
中卸载 Istio:
在 cluster2
中卸载 Istio:
从 cluster1
中删除 Istio Helm 安装:
从 cluster1
中删除 istio-system
命名空间:
从 cluster2
中删除 Istio Helm 安装:
从 cluster2
中删除 istio-system
命名空间:
(可选)删除 Istio 安装的 CRD:
删除 CRD 会永久删除您在集群中创建的所有 Istio 资源。 运行以下命令删除集群中安装的 Istio CRD: