Reputation: 3268
I'm getting this error when trying to deploy on Google Cloud Run using VS Code with the Google Cloud Code extension. How can I solve this?
ERROR: (gcloud.run.deploy) spec.template.spec.containers.resources.limits.cpu: Invalid value specified for cpu. For the specified value, maxScale may not exceed 10.
Upvotes: 0
Views: 343
Reputation: 414
You are correct that the default value is 100. Just to add more information from the documentation in case other people encounters the error:
By default, Cloud Run services are configured to a maximum of 100 instances
The maximum limit depends on the region of the Cloud Run service and its CPU and memory configurations.
The quotas page shows the baseline quotas per-region.
The maximum number of instances is determined as the minimum of:
regional quota baseline / requested multiple of 1 CPU
regional quota baseline / requested multiple of 2GB memory
For example, a baseline quota of 1000 instances with either 4GB memory or 2 CPU will get an effective limit of 500.
If you want to specify a maximum number of instances greater than the maximum allowed in the region of the Cloud Run service, you must request a quota increase.
Then, from this documentation, they can check their current maximum instances settings.
Upvotes: 0
Reputation: 3268
Even though I didn't find a solution via the UI, it can be solved via the command line in this way:
gcloud run deploy ... --max-instances 10
It seems the default value for maxScale (max-instances) is 100.
Upvotes: 0