Kubernetes capacity planning: How to rightsize the requests of your cluster

网友投稿 615 2022-11-30

Kubernetes capacity planning: How to rightsize the requests of your cluster

Kubernetes capacity planning: How to rightsize the requests of your cluster

​​capacity planning is one of the main challenges that infrastructure engineers have to face, as ​​understanding Kubernetes limits and requests​​ is not an easy thing.

You might be reserving way more resources than you need to ensure your containers don’t run out of memory, or are CPU throttled. If you are in this situation, you’re going to be charged for those resources even if they aren’t being used, and it will also make deployments more difficult to schedule. That’s why Kubernetes capacity planning is always a balance between the stability and reliability of the cluster, and the correct use of the resources.

您可能会保留比所需更多的资源,以确保您的容器不会耗尽内存,或者 CPU 受到限制。如果您处于这种情况,即使这些资源没有被使用,您也会为这些资源付费,而且这也会使部署更难以安排。这就是为什么 Kubernetes 容量规划总是在集群的稳定性和可靠性以及资源的正确使用之间取得平衡。

In this article, you’ll learn how to identify unused resources and how to rightsize the capacity of your cluster.

Don’t be a greedy developer

There are situations where a container requests more resources than it needs. If it’s just a container, it may not have a critical impact on the invoice from your cloud provider. But if this happens in all the containers, you’ll have several extra costs in your invoices in a large cluster.

Not to mention that if pods are too big, you may spend extra effort debugging scheduling issues. After all, it’s harder for Kubernetes to schedule bigger Pods following your priorities.

更不用说如果 pod 太大,您可能会花费额外的精力来调试调度问题。毕竟,Kubernetes 很难按照您的优先级安排更大的 Pod。

Two open-source tools will help you with Kubernetes capacity planning:

​​kube-state-metrics​​: An add-on agent to generate and expose cluster-level metrics.​​CAdvisor​​: A resource usage analyzer for containers.

With these tools running in your cluster, you’ll be able to avoid resource underuse and rightsize the requests for your cluster.

通过在集群中运行这些工具,您将能够避免资源未充分利用并调整集群请求的大小。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Jenkins SonarQube CI 流水线集成 命令行方式优化
下一篇:使用@Valid 校验嵌套对象
相关文章

 发表评论

暂时没有评论,来抢沙发吧~