Soru

Zorluk: OrtaManaging Cloud Run Resources

A cloud engineer needs to manage an operational Cloud Run service named `order-service` deployed in the `us-central1` region. To handle peak traffic demands while preventing runaway infrastructure costs, the engineer must update the existing service configuration so that no more than 50 container instances scale out, and each instance handles up to 80 concurrent requests. Which TWO `gcloud` CLI commands or flags can the engineer execute to correctly set these parameters? (Select TWO.)

  1. Run `gcloud run services update order-service --max-instances=50 --concurrency=80 --region=us-central1`.Cevap
  2. Run `gcloud run deploy order-service --image=gcr.io/my-project/order-service:v2 --max-instances=50 --concurrency=80 --region=us-central1`.Cevap
  3. C
    Run `gcloud run services update-traffic order-service --max-instances=50 --concurrency=80 --region=us-central1`.
  4. D
    Run `gcloud functions deploy order-service --max-instances=50 --concurrency=80 --region=us-central1`.

Cevap

The configurations can be applied either by updating the service inline with `gcloud run services update --max-instances=50 --concurrency=80 --region=us-central1` or by deploying a container image revision with `gcloud run deploy --max-instances=50 --concurrency=80 --region=us-central1`.
Both updating an active service with `gcloud run services update` and deploying a revision using `gcloud run deploy` support setting instance scaling limits (`--max-instances`) and container concurrency (`--concurrency`). Both commands correctly apply the maximum instance ceiling to 50 and request concurrency per instance to 80.

Adım Adım Çözüm

1
Identify the target resource and configuration requirements
Resource is Cloud Run service `order-service` in region `us-central1`. Parameters to adjust are maximum instances (50) and concurrency per instance (80).
Cloud Run service settings require valid `gcloud run` command syntax matching Cloud Run resource flags.
2
Evaluate CLI subcommands for resource modifications
Both `gcloud run services update` and `gcloud run deploy` modify service configuration templates and revision settings.
`update` changes settings without redeploying code, whereas `deploy` updates settings alongside a new container image.
3
Validate flags and eliminate non-applicable commands
`update-traffic` is invalid because it only adjusts traffic percentages between revisions, and `gcloud functions deploy` targets Cloud Functions rather than Cloud Run.
Distinguishing subcommands ensures accurate operation management without command parameter errors.

Anahtar Kavram

Cloud Run Service Configuration and Scaling Management via gcloud CLI
Bu soruyu puanla