An organization hosts a backend application on Google Cloud Run. Following a new deployment of revision `orders-v2`, operations personnel observe a sudden spike in HTTP 500 error responses. A cloud engineer must immediately direct 100% of incoming production traffic back to the previous stable revision, `orders-v1`, while preserving `orders-v2` intact for internal diagnostic testing. Which `gcloud` command should the engineer execute to achieve this objective?
- gcloud run services update-traffic orders-service --to-revisions=orders-v1=100Cevap
- Bgcloud run deploy orders-service --image=gcr.io/my-project/orders:v1 --no-traffic
- Cgcloud functions deploy orders-service --source=orders-v1 --trigger-http
- Dgcloud projects add-iam-policy-binding my-project --member=allUsers --role=roles/editor
Cevap
The command `gcloud run services update-traffic orders-service --to-revisions=orders-v1=100` correctly shifts 100% of incoming service traffic to revision `orders-v1`.
Executing `gcloud run services update-traffic orders-service --to-revisions=orders-v1=100` updates the service traffic assignment so that 100% of live HTTP traffic goes to the previous stable revision `orders-v1`. Revision `orders-v2` remains deployed in the background, allowing developers to inspect its logs or send direct test queries to its revision-specific URL.
Adım Adım Çözüm
Anahtar Kavram
Managing Cloud Run Revision Traffic Splitting