C1000-150 practice question 3 of 15

A new modification to the current Deployment has rendered it unstable. How can stability be regained?

Full set: 60 questions
Answer options
A: Scale the Deployment.
B: Modify the ReplicaSet.
C: Restart the Deployment.
D: Rollback to an earlier Deployment. Correct answer
Correct Answer:
D. Rollback to an earlier Deployment.
Explanation

Kubernetes Deployments maintain a revision history of changes made to their Pod templates. When a new revision, introduced by a modification, proves to be unstable (e.g., causing pods to crash-loop), the standard and intended recovery mechanism is to perform a rollback. The kubectl rollout undo deployment/ command reverts the Deployment's template to a previous, stable revision, triggering a new rollout that replaces the unstable pods with pods based on the last known-good configuration, thereby restoring stability.

Why Incorrect

A. Scaling the Deployment will only create more instances of the unstable pod, exacerbating the problem rather than solving it.
B. Modifying the ReplicaSet directly is not the correct approach, as the Deployment controller manages ReplicaSets and will override manual changes to enforce the desired state.
C. Restarting the Deployment (e.g., via kubectl rollout restart) would simply terminate and recreate pods using the same current, unstable configuration, not revert the change.

References

1. Kubernetes Official Documentation: In the section on Deployments

it explicitly states

"Sometimes

you may want to rollback a Deployment; for example

when the Deployment is not stable

such as when it's crash-looping... By default

all of the Deployment's rollout history is kept in the system so that you can roll back anytime you want."

Source: Kubernetes Documentation

"Concepts > Workloads > Controllers > Deployment"

Section: "Rolling Back a Deployment".

2. Red Hat OpenShift Official Documentation: The documentation for managing deployments in OpenShift (which is built on Kubernetes) describes the rollback procedure as the way to revert to a previous version. "You can roll back to the last successfully deployed revision of a deployment... A new ReplicaSet is created with the revision that you rolled back to."

Source: Red Hat OpenShift Container Platform 4.14 Documentation

"Applications > Deployments > Managing deployments"

Section: "Rolling back a deployment".

Scroll to Top