Restart one deployment with kubectl rollout restart deployment/<name>, scope it to a namespace with -n <namespace>, or target several at once with --selector=key=value -n <namespace>. Each of these runs the same mechanism: it updates the deployment's pod-template annotation, which the Deployment controller reads as a signal to start a rolling update.
TL;DR:
- Before a selector restart, preview matches with kubectl get using the same namespace and labels, then narrow the selector if unrelated deployments appear.
- Use kubectl rollout status with a suitable timeout, and treat the rollout as complete only when every replacement pod is Ready, not merely Running.
- Readiness probe delays and thresholds should match actual startup behavior; the progressDeadlineSeconds default is about 600 seconds, so raise it only when measured startup warrants it.
- Reserve imperative restarts for temporary fixes; record the reason, then commit a manifest change for any lasting image, environment, or configuration update.
- When managing multiple clusters, confirm kubectl config current-context and verify the deployment namespace before acting; pass --context explicitly in scripts.
Table of Contents
- Command variants and annotated examples for restarting deployments
- Restart multiple deployments safely using selectors and namespaces
- Verify the rollout: status, pods, logs, and events
- Readiness probes and progressDeadlineSeconds affect every restart
- Prefer declarative updates when you need a traceable change
- How a desktop cluster manager speeds up safe restarts
- Operator perspective: when to restart and when to commit
- Kubezilla Desktop: streamline restart workflows
- FAQ
- Sources
Command variants and annotated examples for restarting deployments
The basic form restarts a single deployment by name:
kubectl rollout restart deployment/nginx
Add a namespace flag when the deployment does not live in your current context's default namespace:
kubectl rollout restart deployment/nginx -n staging
To restart a group of deployments that share a label, drop the resource name and use a selector instead. The kubectl rollout restart reference documents this exact pattern for restarting multiple deployments within one namespace:
kubectl rollout restart deployment --selector=app=checkout -n production
This same syntax works on other rolling-update-capable resources, not just deployments. You can restart a DaemonSet or a StatefulSet the same way, substituting the resource type:
kubectl rollout restart daemonset/fluentd -n logging
kubectl rollout restart statefulset/kafka -n messaging
When you manage more than one cluster, confirm the active context before running any of these commands:
- Run
kubectl config current-contextto check which cluster you're pointed at. - Run
kubectl config get-contextsto see every available context and spot the one you need. - Pass
--context=<name>or--kubeconfig=<path>explicitly if you're scripting restarts across clusters. - Run
kubectl get deployment -n <namespace>first to confirm the deployment actually exists where you expect it.
The most common mistake isn't a bad command, it's running a correct command against the wrong cluster or namespace. A selector that matches more resources than intended is the second most common one, which is why previewing the target list before restarting matters.
Pro Tip: Before running a selector-based restart, run the equivalent kubectl get command with the same selector and namespace flags. If the output surprises you, fix the selector before you touch rollout restart.
Restart multiple deployments safely using selectors and namespaces
Bulk restarts carry more risk than single-deployment restarts, mostly because a loose selector or namespace flag can touch resources you didn't mean to change. A short preview-then-execute workflow keeps that risk low.
- Preview the target list. Run
kubectl get deployment -l app=checkout -n productionorkubectl -n production get deploy -o nameto see exactly which deployments match before you change anything. - Narrow the selector if the list looks wrong. Add a second label, such as
tier=backend, to exclude deployments that matched by accident. - Run the restart against the confirmed selector.
kubectl rollout restart deployment --selector=app=checkout,tier=backend -n productiononly touches what you just previewed. - Verify immediately after. Follow with
kubectl get pods -l app=checkout -n productionto watch the new pods come up.
Avoid using a bare -n <namespace> restart with no selector unless you genuinely mean to restart every deployment in that namespace. It's a reasonable move during a cluster-wide credential rotation or a shared config map update, but it's rarely the right tool for fixing one misbehaving service.
Scoping by label rather than by namespace alone also keeps the blast radius predictable when a namespace hosts services at different maturity levels, such as a shared production namespace running both a stable billing service and a service still being tuned. A selector tied to app or tier labels lets you restart the tier you're working on without disturbing the rest.

