Engineering

Kubectl Rollout Status Deployment 2026: Monitor Kubernetes Deployments

Engineering Team

Kubectl rollout status deployment is the essential command for monitoring Kubernetes deployment progress. It provides real-time feedback during rollouts and integrates seamlessly with CI/CD pipelines. This guide covers everything you need to know about tracking deployment status in 2026.

Quick Reference: Kubectl Rollout Status Commands

CommandDescription
kubectl rollout status deployment/nginxMonitor deployment rollout
kubectl rollout status deployment/nginx --timeout=5mWith timeout
kubectl rollout status deployment/nginx --watch=falseNon-blocking check
kubectl rollout status deployment/nginx --revision=3Specific revision
kubectl rollout status statefulset/mysqlStatefulSet status
kubectl rollout status daemonset/fluentdDaemonSet status

What Is Kubectl Rollout Status?

The kubectl rollout status command monitors a workload’s rollout until completion. It blocks execution and provides real-time updates, making it ideal for CI/CD pipelines and deployment scripts.

How It Works

  1. Command connects to Kubernetes API
  2. Watches deployment conditions and pod states
  3. Reports progress until rollout completes
  4. Exits with code 0 (success) or non-zero (failure)

Exit Codes

CodeMeaningAction
0Rollout successfulDeployment complete
1Rollout failedCheck deployment events
Non-zeroTimeout/ErrorInvestigate and retry

Basic Usage

Monitor Deployment Rollout

kubectl rollout status deployment/nginx

Output during rollout:

Waiting for deployment "nginx" rollout to finish: 0 of 3 updated replicas are available...
Waiting for deployment "nginx" rollout to finish: 1 of 3 updated replicas are available...
Waiting for deployment "nginx" rollout to finish: 2 of 3 updated replicas are available...
deployment "nginx" successfully rolled out

With Namespace

kubectl rollout status deployment/api-server -n production

StatefulSet and DaemonSet

# StatefulSet
kubectl rollout status statefulset/mysql

# DaemonSet
kubectl rollout status daemonset/fluentd

Advanced Options

Set Timeout

Fail if rollout doesn’t complete within specified time:

# 5 minute timeout
kubectl rollout status deployment/nginx --timeout=5m

# 300 second timeout
kubectl rollout status deployment/nginx --timeout=300s

# 2 minute timeout
kubectl rollout status deployment/nginx --timeout=2m

Non-Blocking Check

Get current status without waiting:

kubectl rollout status deployment/nginx --watch=false

Output:

deployment "nginx" successfully rolled out
# or
Waiting for deployment "nginx" rollout to finish: 1 of 3 updated replicas are available...

Monitor Specific Revision

# Check specific revision status
kubectl rollout status deployment/nginx --revision=3

Understanding Output Messages

Common Status Messages

MessageMeaning
0 of N updated replicas are availableNew pods starting
N of N updated replicas are availableAll pods ready
M old replicas are pending terminationOld pods shutting down
deployment "X" successfully rolled outComplete
error: deployment "X" exceeded its progress deadlineTimeout/failure

Example Complete Rollout

$ kubectl rollout status deployment/api
Waiting for deployment "api" rollout to finish: 0 of 3 updated replicas are available...
Waiting for deployment "api" rollout to finish: 1 of 3 updated replicas are available...
Waiting for deployment "api" rollout to finish: 2 of 3 updated replicas are available...
deployment "api" successfully rolled out

Example Failed Rollout

$ kubectl rollout status deployment/api --timeout=2m
Waiting for deployment "api" rollout to finish: 1 of 3 updated replicas are available...
error: timed out waiting for rollout to finish

CI/CD Integration

GitHub Actions

name: Deploy
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to Kubernetes
        run: |
          kubectl apply -f deployment.yaml
          kubectl rollout status deployment/api --timeout=5m
        env:
          KUBECONFIG: ${{ secrets.KUBECONFIG }}

GitLab CI

deploy:
  stage: deploy
  script:
    - kubectl apply -f k8s/
    - kubectl rollout status deployment/api -n production --timeout=300s
  only:
    - main

Jenkins Pipeline

pipeline {
    stages {
        stage('Deploy') {
            steps {
                sh '''
                kubectl apply -f deployment.yaml
                kubectl rollout status deployment/api --timeout=5m
                '''
            }
        }
    }
}

Bash Script with Error Handling

#!/bin/bash
set -e

DEPLOYMENT="api"
NAMESPACE="production"
TIMEOUT="5m"

echo "Deploying $DEPLOYMENT..."
kubectl apply -f deployment.yaml

echo "Waiting for rollout to complete..."
if kubectl rollout status deployment/$DEPLOYMENT -n $NAMESPACE --timeout=$TIMEOUT; then
    echo "Deployment successful!"
    exit 0
else
    echo "Deployment failed!"
    kubectl rollout undo deployment/$DEPLOYMENT -n $NAMESPACE
    exit 1
