An operations team needs to test a new container image for an existing Cloud Run service named `order-service`. They want to deploy the new revision without automatically directing live user traffic to it, and then split incoming requests so that 10% goes to the new revision while 90% remains on the previous revision (`order-service-00001`). Which TWO gcloud CLI commands should they execute to accomplish this? (Select TWO answers.)
- Execute `gcloud run deploy order-service --image=gcr.io/my-project/order-service:v2 --no-traffic` to create the new revision without sending traffic to it.Cevap
- Execute `gcloud run services update-traffic order-service --to-revisions=order-service-00001=90,order-service-00002=10` to divide incoming traffic between the two revisions.Cevap
- CExecute `gcloud run services update-traffic order-service --to-latest=100` to route traffic to the newly created revision.
- DExecute `gcloud functions deploy order-service --trigger-http --traffic-split=10` to deploy and adjust traffic allocation.
Cevap
The team should execute `gcloud run deploy order-service --image=gcr.io/my-project/order-service:v2 --no-traffic` to create the new revision safely without routing traffic, followed by `gcloud run services update-traffic order-service --to-revisions=order-service-00001=90,order-service-00002=10` to set the 90/10 traffic allocation.
Deploying with `--no-traffic` creates the revision in isolation without routing incoming user requests to it. Following up with `gcloud run services update-traffic` using `--to-revisions` allows administrators to explicitly define percentage traffic distribution across revisions.
Adım Adım Çözüm
Anahtar Kavram
Cloud Run revision deployment and gradual traffic splitting management using gcloud CLI.