A DevOps engineer is deploying an updated version of a microservice named order-processor to Google Cloud Run. The team requires deploying the container image gcr.io/acme-ship/order-proc:v2 to create a new revision without directing any production traffic to it upon deployment. Furthermore, the new revision must be directly testable via a dedicated revision URL tag named canary while 100% of live traffic remains on the existing stable revision. Which gcloud command should the engineer execute to fulfill these requirements?
- gcloud run deploy order-processor --image=gcr.io/acme-ship/order-proc:v2 --no-traffic --tag=canaryCevap
- Bgcloud run deploy order-processor --image=gcr.io/acme-ship/order-proc:v2 --traffic=canary=100
- Cgcloud functions deploy order-processor --image=gcr.io/acme-ship/order-proc:v2 --no-traffic --tag=canary
- Dgcloud run deploy order-processor --image=gcr.io/acme-ship/order-proc:v2 --no-traffic --role=roles/owner
Cevap
Execute gcloud run deploy order-processor --image=gcr.io/acme-ship/order-proc:v2 --no-traffic --tag=canary
The correct command combines --no-traffic and --tag=canary during gcloud run deploy. The --no-traffic flag creates the new revision without routing any production traffic to it, keeping existing traffic on the current revision. The --tag flag creates a unique URL prefix (canary) pointing directly to the new revision so engineers can test it in isolation.
Adım Adım Çözüm
Anahtar Kavram
Cloud Run Traffic Management and Revision Tagging