Mistakes will happen during deployment, and when they do, Helm makes it easy to undo, or “roll back” to the previously deployed version.
Open values.yaml and modify the image name under nodejs.image
to brentley/ecsdemo-nodejs-non-existing. This image does not exist, so this will break our deployment.
Deploy the updated demo application chart:
helm upgrade workshop ~/environment/eksdemo
The rolling upgrade will begin by creating a new nodejs pod with the new image. The new ecsdemo-nodejs
Pod should fail to pull non-existing image. Run kubectl get pods
to see the ImagePullBackOff
error.
kubectl get pods
Run helm status workshop
to verify the LAST DEPLOYED
timestamp.
helm status workshop
This should correspond to the last entry on helm history workshop
helm history workshop
Now we are going to rollback the application to the previous working release revision.
First, list Helm release revisions:
helm history workshop
Then, rollback to the previous application revision (can rollback to any revision too):
# rollback to the 1st revision
helm rollback workshop 1
Validate workshop
release status and you will see a new revision that is based on the rollback.
helm status workshop
Verify that the error is gone
kubectl get pods