【发布时间】:2020-02-11 20:01:06
【问题描述】:
我有一个单节点 Kubernetes 集群,它显示 10Gi、3 个 CPU 可用(总共 16Gi、4CPU)用于在集群启动后运行 Pod。我正在尝试两种不同的场景:
Scenario-1.
Running 3 pods individually with configs(Request,Limit) as:
Pod-A: (1 Gi,3.3Gi) and (1 cpu,1 cpu)
Pod-B: (1 Gi,3.3Gi) and (1 cpu,1 cpu)
Pod-C: (1 Gi,3.3Gi) and (1 cpu,1 cpu)
在这种情况下,应用程序会在相应的 pod 中完美启动,并按预期正常工作。
Scenario-2.
Running 3 pods individually with configs(Request,Limit) as:
Pod-A: (1 Gi,10 Gi) and (1 cpu,3 cpu)
Pod-B: (1 Gi,10 Gi) and (1 cpu,3 cpu)
Pod-C: (1 Gi,10 Gi) and (1 cpu,3 cpu)
在第二种情况下,应用程序在相应的 Pod 中启动,但在对这些 Pod 中的任何一个施加一些负载后随机失败,即有时 Pod-A 宕机,有时是 Pod-2 或 Pod-3。在任何时候,我都无法同时运行所有三个 pod。
我可以在失败的 pod 中看到的唯一事件如下
“The warning which is available in node logs says "Warning CheckLimitsForResolvConf 1m (x32 over 15m) kubelet, xxx.net Resolv.conf file '/etc/resolv.conf' contains search line consisting of more than 3 domains!.”。
日志中只有这些信息,我无法找出 Pod 随机失败的实际原因。
谁能帮助我了解配置是否有问题或者我还缺少什么?
谢谢
【问题讨论】:
-
注意:如果一个 Container 超过了它的内存请求,它的 Pod 很可能会在节点内存不足时被驱逐。如果 Pod 超过 CPU 限制,就会被限制。
标签: docker kubernetes containers