以下步骤特定于 Istio 所包含的捆绑版本的 Istio, 默认使用 Knative serving“GKE 插件”。
由于在您执行 卸载 Knative serving“GKE 插件”的流程 本页中的步骤会在集群上安装 Cloud Service Mesh, 配置入站流量网关
准备工作
概览
一般来说,从 Cloud SQL 迁移时, 与执行清理 Cloud Service Mesh 安装。在此过程中,Cloud Service Mesh 版本 1.18 随 集群内控制平面。
安装 Cloud Service Mesh 1.18 版
您可以按照 Cloud Service Mesh 安装文档来安装 Cloud Service Mesh。
准备工作:
对于迁移,必须在后续配置步骤中单独安装入站流量网关。通过 默认情况下,安装脚本不会安装 Ingress 网关。
可选:如果您使用 Cloud Service Mesh 证书授权机构 (Mesh CA),则必须 在 Cloud Service Mesh 安装中也包含
--ca mesh_ca
标志 脚本。
如需安装 Cloud Service Mesh,请执行以下操作:
按照 Cloud Service Mesh 文档中的步骤操作: 安装 Cloud Service Mesh 1.18 版
- 示例
以下是包含必需标志的默认命令的示例:
./asmcli install \ --project_id ${PROJECT_ID} \ --cluster_name ${CLUSTER_NAME} \ --cluster_location ${CLUSTER_LOCATION} \ --ca mesh_ca \ --output_dir DIR_PATH \ --enable_all
配置 Cloud Service Mesh 入站流量
在本部分中,迁移脚本用于
在 gke-system
命名空间中创建 Cloud Service Mesh 入站流量网关。
对于迁移,将使用 gke-system
命名空间,以便在刚刚移除的“捆绑的 Istio”使用的同一命名空间中创建入站流量网关。因此,Cloud Service Mesh 入站流量 Pod
接管流量,而无需对 Ingress 进行任何所需的配置更改
服务。例如,您无需配置新的外部 IP 地址。
要在
gke-system
命名空间中创建入站流量网关,请运行以下命令启动迁移脚本:./migration-addon.sh --command set-up-asm-ingress
该过程中的终端输出类似于以下内容:
Setting up Cloud Service Mesh ingress. Note that the Cloud Service Mesh ingress is not serving traffic at this step. namespace/gke-system labeled deployment.apps/istio-ingressgateway created horizontalpodautoscaler.autoscaling/istio-ingressgateway created role.rbac.authorization.k8s.io/istio-ingressgateway-sds created rolebinding.rbac.authorization.k8s.io/istio-ingressgateway-sds created Cloud Service Mesh ingress is successfully installed.
通过运行以下命令验证
istio-ingrerssgateway
入站流量网关正在gke-system
命名空间中运行:kubectl get deployment istio-ingressgateway -n gke-system
请注意,
istio-ingressgateway
pod 的数量是特意设置为0
。安装 Knative serving 舰队组件后,还需要 步至 将所有流量迁移到 Cloud Service Mesh 入站流量。
后续步骤
回滚
如果您需要回滚在前面的步骤中所做的更改, 您可以使用迁移脚本执行以下操作:
- 删除 Cloud Service Mesh 入站流量网关。
- 卸载 Cloud Service Mesh。
如需回滚 Cloud Service Mesh 配置和安装,请执行以下操作:
运行以下命令以启动回滚。
./migration-addon.sh --command rollback-set-up-asm-ingress
该过程中的终端输出类似于以下内容:
Deleting Cloud Service Mesh ingress deployment.apps "istio-ingressgateway" deleted horizontalpodautoscaler.autoscaling "istio-ingressgateway" deleted role.rbac.authorization.k8s.io "istio-ingressgateway-sds" deleted rolebinding.rbac.authorization.k8s.io "istio-ingressgateway-sds" deleted Cloud Service Mesh ingress is successfully deleted.
如需验证 Cloud Service Mesh 入站流量网关是否已移除,请检查
gke-system
中已不存在istio-ingressgateway
服务 命名空间:kubectl get deployment istio-ingressgateway -n gke-system
要继续将所有更改回滚到安装的原始状态, 回滚 Knative serving“GKE 插件”