how to stop/pause a pod in kubernetes
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Kubernetes has no native "pause" or "stop" command for pods. Pods are either running or terminated — there is no suspended state. To effectively stop a pod, you scale its controlling Deployment or StatefulSet to zero replicas. To "pause" a pod (keep it running but idle), you can patch it with a command override that sleeps, use kubectl rollout pause, or suspend a CronJob. The right approach depends on whether you want to stop the workload temporarily, debug it, or prevent new instances from running.
Scale to Zero Replicas (Most Common)
This terminates all pods managed by the Deployment. The Deployment definition stays intact, so scaling back up restarts the pods with the same configuration.
For StatefulSets:
Pause a Deployment Rollout
kubectl rollout pause prevents new ReplicaSets from being created during updates but does not stop running pods:
This is useful when you want to batch multiple config changes into a single rollout instead of triggering separate updates for each change.
Delete the Pod Directly
Deleting a pod managed by a Deployment causes the controller to spawn a replacement immediately. To stop the pod permanently, delete the Deployment or scale it to zero first.
Override the Pod Command (Sleep/Pause)
To keep the pod running but idle (for debugging), override its command:
To resume, remove the command override:
Suspend a CronJob
Suspending a CronJob does not terminate already-running Job pods. It only prevents new executions from starting.
Using kubectl debug for Inspection
YAML Examples
Scale to Zero in a Manifest
Using Kustomize to Toggle
Comparison of Methods
| Method | Stops Pods | Preserves State | Use Case |
| Scale to 0 | Yes | PVCs retained | Temporary shutdown |
| Delete pod | Yes (recreated) | No | Force restart |
| Rollout pause | No | N/A | Batch config changes |
| Sleep override | Pod idle | Containers running | Debugging |
| Suspend CronJob | No new runs | N/A | Disable scheduled jobs |
Common Pitfalls
- Deleting a pod without scaling down: If the pod is managed by a Deployment or ReplicaSet, deleting it causes Kubernetes to immediately create a replacement. Scale the Deployment to zero replicas first, then the pod terminates permanently.
- Confusing
rollout pausewith stopping pods:kubectl rollout pauseonly prevents new rollouts from proceeding. It does not stop or pause running pods. Existing pods continue running normally. - Losing PersistentVolumeClaim data: Scaling a StatefulSet to zero keeps its PVCs by default, but scaling a Deployment to zero does not protect dynamically provisioned volumes unless the reclaim policy is
Retain. Verify your PV reclaim policy before scaling down. - Not accounting for graceful shutdown: When a pod is terminated, Kubernetes sends
SIGTERMand waits up toterminationGracePeriodSeconds(default 30s) before sendingSIGKILL. If your application needs more time to shut down cleanly, increase this value in the pod spec. - Suspending a CronJob while a Job is running:
suspend: trueprevents new Jobs from starting but does not terminate the currently running Job. If you need to stop an active Job, delete its pods separately withkubectl delete job <job-name>.
Summary
- Kubernetes has no "pause pod" command — scale Deployments/StatefulSets to 0 replicas instead
kubectl scale deployment <name> --replicas=0is the standard way to stop podskubectl rollout pauseprevents new rollouts but does not stop running pods- Override the container command to
sleep infinityfor a running-but-idle debug pod - Use
suspend: trueon CronJobs to prevent new scheduled executions - Deleting a pod managed by a controller causes immediate replacement — always scale down first
Related reading
- How to strip the path prefix in Kubernetes Traefik ingress?
- How to switch kubectl clusters between gcloud and minikube
- How to switch namespace in kubernetes
- How to troubleshoot metrics-server on kubeadm?
- How to tag docker image with docker-compose
- How to unset ENV in dockerfile?
- How to store AWS Cognito User Pool users in DB for instance DynamoDB?
- How to store user information with DynamoDB and Cognito using Facebook authentication with iOS SDK

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.