gpt4 book ai didi

azure - Kubernetes Pod 使用 CPU 不超过 1m

转载 作者:行者123 更新时间:2023-12-02 12:13:52 24 4
gpt4 key购买 nike

我的集群位于 AKS 中,具有 5 个大小为 Standard_D4s_v3 的节点,K8s 版本为 1.14.8。

一旦 Pod 启动/重新启动,它就会显示“正在运行”(kubectl get pods),直到 Pod 处于“运行”状态为止,CPU 使用率显示 150m 或所需的数量。

但是当我在 pod 进入运行状态后将其顶上(kubectl top po)时,特定的 pod 仅显示 1m CPU 使用率,但内存使用率处于应有的水平,并且服务也关闭了。

Kubectl logs -f (pod_name) 不返回任何内容,但我可以通过 ssh 进入 pod(kubectl exec -it ....)

最佳答案

这是完全正常的行为,如果你创建 Pod,它需要更多的 CPU 资源来创建它,一旦创建它就不再需要那么多的资源。

您始终可以使用 CPU/内存限制和资源,更多相关信息以及如何操作的示例 here

Pod CPU/Memory requests define a set amount of CPU and memory that the pod needs on a regular basis. When the Kubernetes scheduler tries to place a pod on a node, the pod requests are used to determine which node has sufficient resources available for scheduling. Not setting a pod request will default it to the limit defined. It is very important to monitor the performance of your application to adjust these requests. If insufficient requests are made, your application may receive degraded performance due to over scheduling a node. If requests are overestimated, your application may have increased difficulty getting scheduled.

<小时/>

Pod CPU/Memory limits are the maximum amount of CPU and memory that a pod can use. These limits help define which pods should be killed in the event of node instability due to insufficient resources. Without proper limits set pods will be killed until resource pressure is lifted. Pod limits help define when a pod has lost of control of resource consumption. When a limit is exceeded, the pod is prioritized for killing to maintain node health and minimize impact to pods sharing the node. Not setting a pod limit defaults it to the highest available value on a given node. Don't set a pod limit higher than your nodes can support. Each AKS node reserves a set amount of CPU and memory for the core Kubernetes components. Your application may try to consume too many resources on the node for other pods to successfully run. Again, it is very important to monitor the performance of your application at different times during the day or week. Determine when the peak demand is, and align the pod limits to the resources required to meet the application's max needs.

关于azure - Kubernetes Pod 使用 CPU 不超过 1m,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59543235/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com