There are commands given here which explain how to perform a rollback using kubectl
. One that lists the previous versions of your deployment is:
kubectl rollout history deployment/myDeployment
This shows a list of previous versions based on their order and just their corresponding numbers. But how to know more details about them? It is hard to know which version I am rolling back to by just looking at a number.
You can use the revision flag to get more information:
kubectl rollout history deployment/<Deployment-name> --revision=<revision-number>
This will give you details about the Pod Template used in the specified revision number.
If you want the date on which the revision was deployed, use the -o yaml flag and check for creationTimestamp
kubectl rollout history deployment/<Deployment-name> --revision=<revision-number> -o yaml