Restarting / bringing down pods
| Method | Downtime | In-memory cleared | Use when |
|---|
| Delete pod | Minimal | No | Quick restart |
| Rolling restart | None | No | Zero-downtime redeploy |
| Scale to 0 | Yes | Yes | Testing cold start / persistence |
# Scale to 0 (full teardown)
kubectl scale deployment <app> --replicas=0 -n <ns>
kubectl scale deployment <app> --replicas=1 -n <ns>
# Delete pod (auto-replaced by K8s)
kubectl delete pod <pod-name> -n <ns>
# Rolling restart
kubectl rollout restart deployment/<app> -n <ns>
Watch pod status
kubectl get pods -n <ns> -w
kubectl logs -f deployment/<app> -n <ns>