Rollout and versioning in a Kubernetes Deployment

When you first create a Deployment it triggers a Rollout: a new Rollout creates a new Deployment Revision. Let's call it Revision 1.
In the future, when the application is upgraded - a new Rollout is triggered and a new Deployment Revision is created named Revision 2.
This helps us to keep track the changes we made to the Deployment and enables us to rollback to the previous version of Deployment if necessary.

You can see the status of Rollout:

kubectl rollout status deployment/my-deployment
To see the Revision and history of Rollouts:
kubectl rollout history deployment/my-deployment
To undo the changes:
kubectl rollout undo deployment/my-deployment
Alternatively, you can rollback to a specific Revision by specifying it with --to-revision option:
kubectl rollout undo deployment/my-deployment --to-revision=3
To record the change cause use --record option. The cause will be saved in the Annotations section of the Deployment:
kubectl create -f deployment.yaml --record