在這個步驟中,您可以選擇如何推出變更。您可以指定要遷移至 Cloud Service Mesh 的初始流量,然後逐步增加推出比例,直到 100% 為止。
事前準備
將所有工作負載流量遷移至 Cloud Service Mesh
在本節中,您將使用遷移指令碼,將現有的所有流量遷移至 Cloud Service Mesh。
執行下列指令,設定要遷移的流量百分比:
./migration-addon.sh --command migrate-traffic TRAFFIC_PERCENTAGE將 TRAFFIC_PERCENTAGE 替換為要傳送至 Cloud Service Mesh 輸入的流量百分比。有效值為:
0、10、20、30、40、50、60、70、80、90、100。請注意,如果您在這個步驟遇到任何問題,或想逐步推出,可以多次重新執行這項遷移指令碼指令,直到達到 100% 為止。
舉例來說,如果您選擇遷移 10% 的流量,程序期間的終端機輸出內容會類似下列內容:
In this step, 10% of traffic from the previously installed version of Istio is migrated to the Cloud Service Mesh ingress. Setting the number of replicas of Istio ingress to 9, and the number of replicas of Cloud Service Mesh ingress to 1 deployment.apps/istio-ingress patched Waiting for all istio-ingress pods to be ready All istio-ingress pods are ready. deployment.apps/istio-ingressgateway patched Waiting for all istio-ingressgateway pods to be ready All istio-ingressgateway pods are ready. 10% traffic has been migrated to Cloud Service Mesh ingress您可以在 Google Cloud 控制台監控服務流量:
後續步驟
復原
如要復原透過上述步驟所做的變更,可以使用遷移指令碼,將傳送至 Cloud Service Mesh 輸入的流量百分比設回 0:
./migration-addon.sh --command migrate-traffic 0