A cloud engineer needs to perform a canary deployment for an existing Cloud Run service named `inventory-api`. The deployment strategy requires deploying a new revision without immediately receiving production traffic, validating the isolated revision using a revision tag URL, sending 10% of live traffic to the canary, and finally shifting 100% of traffic to the new release. In what order should the engineer execute the following operational steps?
- 1Deploy the updated container image to `inventory-api` using the `--no-traffic` flag and assign the revision tag `canary`.
- 2Access and test the new revision directly via its dedicated revision tag URL.
- 3Execute `gcloud run services update-traffic inventory-api --to-tags=canary=10` to initiate traffic splitting.
- 4Execute `gcloud run services update-traffic inventory-api --to-latest` to complete the migration.
Answer
The correct sequence starts with deploying the new revision with the `--no-traffic` flag and tag `canary`, followed by testing the revision directly via its tag URL, then updating traffic to send 10% of live requests to the `canary` tag, and finally updating traffic to route 100% to the latest revision.
Safely deploying updates to Cloud Run requires isolating new revisions using `--no-traffic` and revision tags (`--tag`), testing through the dedicated tag URL, performing a partial traffic split using `gcloud run services update-traffic --to-tags`, and finally updating the service to route 100% of live traffic to the latest revision.
Step-by-Step Solution
Key Concept
Cloud Run Tagged Canary Deployment and Traffic Splitting Workflow
Estimated Time:1m 30s