Perform a rollback
As previously mentioned, Kubernetes keeps old ReplicaSets as a documented revision history and an easy way to roll back. The following command shows the history of the Deployment with two revisions.
$ kubectl rollout history deployment hello-deploy
deployment.apps/hello-deploy
REVISION CHANGE-CAUSE
1 <none>
2 <none>
Revision 1 was the initial release based on the 1.0 image. Revision 2 is the rollout that just updated the Pods to run version 2.0 of the image.
The following command shows the two ReplicaSets associated with each of the revisions.
$ kubectl get rs
NAME DESIRED CURRENT READY AGE
hello-deploy-5f84c5b7b7 10 10 10 27m
hello-deploy-54f5d46964 0 0 0 93m
The next kubectl describe command runs against the old ReplicaSet and proves its configuration still references the old image version. The output is trimmed to fit the book, and your ReplicaSets...