Helm Rollback Command | How to use Helm Rollback Command - Part 13

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome to j hook and in today's session we are gonna discuss how to roll back and helm release well the command for rollback is pretty simple helm rollback followed by your release name and the rollback revision number which you want to use but before we jump into the rollback command directly first of all we need to understand some concepts of help chart and how the roll back and upgrade works so for the today's session what i'm going to take i'm just going to create a hello world helm chart first of all that's going to be our fresh helm chart and we are gonna install that helm chart or we are gonna create our first release version okay so once you create your first release version then we are gonna create a one more release version by increasing the replica count of that hello world health chart okay so that we at least have two revisions of helm chart running inside our kubernetes cluster and once you have a two revisions of helm chart running inside your kubernetes cluster then we are going to perform a rollback command and along with the lab session i'm just gonna put this guide into the description section of this video uh this is actually a sub topic from my one of my blog post but you can use this command and you need you just need to modify the release name over here and it should work as it is okay so let's back to terminal and first of all i'm just gonna create my first hello world helm chart and the command is helm create hello world and you can verify by running the command ls and also by running command tree and here you can see all the vmls generated after running the help create command all right so now we have our hello world helm chart there so what i'm gonna do i'm just gonna uh install my first hand chart with a revision one okay so the command is helm install hello uh the release name you need to specify some release name so i'm just gonna use the name my release okay and followed by your actual hello world help chart the hell uh the help chat which you have created actually okay so this is how the install command should look like i'm just gonna hit enter and if you see something similar message that means your helm chart has been installed correctly okay and that you can verify by running the command helm list a and here you can see the release a name which we have assigned and the revision you should carefully look at the revision number that is one okay now i'm just gonna increase the revision number uh by changing making some changes into my helm chart so that we at least have two revisions so that we can run the rollback command okay so what i'm gonna do i'm gonna increase the replica count of my uh hello world helm chart uh as you can see currently uh cube ctl guide deployment uh i'm running only one replica of my hello world health chart so to make a revision two of this uh release or this helm chart release i'm just gonna increase the replica count to two and just i'm going to apply those changes so that we at least have second revision of my health chart running inside my kubernetes cluster and for that what you need to do uh you need to go into the hello world health chart directory and inside that directory you will find values.yml so i'm just gonna edit uh values.ml because there we are going to define the replica account or we are just going to update the replica account so here the replica count is one so i'm just gonna make it to two i'll just save and quit i'll clear the screen and now we need to upgrade our helm chart so that we can have two replica account of my hello world helm chart running inside my kubernetes cluster so first of all check the directory we are inside the hello world helen chart so just get outside of this directory and yeah you can check it again yeah now i'm outside of my hello world directory and the command which i'm gonna use is helm upgrade then my release followed by your hello world help chart okay so i'm just gonna use the command upgrade first so that we can increase the revision number to two okay i'm just gonna hit enter and if you see similar message then that means our upgrade command has worked and i'll just clear the screen and i'm just going to verify whether our upgrade command has worked successfully or not so the command is list a and here you can see the revision is now 2 so that means we have upgraded our help chart all right and also you can verify the replica account actually quick ctl get deployment and here you can see previously we were running only one replica account now we are having two replica account okay so now we have a perfect scenario to perform a roll back on our helm chart since we are having two revisions so now we can roll back to revision number one and to roll back the command is helm uh followed by rollback keyword and then your release name so here i have used my first springboard but here our release name is my release so i'm just gonna replace the name with this my release and then you need to specify the revision number so here our previous revision was 1 because we just want to go back to my previous revision that is one so you need to decide like which revision number you are right now so it might be different for you in your case because you might have already have some previous revisions which are running so it in your case it might be 10 12 or 100 so you need to see on what revision you wanna roll back okay so uh i'm just gonna copy the command or i can write it down here roll back and the release name that is my release and the revision which i wanted to roll back that is one i'm just gonna hit enter so it will say rollback was success so that means our rollback has completed and now you can verify the rollback by running the command helm list a and here the important concept is whether you're roll backing your helm release the revision will always increase now the revision has went to three okay so this is always an incremental uh because we are making the changes but help chart always take each change as increment whether it's a downgrading or upgrading it doesn't matter it it will always increment the revision by number okay but you can verify the replica account over here by running the command cube ctl get deployment and here you can see our replica account has went down to one so that means uh our previous uh our our fresh installation of a helm chart has been rolled back and we are now on to the version where we were running only one replica account so uh this is how our helm chart rollback works and this is how you can roll back to your previous version but yeah you need to remember the revision on which revision number you wanted to roll back actually so here i know the version was one and where i was running the replica count one so that's the revision i wanted that's why i roll back with the revision one but in your case you should remember the revision on which revision you wanted to go back so yeah this was a small session on how to use a helm roll back commands and i hope you liked it and if you are interested into the similar content then you can follow me on youtube with the name rahul bhagavat where i keep on posting similar content on devops kubernetes helm chart terraform and on a weekly basis and also you can find me on a web with the name jhoop.com where i prepare this kind of guides which i generally use into the my into my lab sessions and if you have any questions or issues then please put down into the comment section i'll try to get back to you and if you have any suggestion or the topics which you want to discuss then also put down into the comment section and i'll try to get back to you with the with some lab sessions maybe in some time so till then see you into the next session bye bye take care
Info
Channel: Rahul Wagh
Views: 627
Rating: undefined out of 5
Keywords: helm chart rollback, rollback, devops, kubernetes
Id: HHjycvwTYhE
Channel Id: undefined
Length: 8min 33sec (513 seconds)
Published: Sun May 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.