47 Playing Around With The Deployment
47 Playing Around With The Deployment
47 Playing Around With The Deployment
In this lesson, we will deploy a few new releases and will play around with the Deployment to explore multiple
options.
The output of the last line of the rollout status confirmed that the rollout
was successful.
deployments "go-demo-2-api"
REVISION CHANGE-CAUSE
2 kubectl set image api=vfarcic/go-demo-2:2.0 --filename=deploy/go-demo-2-api.yml --re
3 kubectl create --filename=deploy/go-demo-2-api.yml --record=true
4 kubectl set image api=vfarcic/go-demo-2:3.0 --filename=deploy/go-demo-2-api.yml --re
5 kubectl set image api=vfarcic/go-demo-2:4.0 --filename=deploy/go-demo-2-api.yml --re
We can clearly see the commands that produced the changes and, through
them, how our application progressed all the way until the current release
based on the image vfarcic/go-demo-2:4.0 .
You saw that we can rollback to the previous release through the kubectl
rollout undo command. In most cases, that should be the correct action when
faced with problems and without the ability to roll forward by creating a new
release with the fix. However, sometimes even that is not enough, and we
have to go back in time further than the previous release.
imagine that the last correct release was based on the image vfarcic/go-demo-
2:2.0 . We can remedy that by executing the command that follows.
While that command would certainly fix the problem, there is an easier way
to accomplish the same result. We can undo the rollout by moving to the last
revision that worked correctly. Assuming that we want to revert to the image
vfarcic/go-demo-2:2.0 , reviewing the change causes listed in the history tells
us we should roll back to revision 2 . That can be accomplished through the -
-to-revision argument. The command is as follows.
deployments "go-demo-2-api"
REVISION CHANGE-CAUSE
3 kubectl create --filename=deploy/go-demo-2-api.yml --record=true
4 kubectl set image api=vfarcic/go-demo-2:3.0 --filename=deploy/go-demo-2-api.yml --r
5 kubectl set image api=vfarcic/go-demo-2:4.0 --filename=deploy/go-demo-2-api.yml --r
6 kubectl set image api=vfarcic/go-demo-2:2.0 --filename=deploy/go-demo-2-api.yml --r
Through the new revision 6 , we can see that the currently active Deployment
is based on the image vfarcic/go-demo-2:2.0 .
In the next lesson, we will learn to roll back the failed deployments.