Rolling back an application release
There are always cases (such as bugs in the code, the wrong Docker tag supplied for the latest release, and more) when you need to roll back an application release to a previous version.
This can be done using the $ kubectl rollout undo deployment nginx
command followed by the get
and describe
commands:
The preceding output shows the version as Image: nginx:1.18.0
, so the rollback was successful.
We can also check the deployment rollout history:
$ kubectl rollout history deployment nginx deployment.apps/nginx REVISION CHANGE-CAUSE 1 <none> 2 <none>
We can also roll back to a specific revision:
$ kubectl rollout undo deployment nginx –to-revision=1 deployment.apps/nginx rolled back
Nice, we have learned how to roll back a deployment...