[英]Kubernetes deployment with two replicas: One pod is running, the other fails
We have a deployment of a simple Node.js application with replica=2
.我们部署了一个带有
replica=2
的简单 Node.js 应用程序。 The first pod comes up and is perfectly running, the second pod is in state CrashLoopBackOff
, because its readiness probe failed:第一个 pod 出现并完美运行,第二个 pod 处于
CrashLoopBackOff
状态,因为它的就绪探测失败:
Readiness probe failed: Get http://100.107.65.32:8000/ : dial tcp 100.107.65.32:8000: getsockopt: connection refused
就绪探测失败:获取http://100.107.65.32:8000/ :拨打 tcp 100.107.65.32:8000:getsockopt:连接被拒绝
Unfortunately, the logs are empty, no matter whether you specify --previous
or not.不幸的是,无论您是否指定
--previous
,日志都是空的。
It can't be a problem with the container or the underlying image, since pod 1 works without any hassle.容器或底层映像不会有问题,因为 pod 1 可以毫无困难地工作。 I have found https://github.com/kubernetes/kubernetes/issues/62594 , but that is open and the solution proposed there is rather a workaround than a fix, especially since it does not explain anything on why this happens.
我找到了https://github.com/kubernetes/kubernetes/issues/62594 ,但这是开放的,并且提出的解决方案是一种解决方法而不是修复,特别是因为它没有解释为什么会发生这种情况。
Any ideas of how to proceed with this?关于如何进行此操作的任何想法?
The problem could be solved 🎉问题可以解决🎉
Actually, the pod was just takings its time to start, and the probes started too early, when the pod was not yet ready.实际上,吊舱只是在花时间启动,而探测启动得太早,此时吊舱还没有准备好。 Increasing the initial probe delay helped.
增加初始探测延迟有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.