Hi, Let us understand how to do the rollback using the helm.
Here I'm going to use the project that we used earlier for upgrade
Let me go ahead and do an another upgrade. Before that let me check
What are all the revisions available helm history and name of the deployment.
So I do have two revisions, in that the revision two is deployed and the revision one is superseded.
Now, I'm going to make another revision.
Let me go ahead and make changes to the values.yaml file
I'm making the replica count as three.
Now, let me go ahead and make changes to the chart.yaml file
I'm going to make change to the description.
And change the version say I want to make this particular version as 1.1
Now, I'm going to push this change into the repo, without pushing into the repo directly I can deploy the chart.
But to understand the standard way of deployment I'm pushing it into the repository.
Then to check whether it is available before that I need to do the
upgrade and search the repository using helm search command helm search repo
And I'm going to provide the -l option.
where I'll get all the versions of the chart. Here I do
have the latest version that we pushed into the repository that is 1.1.0
Now I'm going to upgrade the helm deployment.
Let me check what are all the deployments available helm list
So this is the deployment and the revision that is running is two.
I'm going to do an upgrade.
helm upgrade and name of the helm deployment and the repository to use.
So did the deployment and the revision got changed to three. Now I can check helm list.
So the revision that is running is three.
I can get the entire history of the helm deployment.
This specific deployment using the helm history command, helm history and name of the deployment
install upgrade rlbk-demo so I do have three revisions.
Now the version that is running is three.
I can confirm using cubectl command, cubectl get all
So I do have three pods running. Now
For some reason I realized this particular revision is not good.
So I wanted to roll back to the revision two, so I can use the command helm rollback and name of
the deployment and the revision that I wanted to rollback to.
It's as simple as one simple command can roll back to the revision that I wanted.
So the command is helm rollback and name of the deployment and the revision
I wanted to rollback to. So the rollback is success.
Now I can go ahead and check the history of this specific deployment, helm history
And I do have the revision four and the revision four is rollbacked to two, so the revision that is deployed is four
And that got rolled back to the revision two and within revision two we had two pods
I can go ahead and check whether two pods are running
cubectl get all I do have only two pods.
So automatically it went ahead and made the changes to the required number of pods.
So this is going to prove how easy it is to upgrade or rollback any deployment using helm package manager.
And this is one of the biggest advantage and that's where helm is going to have the edge.
So in a quick summary we have seen how to do the upgrade and rollback of a deployment using helm.