【发布时间】:2017-07-03 03:02:59
【问题描述】:
有时,我会看到 Pod 在没有网络连接的情况下启动的问题。因此,pod 进入 CrashLoopBackOff 并且无法恢复。我能够让 pod 再次运行的唯一方法是运行 kubectl delete pod 并等待它重新安排。以下是由于此问题导致的活性探测失败的示例:
Liveness probe failed: Get http://172.20.78.9:9411/health: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
我还注意到,发生这种情况时,pod IP 没有 iptables 条目。当 pod 被删除并重新安排(并且处于工作状态)时,我有 iptables 条目。
如果我关闭容器中的 livenessprobe 并执行它,我确认它与集群或本地网络或互联网没有网络连接。
想听听关于它可能是什么的任何建议,或者我可以研究什么以进一步解决这种情况。
目前正在运行:
Kubernetes 版本:
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.7",
GitCommit:"92b4f971662de9d8770f8dcd2ee01ec226a6f6c0",
GitTreeState:"clean", BuildDate:"2016-12-10T04:49:33Z",
GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.7",
GitCommit:"92b4f971662de9d8770f8dcd2ee01ec226a6f6c0",
GitTreeState:"clean", BuildDate:"2016-12-10T04:43:42Z",
GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
操作系统:
NAME=CoreOS
ID=coreos
VERSION=1235.0.0
VERSION_ID=1235.0.0
BUILD_ID=2016-11-17-0416
PRETTY_NAME="CoreOS 1235.0.0 (MoreOS)"
ANSI_COLOR="1;32"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://github.com/coreos/bugs/issues"
【问题讨论】:
-
您不会获得未准备好的端点的 iptables 条目(例如:crashloopbackoff 中的死容器)。您应该首先诊断网络问题,“没有网络连接”是什么意思?您可以访问 google.com 吗?你能到达同一个集群中的另一个 pod 或服务吗?请开始调试:kubernetes.io/docs/user-guide/debugging-services 并报告哪一步失败。
标签: kubernetes kubelet