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

When upgrading nodes, why does kubernetes terminate pods before the new pod is in a ready state?

· 52CE 我爱测

As you can see in the picture below, when upgrading nodes to a new version of Kubernetes, the pods on each node are recreated on a new node with a newer version of Kubernetes. However, it seems that the old pods are being destroy…

问题原文

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

As you can see in the picture below, when upgrading nodes to a new version of Kubernetes, the pods on each node are recreated on a new node with a newer version of Kubernetes.

However, it seems that the old pods are being destroyed (Terminating) without waiting for the new pods to be in a Ready state, leading to downtime as the new pods are still in a ContainerCreating state.

Is there an explanation for this, or am I doing something wrong?

已采纳解答

原帖链接 · Robert Bailey · CC BY-SA 4.0

When a node is upgraded, GKE will first drain the pods from the node before removing the deleting the virtual machine and removing from the node from the cluster. The process for terminating a pod is explained in detail here and what you should realize is that this process starts before the new pods is created, scheduled, or starts running.

If you have a deployment and want to keep a specific number of replicas up during the node upgrade process, you should configure pod disruption budgets, with which you can ensure that the node upgrade process will proceed at a slow enough rate to keep enough containers running for your service to handle traffic without any downtime.

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

资料来源与适用范围

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

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

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