fi

Troubleshooting Failed Rollouts

Step 1: Check Rollout Status

kubectl rollout status deployment/api --watch=false

Step 2: Describe Deployment

kubectl describe deployment api | tail -20

Look for conditions and events:

Conditions:
  Type           Status  Reason
  ----           ------  ------
  Available      True    MinimumReplicasAvailable
  Progressing    False   ProgressDeadlineExceeded

Step 3: Check Pod Status

# Find problematic pods
kubectl get pods -l app=api

# Describe failing pod
kubectl describe pod api-new-abc123

Step 4: Check Logs

# Current pod logs
kubectl logs api-new-abc123

# Previous container logs (if restarting)
kubectl logs api-new-abc123 --previous

Step 5: Check Events

kubectl get events --sort-by='.lastTimestamp' | grep api

Common Failure Causes

IssueSymptomSolution
Image pull failureImagePullBackOffCheck image name, registry access
Readiness probe failingPods not readyFix probe or app startup
Resource limitsOOMKilledIncrease memory limits
Config issuesCrashLoopBackOffCheck ConfigMaps, Secrets
Liveness probePod restartsIncrease probe delays

View Rollout History

kubectl rollout history deployment/api

Output:

deployment.apps/api
REVISION  CHANGE-CAUSE
1         kubectl apply --filename=deployment.yaml
2         kubectl set image deployment/api api=api:v1.1.0
3         kubectl rollout restart deployment/api

View Specific Revision

kubectl rollout history deployment/api --revision=2

Undo Rollout

# Undo last rollout
kubectl rollout undo deployment/api

# Undo to specific revision
kubectl rollout undo deployment/api --to-revision=2

Pause and Resume

# Pause rollout
kubectl rollout pause deployment/api

# Resume rollout
kubectl rollout resume deployment/api

Progress Deadline Configuration

Kubernetes has a progress deadline that determines when a rollout is considered failed.

Set Progress Deadline

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  progressDeadlineSeconds: 600  # 10 minutes (default)
  replicas: 3
  template:
    spec:
      containers:
        - name: api
          image: api:latest

Progress Deadline Values

ValueUse Case
300 (5m)Quick deployments
600 (10m)Standard apps (default)
900 (15m)Large deployments
1800 (30m)Slow-starting apps

Monitoring Multiple Deployments

Sequential Monitoring

#!/bin/bash
DEPLOYMENTS=("api" "worker" "scheduler")
NAMESPACE="production"

for deploy in "${DEPLOYMENTS[@]}"; do
    echo "Checking $deploy..."
    kubectl rollout status deployment/$deploy -n $NAMESPACE --timeout=5m
done

Parallel Monitoring

#!/bin/bash
kubectl rollout status deployment/api -n production &
kubectl rollout status deployment/worker -n production &
kubectl rollout status deployment/scheduler -n production &
wait
echo "All deployments complete"

Check All Deployments in Namespace

# List all deployment statuses
kubectl get deployments -n production

# Watch all deployments
kubectl get deployments -n production -w

Best Practices

1. Always Set Timeouts in CI/CD

kubectl rollout status deployment/api --timeout=5m || exit 1

2. Combine with Apply

kubectl apply -f deployment.yaml && \
kubectl rollout status deployment/api --timeout=5m

3. Auto-Rollback on Failure

#!/bin/bash
if ! kubectl rollout status deployment/api --timeout=5m; then
    echo "Rollout failed, rolling back..."
    kubectl rollout undo deployment/api
    exit 1
fi

4. Log Rollout Details

#!/bin/bash
echo "Starting deployment at $(date)"
kubectl apply -f deployment.yaml

if kubectl rollout status deployment/api --timeout=5m; then
    echo "Deployment succeeded at $(date)"
    kubectl get deployment api -o yaml > deployment-success.yaml
else
    echo "Deployment failed at $(date)"
    kubectl describe deployment api > deployment-failure.txt
    kubectl logs -l app=api --tail=100 >> deployment-failure.txt
fi

5. Use with Progress Deadline

spec:
  progressDeadlineSeconds: 300  # Match your --timeout

Comparison with Alternatives

MethodBlockingExit CodeBest For
kubectl rollout statusYesYesCI/CD, scripts
kubectl get deploymentNoNoQuick checks
kubectl describe deploymentNoNoDebugging
kubectl get pods -wYesNoVisual monitoring

Conclusion

Kubectl rollout status deployment is essential for reliable Kubernetes deployments in 2026. Key takeaways:

  • Use in all CI/CD pipelines for deployment verification
  • Always set timeouts with --timeout
  • Combine with kubectl rollout undo for auto-rollback
  • Check exit codes for automation
  • Use --watch=false for non-blocking status checks

Master this command to build robust deployment pipelines and catch issues early.


Need help with Kubernetes deployments? Book a free 30-minute consultation with our DevOps experts.

Chat with real humans
Chat on WhatsApp