Soru

Zorluk: KolayManaging Cloud Run Resources

You have deployed a new revision of an existing Cloud Run service named 'sales-service'. You want to route 100% of incoming user traffic to this latest revision named 'sales-service-00002-v2'. Which gcloud command should you execute to update the traffic allocation?

  1. gcloud run services update-traffic sales-service --to-revisions=sales-service-00002-v2=100Cevap
  2. B
    gcloud run services update-traffic sales-service --set-env-vars=TRAFFIC_SPLIT=100
  3. C
    gcloud functions deploy sales-service --traffic=100
  4. D
    gcloud projects add-iam-policy-binding my-project --member=allUsers --role=roles/owner

Cevap

The command 'gcloud run services update-traffic sales-service --to-revisions=sales-service-00002-v2=100' correctly updates traffic allocation to 100% for the specified revision.
The command 'gcloud run services update-traffic' combined with '--to-revisions=sales-service-00002-v2=100' specifically assigns 100 percent of service traffic to the designated revision name.

Adım Adım Çözüm

1
Identify the target Google Cloud service command group.
Cloud Run service management uses the 'gcloud run services' command group.
Cloud Run resources are distinct from Cloud Functions or generic project management.
2
Select the subcommand for modifying traffic distribution.
The subcommand 'update-traffic' modifies revision traffic percentages.
Traffic splitting allows blue/green deployments and immediate rollouts between revisions.
3
Specify the revision target flag and percentage value.
Use '--to-revisions=REVISION_NAME=100' to shift all traffic to the target revision.
The '--to-revisions' flag takes revision-to-percentage mapping pairs.

Anahtar Kavram

Cloud Run Traffic Management
Tahmini Süre:45s
Bu soruyu puanla