Skip to content
Latchkey

kubectl rollout status: Command Reference for CI/CD

The canonical CI gate: wait for a deploy, fail on a bad one.

kubectl rollout status blocks until a rollout finishes or its progress deadline is exceeded, returning non-zero on failure. That exit code is what makes it the ideal deploy gate. This reference covers its flags and how to bound it.

Common flags and usage

  • rollout status deploy/<name>: block until the rollout completes
  • --timeout=120s: cap the wait, then exit non-zero
  • --watch=false: report current status once and return
  • --revision=N: check a specific revision rolled out
  • Works on Deployments, StatefulSets, and DaemonSets

Example

shell
kubectl set image deploy/web web=web:${IMAGE_TAG}
kubectl rollout status deploy/web --timeout=180s || {
  kubectl rollout undo deploy/web
  exit 1
}

In CI

Place rollout status immediately after any change that triggers a rollout (apply, set image, helm upgrade). It exits non-zero on "exceeded its progress deadline" which correctly fails the pipeline. Always pass --timeout so the step fails fast instead of hanging until the job-level timeout.

Key takeaways

  • rollout status exits non-zero on a failed rollout: the gate you want.
  • Always pass --timeout so CI fails fast, not at the job ceiling.
  • Pair a failed gate with rollout undo to auto-restore service.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →