Soru

Zorluk: OrtaDeploying Serverless Applications with Cloud Run and Cloud Functions

A Cloud Operations team is preparing to deploy an update to a mission-critical web application hosted on Google Cloud Run using the gcloud CLI. Company policy requires that newly deployed container revisions must receive zero percent of live customer traffic immediately upon deployment, allowing quality assurance engineers to smoke-test the revision at its dedicated revision URL before shifting production traffic. Which command flag should the team include when executing gcloud run deploy?

  1. Include the --no-traffic flag during the gcloud run deploy execution.Cevap
  2. B
    Include only the --tag flag during deployment without additional flags, assuming tagged revisions automatically route 0% traffic.
  3. C
    Grant the primitive Owner role (roles/owner) to the Cloud Run service account before deploying the container image.
  4. D
    Deploy the application to Cloud Functions gen 1 instead of Cloud Run to prevent automatic revision traffic shifting.

Cevap

The correct option is to specify the `--no-traffic` flag during the `gcloud run deploy` execution.
When deploying a containerized application using `gcloud run deploy`, Cloud Run by default updates the service traffic routing to send 100% of live traffic to the newly created revision. Providing the `--no-traffic` flag creates the revision while keeping all existing traffic routed to previous revisions, satisfying the smoke-testing requirement.

Adım Adım Çözüm

1
Identify the operational deployment requirement for Cloud Run.
The requirement specifies creating a new revision while withholding live customer traffic (0% traffic allocation).
By default, `gcloud run deploy` shifts 100% of the service traffic to the newly deployed revision.
2
Evaluate gcloud CLI flags for Cloud Run traffic control.
The `--no-traffic` flag deploys the revision without updating the existing traffic splitting percentages.
This allows engineers to test the revision via its unique revision URL or revision tag before manually updating traffic assignments.

Anahtar Kavram

Cloud Run Revision Traffic Splitting and Deployment Flags
Bu soruyu puanla