大网数据广告活动
服务器运维问答

How could I find the Kubernetes Pod restart reasons

· 52CE 我爱测

In have scaled my Pods to 20 in my cluster and when I see the next day the few of the scaled Pods were recreated. When I say Pod recreated, it is getting deleted and created freshly and the timestamp of the recreated Pod and the …

问题原文

原帖链接 · Nikhil · CC BY-SA 4.0

In have scaled my Pods to 20 in my cluster and when I see the next day the few of the scaled Pods were recreated.

When I say Pod recreated, it is getting deleted and created freshly and the timestamp of the recreated Pod and the scaled Pods vary.

I was unable to find the reasons for the recreate of the Pods.

I could not find which Pod went for a recreate as the Pod is deleted and gone away. There are no logs in the journalctl regarding which Pod got recreated. Is there any way I can debug further to find the reason for the Pod recreate? Or what might be the reason for the PODs getting deleted?

Note: I have readiness and liveness probes defined, but these probes would act on container and would not lead to Pod recreate in my understanding.

已采纳解答

原帖链接 · Denis Romaniuk · CC BY-SA 4.0

Basically you need to check Pod's events (here is a tip how to do it).

Keep in mind, that events retention period is too short (approximately 1h), and you may need to store them somewhere else. Here is a good article how to do it with EFK stack

The most common reason of Pods recreation - Node unavailability. If Pod's Node is not available, Kubernetes recreates the Pods in other nodes.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-05-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。