Does PODS get rescheduled if Kubernetes node gets killed due to power failure?

Viewed 412

Does pod running on a Kubernetes node gets rescheduled if the Kubernetes nodes gets killed due to power failure. And if gets rescheduled and if that nodes comes up what happens to the pod running on that node?

1 Answers

Warning: this answer is based on the assumption you don't create an ad-hoc Pod, but instead manage your pods via a Deployment, StatefulSet, DaemonSet or any other controller. If it's an ad-hoc pod you created manually - it won't be rescheduled.

Does pod running on a Kubernetes node gets rescheduled if the Kubernetes nodes gets killed due to power failure.

Whether and when it gets rescheduled depends on its node.kubernetes.io/not-ready and node.kubernetes.io/unreachable tolerations.

As of current stable kubernetes here are the defaults:

  tolerations:
    - key: node.kubernetes.io/not-ready
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300
    - key: node.kubernetes.io/unreachable
      operator: Exists
      effect: NoExecute
      tolerationSeconds: 300

So, with these defaults - a pod on a died node would be rescheduled after 300 seconds (5 minutes).

And if gets rescheduled and if that nodes comes up what happens to the pod running on that node?

If a node is restarted - then a pod won't be started on next boot, and the kubelet would cleanup everything needed.

Related