將工作負載流量遷移至 Cloud Service Mesh

這個步驟可讓您選擇如何推出變更。您可以指定要遷移至 Cloud Service Mesh 的初始流量,然後逐步將推出比例提高至 100%。

事前準備

將所有工作負載流量遷移至 Cloud Service Mesh

在本節中,您會使用遷移指令碼,將所有現有流量遷移至 Cloud Service Mesh。

  1. 執行下列指令,設定要遷移的流量百分比:

    ./migration-addon.sh --command migrate-traffic TRAFFIC_PERCENTAGE
    

    TRAFFIC_PERCENTAGE 替換為要傳送至 Cloud Service Mesh Ingress 的流量百分比。有效值為:0102030405060708090100

    請注意,如果這個步驟發生任何問題,或您想逐步推出,可以多次重新執行這項遷移指令碼指令,直到達到 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
    
  2. 您可以在 Google Cloud 控制台中監控服務流量:

    前往 Knative serving

後續步驟

完成升級並執行清理工作

復原

如要復原透過上述步驟所做的變更,可以使用遷移指令碼將 Cloud Service Mesh Ingress 的流量百分比設回 0

./migration-addon.sh --command migrate-traffic 0