最近的一个云运行项目之前部署得很好,内存限制为 128MB (
--memory 128M
),但今天失败并出现错误:
错误:(gcloud.run.deploy)为内存指定的值无效。对于1.0 CPU、内存必须在128Mi到4Gi之间(含)。
将配置更改为
--memory 128Mi
解决了问题,但由于兆字节大于兆字节,这对我来说看起来像是一个更改文档或配额页面上没有太多关于最小限制的指示。无论如何,作为信息,以防其他人可以确认......
可能是 Kubernetes 的更新...我以前可以使用
gcloud run deploy
而无需指定 cpu、内存等。
现在,如果我不指定这些设置,我会得到:
错误:(gcloud.run.deploy)spec.template.spec.containers[0].resources.limits.cpu:为 cpu 指定的值无效。对于指定值,maxScale 不得超过 10。
必须设置
--max-instances=10
才能正常工作。
聚会迟到了,但我在错误地更改区域后遇到了这个问题。 因为显然:
实际最大限制取决于Cloud Run服务的区域及其CPU和内存配置。
(来源:https://cloud.google.com/run/docs/configuring/max-instances#limits)
仔细检查您的 GCP Cloud Build 清单是否未强制执行某些资源配置。
首先,我花了几个月的时间没有查看这些部署。与此同时,GCP 更改了一些有关资源的规则。一个 CPU 与最大实例数相关。
我在 Cloud Run 上手动重新部署,最大实例数有限,但使用 Cloud Build 时,它失败了:
Deployment failed
ERROR: (gcloud.run.deploy) spec.template.spec.containers.resources.limits.cpu: Invalid value specified for cpu. For the specified value, maxScale may not exceed 5.
Consider running your workload in a region with greater capacity, decreasing your requested cpu-per-instance, or requesting an increase in quota for this region if you are seeing sustained usage near this limit, see https://cloud.google.com/run/quotas. Your project may gain access to further scaling by adding billing information to your account.
我碰巧在 Cloud Run 部署的 Cloud Build 步骤中有
--max-instances=29
。删除它可以节省