安装 Istio ambient 模式
您可以使用 Alauda Service Mesh Operator 2.1.1 或更高版本,在 Alauda Container Platform 上以 ambient 模式部署 Istio。
前提条件
- 必须安装 Alauda Container Platform Networking for Multus 插件。
- kube-ovn 必须为 v4.1.5 或更高版本,并且必须使用 overlay 网络。ambient 模式不适用于 kube-ovn underlay 网络;请参阅 Ambient 模式不支持 kube-ovn underlay 网络。
- 已安装 Alauda Service Mesh Operator 2.1.1 或更高版本。
- 集群管理员已通过
kubectl建立活动的 ACP CLI 会话,并具有cluster-admin角色。 - 您已在本地安装
istioctl,以便用于运行这些操作步骤。
操作步骤
安装 Istio Container Network Interface (CNI)
-
创建
istio-cni命名空间,并添加标签istio-discovery=enabled: -
创建名为
istio-cni.yaml的 IstioCNI 资源:- 必须将
profile字段设置为ambient。 - 将
spec.values.cni.ambient.reconcileIptablesOnStartup设置为true。reconcileIptablesOnStartup选项使 IstioCNI agent 能够在 CNI agent 启动期间检测并修复已运行 ambient pod 中不兼容的 iptables 规则,从而处理升级或规则漂移等场景。
- 必须将
-
应用 IstioCNI CR:
-
等待 IstioCNI pod 就绪:
安装 Istio 控制平面
-
创建
istio-system命名空间,并添加标签istio-discovery=enabled: -
创建名为
istio.yaml的 Istio 资源:- 必须将
profile字段设置为ambient。 - 必须将
.spec.values.pilot.trustedZtunnelNamespace配置为与 ZTunnel 资源将要安装到的命名空间一致。 discoverySelectors配置确保控制平面仅监控带有istio-discovery=enabled标签的命名空间,从而帮助减少配置开销,并支持在同一集群中共存多个服务网格。有关详细信息,请参阅 ambient 模式下的发现选择器。
- 必须将
-
应用 Istio custom resource (CR):
-
等待 Istio 控制平面就绪:
安装 ZTunnel 代理
-
创建
ztunnel命名空间,并添加标签istio-discovery=enabled:NOTEZTunnel资源的命名空间名称必须与Istio配置中的trustedZtunnelNamespace参数一致。 -
创建名为
ztunnel.yaml的 ZTunnel 资源: -
应用 ZTunnel CR:
-
等待 ZTunnel pod 就绪: