Question

Difficulty: EasyManaging Cloud Run Resources

A cloud engineer needs to limit the maximum number of container instances for an existing Cloud Run service named `inventory-api` to preventing overloading a backend database. Which `gcloud` command should the engineer execute?

  1. gcloud run services update inventory-api --max-instances=10Answer
  2. B
    gcloud functions deploy inventory-api --max-instances=10
  3. C
    gcloud run services update-traffic inventory-api --max-instances=10
  4. D
    gcloud compute instances update inventory-api --max-instances=10

Answer

Execute `gcloud run services update inventory-api --max-instances=10` to adjust scaling settings on an existing Cloud Run service.
The correct command uses `gcloud run services update` along with the `--max-instances` flag to modify scaling limits on an existing Cloud Run service without affecting traffic splitting or target compute paradigms.

Step-by-Step Solution

1
Identify the resource type
The target is a Cloud Run service named `inventory-api`.
Cloud Run service management requires using `gcloud run services` commands.
2
Determine the required operation flag
The operation modifies autoscaling parameters by specifying `--max-instances=10`.
To update configuration parameters like instance limits on an existing Cloud Run service without re-deploying code, `gcloud run services update` is the standard command.

Key Concept

Managing Cloud Run scaling parameters via the gcloud CLI
Rate this question