如果 Kubernetes 节点因电源故障而被杀死,在 Kubernetes 节点上运行的 pod 是否会重新安排。如果重新安排并且该节点出现,那么在该节点上运行的 pod 会发生什么情况?
最佳答案
警告:此答案基于以下假设:您不创建临时 Pod,而是通过 Deployment、StatefulSet、DaemonSet 或任何其他 Controller 管理您的 Pod。如果它是您手动创建的临时广告连播 - 它不会被重新安排。
Does pod running on a Kubernetes node gets rescheduled if the Kubernetes nodes gets killed due to power failure.
它是否以及何时被重新安排取决于它的 node.kubernetes.io/not-ready
和 node.kubernetes.io/unreachable
容忍度。
对于当前稳定的 kubernetes,这里是默认值:
tolerations:
- key: node.kubernetes.io/not-ready
operator: Exists
effect: NoExecute
tolerationSeconds: 300
- key: node.kubernetes.io/unreachable
operator: Exists
effect: NoExecute
tolerationSeconds: 300
因此,使用这些默认值 - 死亡节点上的 pod 将在 300 秒(5 分钟)后重新安排。
And if gets rescheduled and if that nodes comes up what happens to the pod running on that node?
如果一个节点被重启——那么 pod 将不会在下次启动时启动,kubelet 将清理所有需要的东西。
关于kubernetes - 如果 Kubernetes 节点因电源故障而被杀死,PODS 是否会重新安排?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68766989/