多主架构的安装
按照本指南在 cluster1 和 cluster2 两个集群上安装 Istio 控制平面, 将每一个集群都设置为主集群(primary cluster)。 两个集群都运行在网络 network1 上,所以两个集群中的 Pod 可以直接通信。
继续安装之前,确保完成了准备工作中的步骤。
在此配置中,每一个控制平面都会监测两个集群 API 服务器的服务端点。
服务的工作负载(pod 到 pod)跨集群边界直接通讯。
Multiple primary clusters on the same network
将 cluster1 设为主集群
为 cluster1 创建 Istio 配置文件:
$ cat <<EOF > cluster1.yamlapiVersion: install.istio.io/v1alpha1kind: IstioOperatorspec:values:global:meshID: mesh1multiCluster:clusterName: cluster1network: network1EOF
将配置文件应用到 cluster1:
$ istioctl install --context="${CTX_CLUSTER1}" -f cluster1.yaml
将 cluster2 设为主集群
为 cluster2 创建 Istio 配置文件:
$ cat <<EOF > cluster2.yamlapiVersion: install.istio.io/v1alpha1kind: IstioOperatorspec:values:global:meshID: mesh1multiCluster:clusterName: cluster2network: network1EOF
将配置文件应用到 cluster2:
$ istioctl install --context="${CTX_CLUSTER2}" -f cluster2.yaml
开启端点发现
在 cluster2 中安装远程集群的 secret,该 secret 提供 cluster1’s API 服务器的访问权限。
$ istioctl x create-remote-secret \--context="${CTX_CLUSTER1}" \--name=cluster1 | \kubectl apply -f - --context="${CTX_CLUSTER2}"
在 cluster1 中安装远程集群的 secret,该 secret 提供 cluster2’s API 服务器的访问权限。
$ istioctl x create-remote-secret \--context="${CTX_CLUSTER2}" \--name=cluster2 | \kubectl apply -f - --context="${CTX_CLUSTER1}"
恭喜! 你已经成功地安装了跨多个主集群 Istio 网格!
后续步骤
现在,你可以验证此次安装.
相关内容
跨主-从集群,安装 Istio 网格。
在多个集群上安装 Istio 之前的初始步骤。
跨网络、主-从架构的 Istio 网格安装。
跨网络、多主架构的 Istio 网格安装。
验证 Istio 已成功安装到多集群环境中。
使用 Admiral 管理 Istio 多集群的配置和服务发现
为 Istio deployment(cluster)提供自动化 Istio 配置,并让其像单个网格一样工作。
