KCNA practice question 6 of 25

In Kubernetes, which command is the most efficient way to check the progress of a Deployment rollout and confirm if it has completed successfully?

Full set: 240 questions
Answer options
A: kubectl get deployments --show-labels -o wide
B: kubectl describe deployment my-deployment --namespace=default
C: kubectl logs deployment/my-deployment --all-containers=true
D: kubectl rollout status deployment/my-deployment Correct answer
Correct Answer:
D. kubectl rollout status deployment/my-deployment
Explanation

The kubectl rollout status command is specifically designed to monitor the progress of a Deployment's update in real-time. It actively watches the resource and provides live feedback as new pods are created and old ones are terminated. The command exits with a zero status code upon successful completion or a non-zero code on failure, making it the most efficient tool for both interactive checks and automated scripting within CI/CD pipelines. Other commands provide static snapshots of information, requiring repeated execution to track progress.

Why Incorrect

A. kubectl get deployments provides a static, one-time view of the deployment's state, not a continuous progress report.
B. kubectl describe deployment gives a detailed but static snapshot of the configuration and recent events, not an efficient live status check.
C. kubectl logs is used to view the output from application containers, not to check the status of the Kubernetes deployment process itself.

References

1. Kubernetes Documentation, "kubectl Cheat Sheet", kubectl Commands section. The entry for kubectl rollout status states it is used to "Watch the rollout status of a deployment."

2. Kubernetes Documentation, "Tasks > Manage Deployments > Checking Rollout Status of a Deployment". This section explicitly recommends kubectl rollout status deployment/ as the standard method.

3. O'Reilly, "Kubernetes Up and Running, 3rd Edition" by Brendan Burns, Joe Beda, Kelsey Hightower, and Lachlan Evenson. Chapter 10, "Deployments", describes using kubectl rollout status to monitor the progress of an update.

Scroll to Top