如何为GKE服务上的Cloud Run设置最小规模? [英] How to set a minimum scale for Cloud Run on GKE services?
问题描述
我正在Google Kubernetes Engine上使用Cloud Run,并且能够毫无问题地部署和访问服务.
I'm using Cloud Run on Google Kubernetes Engine and I'm able to deploy and access services without a problem.
但是,由于我在GKE上运行并为24/7集群付费,因此将部署扩展到零并始终对第一个请求始终保持冷启动是没有意义的.
But since I'm running on GKE and paying for the cluster 24/7 it makes no sense to scale a deployment to zero and always have a cold start for the first request.
我发现可以将Knative自动缩放器设置为minScale
以将缩放比例禁用为零这里和此处,但我不知道将其放在何处.
I've found that's it's possible to set minScale
for the Knative autoscaler to disable scale to zero here, here and here, but I have no idea where to put it.
在GKE中,用于Isito和Knative-Serving的配置,服务和工作负载很多,但是我找不到任何匹配的东西.
There are a lot of configurations, services and workloads inside GKE for Isito and Knative-Serving, but I couldn't find anything matching.
我必须编辑哪个文件或配置才能将minScale
设置为1
?还是因为Cloud Run在内部管理特定模板,所以这不可能吗?
Which file or configuration do I have to edit to set minScale
to 1
? Or won't this be possible since Cloud Run manages the specific template internally?
推荐答案
使用kubectl
,您应该能够在Knative服务上设置注释autoscaling.knative.dev/minScale: "1"
.
Using kubectl
, you should be able to set the annotation autoscaling.knative.dev/minScale: "1"
on your Knative service.
请参见此页面以获取更多信息
这篇关于如何为GKE服务上的Cloud Run设置最小规模?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!