Soru

Zorluk: ZorManaging Cloud Run Resources

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?

  1. 1Deploy the new container image with the `--no-traffic` flag and assign a URL revision tag named `green` to `v2`.
  2. 2Send test HTTP requests directly to the tagged revision URL `https://green---inventory-api-...a.run.app` to verify revision health.
  3. 3Run `gcloud run services update-traffic inventory-api --to-revisions=v1=90,v2=10` to initiate a canary split.
  4. 4Run `gcloud run services update-traffic inventory-api --to-revisions=v2=100` after verifying canary stability.

Cevap

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.

Adım Adım Çözüm

1
Deploy revision `v2` without routing live traffic and attach a revision tag
Revision `v2` is created and accessible strictly via its tag-specific URL endpoint, receiving 0% of main service traffic.
Using `--no-traffic` prevents automatic 100% traffic assignment upon deployment.
2
Validate revision behavior against the tagged URL endpoint
Functionality and health checks pass without exposing live users to potential defects.
Revision tags provide isolated subdomains to test specific revisions before production exposure.
3
Configure canary traffic allocation
10% of main service endpoint requests are handled by `v2` while 90% remain on `v1`.
Canary deployments allow monitoring real user traffic telemetry at reduced risk.
4
Migrate remaining production traffic to the new revision
Revision `v2` handles 100% of live production traffic for `inventory-api`.
Completing the traffic split completes the rollout cycle after canary verification.

Anahtar Kavram

Cloud Run Tagged Canary Deployment and Traffic Splitting Workflow
Bu soruyu puanla