Verify the rollout: status, pods, logs, and events
A restart isn't finished when the command returns, it's finished when every new pod reports Ready. The kubectl rollout status reference describes the command built for exactly this check:
kubectl rollout status deployment/nginx -n production --timeout=5m
By default, rollout status watches the latest rollout until it completes, and you can extend --timeout for services that take longer to warm up. When several rollouts might overlap, for example during a CI/CD pipeline that triggers successive automated restarts, pin the watch to a specific revision with --revision=N so you're not accidentally following a later rollout instead of the one you triggered, a detail the same reference calls out directly.
Beyond the status command, a few other checks round out verification:
kubectl get pods -l app=nginx -n production -wshows new pod names appearing and old ones terminating in real time.- The
READYcolumn needs to show matching numerators and denominators (1/1, not0/1) before you call the restart successful. kubectl logs <pod> -n productionandkubectl describe pod <pod> -n productionare the first two commands to run when a pod won't go Ready.kubectl get events -n production --sort-by=.lastTimestampsurfaces scheduling failures, image pull errors, and probe failures in one place.
A rollout is only successful once pods pass their readiness probes. A pod showing Running has started its container, but Kubernetes documentation on rolling updates is clear that the Deployment controller marks a rollout successful only when pods meet their Ready condition, not merely when they're Running. That distinction explains most of the "my restart finished but traffic still looks wrong" confusion operators run into.
Readiness probes and progressDeadlineSeconds affect every restart
Most rollouts that appear "stuck" aren't stuck at all, they're waiting on a readiness probe that doesn't match how long your application actually takes to warm up. Fixing this is usually a tuning problem, not a Kubernetes problem.
Readiness probes need to reflect real startup behavior, not a guess made when the service was first written:
initialDelaySecondsshould roughly match the time your app needs before it can answer a health check honestly.periodSecondsandfailureThresholdtogether set how long Kubernetes tolerates a slow or flaky check before giving up on a pod.- A probe hitting an endpoint that depends on a cold cache or a slow database connection will fail repeatedly right after restart, even though the app is fine a few seconds later.
The Deployment documentation notes that progressDeadlineSeconds defaults to roughly 600 seconds, the window Kubernetes gives a rollout before marking it ProgressDeadlineExceeded. Applications with heavier startup work, large in-memory caches or slow dependency checks among them, can blow past that default and get flagged as failed when they would have gone Ready a minute later. Raising progressDeadlineSeconds to match your application's real startup time, confirmed with kubectl describe pod output and probe logs, removes a whole category of false failures.
Pro Tip: When a restart hangs, check kubectl describe pod for probe failure messages before touching any Kubernetes setting. Half the time the fix is in your app's health check, not in the deployment spec.
Prefer declarative updates when you need a traceable change
An imperative restart is fast, but it leaves no record in your manifests of why the pods changed. For anything beyond a quick fix, a declarative pattern keeps the change auditable.
- Edit the deployment YAML to reflect the actual change you want, a new image tag, an updated environment variable, a config map reference.
- Commit it to git and let
kubectl apply -f deployment.yamlor a sync from ArgoCD or Flux pick it up, which the Kubernetes rolling update guide recommends for production auditability over ad hoc imperative commands. - If you need the restart immediately but still want a trace, patch the pod template annotation directly with
kubectl patch deployment/nginx -p '{"spec":{"template":{"metadata":{"annotations":{"kubectl.kubernetes.io/restartedAt":"'$(date +%Y-%m-%dT%H:%M:%S%z)'"}}}}}'and note the change in your deployment log or ticket.
Use the imperative restart for genuine emergencies: clearing a stuck cache, confirming a fix works before writing it up, or recovering a hung pod outside business hours. Reach for the declarative path for anything that should survive the next person asking "why did this restart happen?"
How a desktop cluster manager speeds up safe restarts
Running these commands by hand works, but checking the wrong context, missing a mismatched selector, or losing track of which cluster you're in costs real time across a busy week. A unified view across clusters removes most of that friction. Kubezilla Desktop lets us preview matching deployments across clusters and namespaces before triggering a rollout restart, so a selector that would have caught the wrong resources shows up before anything runs.
Once a restart is underway, live log streaming and built-in pod terminals let us triage a failing pod immediately rather than switching between multiple terminal windows and a kubeconfig file. For teams managing kubeconfig access across several clusters, secure local storage keeps credentials off any cloud sync, and quick access to Helm and ArgoCD operations makes it easy to follow an emergency restart with the declarative commit that should come after it.
Operator perspective: when to restart and when to commit
I reach for rollout restart for quick fixes: clearing a cache, confirming a hunch about a flaky pod, running a smoke test after a config map update. What I don't do is leave it there. Every imperative restart gets a note in the ticket or the deploy log, and if the fix needs to stick, it becomes a manifest change the same day.
A short checklist keeps this honest: preview the target before restarting, run with a timeout you'd actually wait for, watch rollout status to completion, confirm readiness rather than just "Running," and follow up with a git commit when the change is more than a one-off. Skipping any one of these is usually fine. Skipping all of them is how a quick fix becomes an untraceable incident three weeks later.
— Margus
Kubezilla Desktop: streamline restart workflows

We built Kubezilla Desktop around exactly this workflow: preview the deployments a restart will touch, run it, and watch the rollout without juggling terminal tabs or a VPN connection. Local kubeconfig storage keeps cluster credentials on your machine, and a Rust-based native app keeps the interface fast even across several clusters at once. Licenses are available on a subscription basis, and the full feature set is on our pricing page if you want to try it on your own clusters.
FAQ
How do I restart the deployment?
Run kubectl rollout restart deployment/<name>, adding -n <namespace> if the deployment isn't in your default namespace. This updates the pod-template annotation, which tells the Deployment controller to roll out new pods one batch at a time.
How do I force a pod to restart?
Kubernetes doesn't restart an individual pod directly when it's managed by a Deployment, since the controller owns pod lifecycle. Deleting the pod with kubectl delete pod <name> -n <namespace> causes the ReplicaSet to create a replacement, or you can restart the whole deployment with kubectl rollout restart to replace every pod in a controlled sequence.
Does deleting a pod restart it?
Deleting a pod that belongs to a Deployment or ReplicaSet triggers the controller to create a new pod to replace it, which looks like a restart but only affects that one pod. It won't trigger a rolling update across the rest of the deployment's pods the way kubectl rollout restart does.
How do I perform a rollout restart in K9s?
K9s exposes a rollout restart action from its deployment view, typically triggered with a keyboard shortcut on the selected deployment, which runs the same underlying command as kubectl rollout restart. A desktop app like Kubezilla Desktop offers a similar preview-and-restart flow with live log streaming built in for watching the result immediately.
