Kubernetes how-to

kubectl rollout restart: Restart Pods Without Downtime

kubectl rollout restart restarts the pods of a Deployment by running a rolling update on it. It does not change the image or the config, so it is the clean way to get pods to start again when they read configuration only at start-up. Each old pod is replaced according to the Deployment update strategy.

By , Founder at SeaGit

·

Key takeaways

  • kubectl rollout restart deployment/NAME replaces the pods one batch at a time. It is a rolling update with no image change.
  • Pods are removed only as the replacements become ready, so the restart is zero downtime only if the new pods pass their readiness probe.
  • Restarting a namespace or a label selector touches every matching Deployment. Check the scope before you press enter.
  • To go back, use kubectl rollout undo. Undo returns the pod template to the previous revision; it does not undo a restart on its own.

What kubectl rollout restart actually does

A Deployment owns a ReplicaSet, and the ReplicaSet owns the pods. A restart is a change to the pod template that causes a new ReplicaSet and a new rollout. The controller then follows the Deployment strategy: it creates new pods, waits for them to become ready, and removes old pods within the limits of maxSurge and maxUnavailable.

Because the process is an ordinary rollout, you can watch it with the same commands you use for a deploy. You do not need to delete pods by hand, and you do not need to edit the manifest.

bash
# Restart one Deployment in the prod namespace
kubectl rollout restart deployment/my-api -n prod

# Wait until the rollout finishes or fails
kubectl rollout status deployment/my-api -n prod

# Watch the pods being replaced
kubectl get pods -n prod -l app=my-api -w
Restart, then wait on rollout status. A non-zero exit from status means the rollout did not complete.

When a restart is the right fix

Restart when the pods are healthy but holding a stale value. The common cases are a rotated credential or a changed setting that the application reads once at start-up, a process that has leaked memory or file handles over days, and a cache that needs a clean start.

Do not use a restart to hide a crash loop. If the new pods fail the same way, the rollout stalls and the old pods keep serving, which is the protection you want, but the underlying fault is still there. Read the pod events first with kubectl describe pod.

Restart, edit, or delete?

GoalUse
Pick up a changed Secret or ConfigMap valuekubectl rollout restart, because the pod must start again
Ship a new image tagChange the image in the manifest or kubectl set image; a restart is not needed
Replace one misbehaving podkubectl delete pod NAME; the ReplicaSet creates a replacement
Restart every workload in a namespacekubectl rollout restart deployment -n NAMESPACE, after checking the list

Scope: one Deployment, a namespace, or a label

The official examples cover three scopes. One Deployment by name, every Deployment in a namespace, and every Deployment matching a label selector. The namespace form is the risky one: it restarts all of them at once, and that can include services that have nothing to do with your change.

bash
# Restart every Deployment in the test-namespace namespace
kubectl rollout restart deployment -n test-namespace

# Restart only the Deployments labelled app=nginx
kubectl rollout restart deployment --selector=app=nginx -n prod

# Restart a DaemonSet
kubectl rollout restart daemonset/log-agent -n kube-system
The first form has no filter. Run the list with kubectl get deploy -n NAMESPACE before you run it.
  • A label selector is safer than a namespace-wide restart, but check that the label matches only what you intend.
  • A rollout on a workload with one replica and maxUnavailable of 1 can take the only pod down before the new one is ready. Set maxUnavailable to 0 and maxSurge to 1 for single-replica services that must stay up.
  • A restart with a failing readiness probe does not take traffic away from the old pods, because old pods are kept until replacements are ready.

Verify the restart and undo it if it goes wrong

A restart creates a new revision of the Deployment. You can list the revisions and roll back to the previous one. Undo only reverts the pod template, so it returns the pods to the template of the previous revision. It does not restore a pod that was deleted outside a rollout.

bash
# Revisions created by restarts and updates
kubectl rollout history deployment/my-api -n prod

# Roll back to the previous revision
kubectl rollout undo deployment/my-api -n prod

# Or to a specific revision
kubectl rollout undo deployment/my-api -n prod --to-revision=3
Rollback is a rollout too, so run rollout status afterwards.

Common failure: the rollout never finishes

If rollout status waits forever, the new pods are not becoming ready. The events show why. The usual causes are a readiness probe that points at the wrong port, a container that exits on start, or a resource request that no node can satisfy.

bash
kubectl get rs -n prod -l app=my-api
kubectl describe pod -n prod -l app=my-api | sed -n '/Events:/,$p'
New pods in Pending or 0/1 Ready with an event that names the cause.

Frequently asked questions

kubectl rollout restart: Restart Pods Without Downtime: FAQ

Does kubectl rollout restart cause downtime?

It should not, if the Deployment has a readiness probe and enough replicas. Old pods are removed only after new ones become ready. With the default 25% values, a single-replica Deployment rounds maxUnavailable down to 0 and maxSurge up to 1, so the new pod starts before the old one stops. A gap appears only if maxUnavailable is set to 1 or the new pod is not actually ready when its probe passes.

Does it change the image or the config?

No. It changes only the pod template metadata so a new rollout starts. The image and the environment stay as they are in the manifest.

Can I restart a pod directly without the Deployment?

You can delete a pod with kubectl delete pod. A ReplicaSet recreates it. That replaces one pod and skips the rolling-update pacing, so it is useful for a single bad pod and not for a whole service.

Does it restart pods that are not owned by a controller?

No. A bare pod has no controller to recreate it, so restart commands that target Deployments, StatefulSets and DaemonSets do not apply to it.

Sources

Checked 11 October 2026.

  1. Kubernetes: kubectl rollout restart reference — Command syntax and the examples for a Deployment, a DaemonSet, a namespace and a label selector.
  2. Kubernetes: kubectl quick reference — rollout restart, rollout status, rollout history and rollout undo.
  3. Kubernetes: Deployments — Revisions, rollback, scaling, and the update strategy that governs pace.
  4. Kubernetes: Debug Running Pods — Reading pod events and status while a rollout is stuck.

Read next