這些步驟適用於已在叢集中設定 GKE 上的 Istio 入口閘道的安裝作業。在此程序中,系統會安裝 Cloud Service Mesh 1.18 版和代管控制層。
事前準備
如要從「Istio 外掛程式」遷移,必須使用 Cloud Service Mesh 和Google 管理的控制層。因此,Cloud Service Mesh 叢集內控制層不支援遷移。
請先詳閱並確認符合升級規定。
本頁面的指令會使用升級準備步驟中的環境變數和遷移指令碼。
請務必按照指定順序執行這個程序的每個步驟。
總覽
一般而言,從「Istio 外掛程式」遷移至 Cloud Service Mesh (使用代管控制層) 的程序包括:
- 安裝 Cloud Service Mesh 代管控制層。
- 使用遷移指令碼設定 Cloud Service Mesh Ingress 閘道。
遷移至 Cloud Service Mesh 1.18 版
您必須按照 Cloud Service Mesh 文件「從 GKE 上的 Istio 遷移至 Cloud Service Mesh」中的詳細說明操作。完成安裝並遷移工作負載後,請返回這個頁面,完成剩餘的設定步驟。
請按照「Istio 外掛程式遷移說明」將安裝項目遷移至 Cloud Service Mesh,並使用 Google 代管的控制層。
該程序進行期間,請注意下列事項:
如果系統提示
custom envoy filters are not supported
。 只要選擇「是」即可繼續遷移。範例:Detected custom envoy filters are not supported by Cloud Service Mesh. Please remove these if possible NAMESPACE NAME AGE gke-system allowconnect-cluster-local-gateway 26m Continue anyways? [y/N] Y
遷移作業說明包含「完成遷移作業」一節,其中會逐步說明如何完成 Cloud Service Mesh 安裝作業。重要事項:完成上述步驟後,您將無法再復原變更。
Istio 外掛程式遷移說明: 從 Istio on GKE 遷移至 Cloud Service Mesh
完成遷移步驟並將工作負載遷移至 Cloud Service Mesh 後,請執行下列指令,重新啟動並標記
knative-serving
命名空間中的 Ingress Pod:重新啟動 Ingress Pod:
kubectl rollout restart deployment autoscaler activator webhook -n knative-serving
新增「
istio: ingressgateway
」標籤:kubectl patch deployment ${INGRESS_NAME} --namespace ${INGRESS_NAMESPACE} --patch '{"spec": {"template": {"metadata": {"labels": {"istio": "ingressgateway"}}}}}'
設定 Cloud Service Mesh Ingress
在本節中,您會使用遷移指令碼,將 Cloud Service Mesh 代管控制層的發布管道設為 asm-managed-rapid
。
執行下列指令來啟動遷移指令碼:
./migration-addon.sh \
--asm-revision asm-managed-rapid \
--command set-up-asm-ingress
後續步驟
復原
如要還原透過上述步驟所做的變更,請採取下列行動:
- 使用遷移指令碼刪除 Cloud Service Mesh Ingress。
- 回溯 Cloud Service Mesh 的安裝作業。
如要使用 Google 代管的控制層,復原 Cloud Service Mesh 的安裝和設定,請按照下列步驟操作:
執行下列指令,刪除 Cloud Service Mesh Ingress:
./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.
如要驗證回溯作業,請檢查
gke-system
命名空間中是否不再有istio-ingressgateway
服務:kubectl get deployment istio-ingressgateway -n gke-system
執行下列指令,重新啟用「Istio 外掛程式」:
./migration-addon.sh --command rollback-uninstall-istio-addon
如要繼續將安裝項目的變更還原至原始狀態,請復原 Istio 外掛程式。