<p>I just tested Ranche RKE , upgrading kubernetes 13.xx to 14.xx , during upgrade , an already running nginx Pod got restarted during upgrade. Is this expected behavior? </p>

<p>Can we have Kubernetes cluster upgrades without user pods restarting? </p>

<p>Which tool supports un-intruppted upgrades?</p>

<p>What are the downtimes that we can never aviod? ( apart from Control plane )</p>

<p>The default way Kubernetes upgrades is by doing a rolling upgrade of the nodes, one at a time.</p>

<p>This works by draining and cordoning (marking the node as unavailable for new deployments) each node that is being upgraded so that there no pods running on that node.</p>

<p>It does that by creating a new revision of the existing pods on another node (if it's available) and when the new pod starts running (and answering to the readiness/health probes), it stops and remove the old pod (sending <code>SIGTERM</code> to each pod container) on the node that was being upgraded.</p>

<p>The amount of time Kubernetes waits for the pod to graceful shutdown, is controlled by the <code>terminationGracePeriodSeconds</code> on the pod spec, if the pod takes longer than that, they are killed with <code>SIGKILL</code>.</p>

<p>The point is, to have a graceful Kubernetes upgrade, you need to have enough nodes available, and your pods must have correct liveness and readiness probes (<a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/</a>).</p>

<p>Some interesting material that is worth a read:  </p>

<p><a href="https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-upgrading-your-clusters-with-zero-downtime" rel="nofollow noreferrer">https://cloud.google.com/blog/products/gcp/kubernetes-best-practices-upgrading-your-clusters-with-zero-downtime</a> (specific to GKE but has some insights)<br>
<a href="https://blog.gruntwork.io/zero-downtime-server-updates-for-your-kubernetes-cluster-902009df5b33" rel="nofollow noreferrer">https://blog.gruntwork.io/zero-downtime-server-updates-for-your-kubernetes-cluster-902009df5b33</a></p>
