Question

Difficulty: EasyManaging Google Kubernetes Engine Resources

An administrator observes that a recent container image update to a Google Kubernetes Engine (GKE) deployment named `web-app` introduced application errors. The administrator needs to inspect the revision history, roll back the deployment to the previous working revision, and confirm that the rollback completes successfully. What is the correct chronological sequence of `kubectl` commands to perform this operation?

  1. 1Inspect the revision history of the deployment using `kubectl rollout history deployment/web-app`.
  2. 2Revert the deployment to its previous stable revision using `kubectl rollout undo deployment/web-app`.
  3. 3Verify that the rollback operation has finished successfully using `kubectl rollout status deployment/web-app`.

Answer

The correct sequence of operations is: First, inspect the revision history (`kubectl rollout history deployment/web-app`). Second, execute the rollback to the previous revision (`kubectl rollout undo deployment/web-app`). Third, monitor and verify the rollout status (`kubectl rollout status deployment/web-app`).
When managing GKE workloads, the proper sequence for restoring a failed deployment rollout is: 1) inspect the revision history to identify previous versions (`kubectl rollout history`), 2) revert the deployment to the previous revision (`kubectl rollout undo`), and 3) monitor the progress until completion (`kubectl rollout status`).

Step-by-Step Solution

1
Run `kubectl rollout history deployment/web-app`
Displays the list of deployment revisions and change causes.
You must inspect the revision history first to verify previous revision numbers before performing a rollback.
2
Run `kubectl rollout undo deployment/web-app`
Initiates a rolling update to revert the deployment spec to the previous revision.
The `rollout undo` command is the standard Kubernetes command to revert a workload deployment to its prior state.
3
Run `kubectl rollout status deployment/web-app`
Streams the status updates until all target replicas are running and ready.
Monitoring the status ensures the rollback completes without hanging or failing due to pod creation issues.

Key Concept

GKE Deployment Rollback Operations
Rate this question