Does "kubectl rollout restart deploy" cause downtime? Does "kubectl rollout restart deploy" cause downtime? kubernetes kubernetes

Does "kubectl rollout restart deploy" cause downtime?


kubectl rollout restart deploy -n namespace1 will restart all deployments in specified namespace with zero downtime.

Restart command will work as follows:

  1. After restart it will create new pods for a each deployments
  2. Once new pods are up (running and ready) it will terminate old pods

Add readiness probes to your deployments to configure initial delays.


@pcsutar 's answer is almost correct. kubectl rollout restart $resourcetype $resourcename restarts your deployment, daemonset or stateful set according to the its update strategy. so if it is set to rollingUpdate it will behave exactly as the above answer:

  1. After restart it will create new pods for a each deployments
  2. Once new pods are up (running and ready) it will terminate old pods

Add readiness probes to your deployments to configure initial delays.

However, if the strategy for example is type: recreate all the currently running pods belonging to the deployment will be terminated before new pods will be spun up!