Soru

Zorluk: OrtaManaging Cloud Run Resources

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?

  1. 1Deploy the updated container image to `inventory-api` using the `--no-traffic` flag and assign the revision tag `canary`.
  2. 2Access and test the new revision directly via its dedicated revision tag URL.
  3. 3Execute `gcloud run services update-traffic inventory-api --to-tags=canary=10` to initiate traffic splitting.
  4. 4Execute `gcloud run services update-traffic inventory-api --to-latest` to complete the migration.

Cevap

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.

Adım Adım Çözüm

1
Deploy revision with `--no-traffic` and `--tag` flags.
A new Cloud Run revision is deployed and assigned a dedicated URL tag without receiving main ingress traffic.
Prevents unverified code from handling production requests immediately upon deployment.
2
Perform smoke tests on the generated tag-specific endpoint.
Verification of basic functionality and deployment health on the specific revision.
Validates application readiness in the target GCP environment prior to opening production ingress.
3
Execute `gcloud run services update-traffic` allocating 10% to the `canary` tag.
Cloud Run load balancer splits live incoming requests so 10% go to the canary revision and 90% go to existing traffic targets.
Allows monitoring of production metrics, telemetry, and error rates with minimal customer exposure.
4
Execute `gcloud run services update-traffic` allocating 100% traffic `--to-latest`.
The new revision becomes the primary receiver of all production traffic.
Completes the canary release workflow once stability is confirmed.

Anahtar Kavram

Cloud Run Tagged Canary Deployment and Traffic Splitting Workflow
Tahmini Süre:1m 30s
Bu soruyu puanla