Migrar o tráfego da carga de trabalho para o Cloud Service Mesh
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Essa etapa no processo permite que você escolha como lançar as alterações. É
possível especificar uma quantidade inicial de tráfego que você quer migrar para o Cloud Service Mesh
e, em seguida, aumentar gradualmente o lançamento para 100%.
Substitua TRAFFIC_PERCENTAGE pela porcentagem de tráfego que você
quer enviar para a entrada do Cloud Service Mesh. Os valores válidos são: 0, 10,
20, 30, 40, 50, 60, 70, 80, 90, 100.
Se você tiver algum problema com esta etapa ou quiser executar uma implementação gradual, execute esse comando de script de migração novamente várias vezes até atingir 100%.
Por exemplo, se você optar por migrar 10% do tráfego, a saída do terminal durante o processo será semelhante a esta:
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
É possível monitorar o tráfego dos seus serviços no Console do Google Cloud:
Se você precisar reverter as alterações feitas por meio das etapas acima, use o script de migração para definir a porcentagem de tráfego para a
entrada do Cloud Service Mesh de volta para 0:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-04-22 UTC."],[],[],null,["# Migrate your workload traffic to Cloud Service Mesh\n\nThis step in the process allows you to choose how to rollout your changes. You\ncan specify an initial amount of traffic that you want migrate to Cloud Service Mesh\nand then gradually increase the rollout to 100%.\n\nBefore you begin\n----------------\n\n- You must first review and ensure that you meet the\n [requirements for upgrading](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade).\n\n- The commands on this page use the environment variables and migration script\n from the [upgrade preparation step](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/prepare).\n\n- It is important that you perform each step of this process in the\n [specified order](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade#upgrading).\n\n### Migrate all workload traffic to Cloud Service Mesh\n\nIn this section, the [migration script](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/prepare) is used to\nmigrate your existing all traffic to Cloud Service Mesh.\n\n1. Run the following command to set the percent of traffic you want migrated:\n\n ./migration-addon.sh --command migrate-traffic \u003cvar translate=\"no\"\u003eTRAFFIC_PERCENTAGE\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eTRAFFIC_PERCENTAGE\u003c/var\u003e with the percent of traffic that you\n want to send to the to Cloud Service Mesh ingress. Valid values are: `0`, `10`,\n `20`, `30`, `40`, `50`, `60`, `70`, `80`, `90`, `100`.\n\n Note that if you have any issues with this step or want to perform a gradual\n rollout, you can re-run this migration script command multiple times until\n you reach 100%.\n\n For example, if you choose to migrate 10% of traffic, the terminal output\n during the process looks similar to the following: \n\n In this step, 10% of traffic from the previously installed\n version of Istio is migrated to the Cloud Service Mesh ingress.\n\n Setting the number of replicas of Istio ingress to 9,\n and the number of replicas of Cloud Service Mesh ingress to 1\n deployment.apps/istio-ingress patched\n\n Waiting for all istio-ingress pods to be ready\n\n All istio-ingress pods are ready.\n deployment.apps/istio-ingressgateway patched\n\n Waiting for all istio-ingressgateway pods to be ready\n\n All istio-ingressgateway pods are ready.\n\n 10% traffic has been migrated to Cloud Service Mesh ingress\n\n | **Note:** The total number of Cloud Service Mesh ingress pods and Istio ingress pods are scaled to 10 even if you currently have less ingress pods.\n |\n |\n | You can run the following command to view the status of the `gke-system`. \n |\n | ```bash\n | kubectl describe pod -n gke-system\n | ```\n |\n |\n | If you receive the `FailedScheduling` warning, your cluster might\n | not have sufficient resources to scale to the necessary number of ingress\n | pods. To increase the number of nodes for your cluster and therefore,\n | increase the amount of available resources, see\n | [Resizing a\n | cluster](/kubernetes-engine/docs/how-to/resizing-a-cluster) in the Google Kubernetes Engine documentation.\n2. You can monitor your traffic of your services, in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n\nWhat's next\n-----------\n\n[Finalize the upgrade and perform cleanup tasks](/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/finalize)\n\nRollback\n--------\n\nIf you need to rollback the changes that you made through the steps above, you\ncan use the migration script to set the percentage of traffic to the\nCloud Service Mesh ingress back to `0`: \n\n ./migration-addon.sh --command migrate-traffic 0"]]