A cloud engineer is tasked with executing a zero-downtime canary rollout of a newly built container revision `v2` for an existing production Cloud Run service named `inventory-api` currently serving all traffic from revision `v1`. The engineering policy mandates testing the isolated new revision via a dedicated endpoint prior to exposing any production users, followed by a staged traffic migration. In what chronological sequence should the engineer execute these operational steps?
- 1Deploy the new container image with the `--no-traffic` flag and assign a URL revision tag named `green` to `v2`.
- 2Send test HTTP requests directly to the tagged revision URL `https://green---inventory-api-...a.run.app` to verify revision health.
- 3Run `gcloud run services update-traffic inventory-api --to-revisions=v1=90,v2=10` to initiate a canary split.
- 4Run `gcloud run services update-traffic inventory-api --to-revisions=v2=100` after verifying canary stability.
Answer
The correct operational sequence is: 1) Deploy the new container image with `--no-traffic` and assign a URL tag named `green`; 2) Send test HTTP requests directly to the tagged revision URL; 3) Run `gcloud run services update-traffic inventory-api --to-revisions=v1=90,v2=10`; 4) Run `gcloud run services update-traffic inventory-api --to-revisions=v2=100`.
The proper sequence for a safe Cloud Run rollout requires isolating the new revision upon creation by supplying `--no-traffic` and `--tag=green`, testing the isolated revision endpoint directly, initiating a canary traffic allocation using `gcloud run services update-traffic`, and finally completing the 100% traffic cutover after canary telemetry is validated.
Step-by-Step Solution
Key Concept
Cloud Run Tagged Canary Deployment and Traffic Splitting Workflow