简体   繁体   English

Kubernetes 资源请求和限制

[英]Kubernetes Resource Requests and Limits

I'm new to kubernetes.我是 kubernetes 的新手。 I'm just wondering is there any downside if i'm set the value for kubernetes container resource requests and limits as max as possible like this?我只是想知道如果我将 kubernetes 容器资源请求的值设置为尽可能大,这样是否有任何缺点?

resources:
   limits:
     cpu: '3'
     memory: 1Gi
   requests:
     cpu: '2'
     memory: 256Mi

You should set requests to the minimum values your pod needs and limits to the max you allow it to use.您应该将requests设置为您的 pod 需要的最小值,并limits为您允许它使用的最大值。 It helps Kubernetes to schedule pods properly.它有助于 Kubernetes 正确调度 pod。

If the requests value is too high, then Kubernetes may not have any node that fulfills these requirements and your pod may not run at all.如果requests值太高,那么 Kubernetes 可能没有满足这些要求的任何节点,您的 pod 可能根本无法运行。

Check this link for more details: https://sysdig.com/blog/kubernetes-limits-requests/查看此链接了解更多详情: https://sysdig.com/blog/kubernetes-limits-requests/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM