Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Kubernetes 在终止 pod 之前向 pod 中的容器发送 SIGTERM 信号
重新启动 Pod 时是否会发送类似的信号?
取决于您在这里通过 pod 重新启动的意思。如果 pod 由于底层节点丢失而停止运行,然后更高级别的控制器重新启动它,那么您可能/可能看不到任何信号正在传递,因为它是意外终止。
另一方面,如果您谈论的是计划终止,其中控制器杀死/驱逐一个 pod 并在(可能不同的)节点上启动一个相同类型的新 pod,您将看到相同的事件集(SIGTERM -> termination_grace_period > SIGKILL)发生就像一个 pod 被杀死的情况一样。
SIGTERM -> termination_grace_period > SIGKILL