简体   繁体   English

具有两个副本的 Kubernetes 部署:一个 pod 正在运行,另一个失败

[英]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.

相关问题 Pod 副本如何相互同步 - Kubernetes? - How pod replicas sync with each other - Kubernetes? Kubernetes部署多个副本-如何将副本编号传递给Pod - Kubernetes deployment multiple replicas - how to pass replica number to pod kubernetes部署中当前和可用pod复制品之间有什么区别? - What is the difference between current and available pod replicas in kubernetes deployment? kubernetes,有 2 个 pod 副本 - kubernetes, have 2 replicas of the pod Clickhouse 作为 kubernetes 部署与副本 - Clickhouse as kubernetes deployment with replicas Kubernetes 管理一个集群中不同应用的pod副本之间的流量 - Kubernetes management of traffic between pod replicas of different applications in one cluster Kubernetes服务与部署中的一个Pod在一起吗? - Kubernetes service with exactly one pod from a deployment? 在 Kubernetes 部署中的任意一个 Pod 上运行进程 - Run process on any one Pod in the Kubernetes deployment 如何在正在运行的 kube.netes 集群中更改 pod 的图像(没有部署的 pod) - How to change image of a pod in a running kubernetes cluster (pod without deployment) pod - 如何从部署的 n 个副本中仅杀死或停止一个 pod - pod - How to kill or stop only one pod from n replicas of a deployment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM