How to use Helmfile to manage your Helmchart?

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there this is rahul i hope you are doing good in today's session we are gonna talk about helm file and how to use the home file to manage your help chart as usual we will first start by installing the helm file onto our kubernetes cluster second we are going to create a helm chart and then we are going to manage that helm chart using the helm file so using the helm file we are going to install the helm chart then we are going to uninstall the helm chart and also we are going to see like how we can pull the helm chart from a github repository and install it using the help file on top of that we are also going to see how we can install multiple helm chart using the help file so there are a lot of features which help file provides to us and we are gonna see those feature into this session let's start with our first topic that is what is helm file so whenever we talk about the hell file then we are talking about a kubernetes cluster first and when we talk about kubernetes cluster then there is a docker container which is running inside your kubernetes cluster so here on this slide you can see there is a docker container and inside the docker container there is an application and that application which i have taken for this example is a spring boot application but you can take any application which you can containerize and put it inside a docker container so this is our kubernetes cluster in which we have a docker container and inside the docker container we have an application so in a typical kubernetes cluster we deploy a docker container inside our kubernetes cluster and we call that as a deployment resource and later on we expose the deployed resources using the service and we expose the service using either cluster ip or node port or load balancer well if you don't have the helm chart with you then what you are going to do you are going to just simply deploy the docker container manually using the cube ctl command and later on you are going to expose the service also using the cube ctl command but all those thing will be manual because you don't have a help chart so what is the benefit of using the helm chart so when helm chart comes into picture then you can create a helm chart and in that helm chart you can create a deployment yml you can create a service yml and that will take care of your deployment as well as the exposing offer services either using cluster ip note port or a load balancer but if you look carefully over here then you will wonder that there are so many file which helm chart provides to us so we already have a kubernetes cluster in which we are having a docker container and inside that we are having an application on top of that we are having a helm chart where we need to manage all this file that is chart yml service yml service account yml in grace hpa so there are lots of yml or configuration via ml which helm chart provides so we do we need to take care of all things manually so here comes the helm file so what helm file does help file is a very simple vml or a configuration file where you only need to mention your helm chart so if you revise the whole setup then what we have we have a kubernetes cluster on the left hand side where we have a docker container after that we have created a helm chart and once we have created a helm chart then we are going to create a help file and then in this helm file we are going to reference our hello world help chart so here you can see this is the reference of our hello world health chart so with this helm file we are going to manage our helm chart and by managing means we are going to install the home chart we are going to uninstall the helm chart and also we can do the multiple health chart deployment using this help file so this is how help file reduces the complexity of lengthy and complex configuration via ml which helm chart provides let's start with the demo and this is my kubernetes cluster which is up and running so i can check the kubernetes cluster by running the cube ctl get notes command and here there are a couple of nodes which i have started on my development machine so i'll clear it and uh first thing which we need to do is we need to install the helm file so this is the first step which we are going to do and also i'm just going to share this guide so i have composed all the command and i have put down all the command into this blog post so i'll put the link of this blog post into the description section of this video so the first thing is we need to install the helm file so this is going to be our first step and first of all we need to download the helm file so you can download the helm file from our github repository so here this is the helm file and the current version which we have right now is the v014 but you just download whatever latest version available at that particular point of time so here if you are working on a linux version then just try to download some linux version and if you are on a windows then just try to download the windows version and for mac os you can use third darwin since i'm using ubuntu as my base operating system so i'm just gonna use helm linux amd64 so i'm just gonna copy the link from here go back to my terminal and here i'm just gonna use the command w get to download the file okay i can clear the screen after downloading the file we can verify that file has been downloaded by running the command ls and followed by lart so here we can see the file has been downloaded but it doesn't have a executable permission so we need to change the permission over here so that it is executable so first of all i'll just rename the file and to rename the file what we are going to do we are just simply going to run the command move and have a file and i am just going to move the file into the same directory but i am just going to change the name so here we can again run the command lart so now the file name has been changed and it is now only the helm file okay now after changing the uh file name we need to change the permission also so the command for that is chmod and i'm just gonna use 777 and the file name and we can verify the file permission by running the command lsrt and we can see now we have the executable permission also on the help file now after changing the permission and renaming the file we need to move this file into the user bin directory so either we can use the move or cp copy command also so we are gonna use the helm file and we are gonna mention the directory user local bin and also use the sudo in front of it because we don't have the root permission to we need a root permission to move any file inside the user local bin directory simply hit enter and after that you can just verify the installation of a helm file by running the command helm file and here you can see uh we are getting some output and yeah so actually the correct command should be uh i'll clear the screen it should be how file version and here you can see we have installed the help file i will update the blog post in this blog post i have forgot to mention the change permission command so i'll update that instruction into this blog post okay moving further uh after installing the helm file the next thing which we need to do we need to create a helm chart and then we are going to use that helm chart to install it via helm file so the first thing which we need to do over here and the next instruction in the guide is we need to create a helm chart so i am assuming that you have already installed the help chart onto your kubernetes cluster so if you haven't done the helm chart installation then i would highly recommend to install the helm chart first so uh now the command for installing or creating a helm chart would be helm create hello world so hello world is my home chart which i'm going to create so i'm just simply going to copy this command from here go back to my terminal i'll clear the screen over here and here we can verify first of all there is no previous helm chart which exists over there so here we only have the helm file which we have downloaded previously uh i should actually get rid of it because we have already moved that file into our user local pin so now i have removed it so if i run the command lsrt so i don't have anything over here okay so now we are going to create a helm chart and the command for that is helm create hello world and here we can see our hello world helm chart has been created and we can verify the content of a hello world helm chart by running the command tree hello world ah sorry it's not three it's tree and here we can see so here you can verify that we have a chart yml which is default and which is provided by a helm chart along with the deployment along with the service vml so we are just gonna today play with the deployment and the service by ml okay coming back to the guide uh so what we have done we have created a hello world help chart uh next thing which we need to do we need to create a helm file dot yml so uh just simply copy this name from here uh i should have copied the name like this yeah so copy the name from here go back to your terminal uh clear the screen and just run the command ls so that you can see uh so this is my hello world helm chart and here i'm just gonna create a file that is help file yml and now we should have two things one the hello world directory and the hello hell file by ml okay so now i'll clear the screen and now what we need to do we need to copy this instruction and these instructions are pretty simple i'll increase the font size of my guide so here first of all we need to mention the word that is releases after that you need to mention the name this name can be anything but it's always recommended to put the same name of your helm chart so here this is the chart and this is the directory actually so we are working in the current directory and our help file and the hello world helm chart exist in the same directory so that's why i have used the current directory path and the important thing when you want to install the helm chart then you should use the flag install equal to true otherwise it is not going to install the helm chart using the helm file so i'm just going to copy this instruction from here go back to my terminal i'm just gonna open the helm file into the vi mode and simply i'm just gonna paste it over here and after that we are just gonna save and quit i just noticed i made a typo while creating a helm chart so here instead of mentioning hello world i have written hell world so that's wrong so i need to correct it so what i'll do i'll not change the hello world helm chart instead i'm just gonna update my help file so what i'm gonna do vi helm file and here i'm just gonna simply rename the hello world so remove the and oh so that was the typo which i did so which i just corrected moving further into the guide now we have created our helm file and the next thing which we need to do is we need to run the hell file sync command so this command help file sync is going to install the helm chart uh which we have just created so in our case we have just created a hello world so that is going to be installed by using this command so i'm just simply going to copy the command helm file sync from here go back to my terminal i'll clear the screen and simply paste it and hit enter and here you can see this is the name of our helm chart we just created and uh updated release so this is where it shows like it has installed our hello world help chart so i'm just gonna clear the screen and i'm just gonna run the helm chart command to verify the uh installation of my hand chart so the command is help list e and here you can see uh we have a installation these two are my previous installation so don't worry about it so we are only worried about this helper so that was my helm chart which i have just created and just installed using the helm file now we have seen how to install the helm chart using the helm file the next thing which we are gonna try we are gonna uninstall the helm chart using the helm file and we are going to use the same help file and here the only attribute which we are going to change is the installed attribute so here previously we have mentioned that is true but now we are going to change it to false so that we can uninstall the helm chart we have just created so go back to your terminal open the file helm file into the vi mode and here we are gonna change the flag from true to false save and quit and after that just verify the helm list once again before uninstalling so here you can see we have our hello world which is up and running so we are not worried about these two because i have created long back so we are just gonna install the hello world help chat which we have just created so after editing the help file and setting the value to false the next command which i am gonna run is the helm file sync so you only need to run the same command again this is the same command which we have used for installation but we are going to use the same command for uninstallation also the only thing is we have changed the installed flag to be false and here you can see it has deleted the release hello world we have just installed previously and again you can run the same helm list a command and verify the changes so here you can see the hello world uh with this name has been gone from this list so we have successfully installed the hello world helm chart moving further into the guide the next thing which we are gonna try with the helm file is try to install the helm chart from our github repository so there is a github repository uh like this so this is my github repository where i have already uploaded my hello world help chart so this is the hello world helm chart and i'm just gonna use the same repository to install the helm chart using helm file so we are going to pull this helm chart which is remotely on my github and then we are going to install it so as you know or you might have worked with the github so whenever you want to work with the github then you need to mention the github repository url so here we are gonna just gonna create a repository configuration we are gonna put some name that is going to be hello world because we are going to install the hello world and then we are going to mention the url of our help chart here there are a few things which you need to be careful you need to use git plus https and secondly you need to put the name of your uh help chart that is hello world so till now this is my url of my github repository remember there is no get dot get extension over here after that you need to put at the rate and you need to mention the name of your helm chart and after that you need to point to the master i mean you should fetch and pull the master where your github repository is after that there is a releases tag and which is just similar which we have just seen and here this is installed i have put it as a false but you can put it as a true for installing okay so i'm just gonna copy this whole instruction from here and here is my terminal i'll just clear it and here i'm just gonna remove the hello world local hello world helm chart because i just don't want to keep it so now i have removed my hello world helm chart which i have locally created so that we have a clean sled to work on and i'm just gonna erase my helm file also so this is the command which i'm going to use to erase my previous local help chat installation configuration so that's been done i can verify so that my help file is clean so here you can see the cat command is not giving any output that means our help file is clean now open the helm file in the vi mode paste to the instructions so here i'm just gonna change this false to true because i just wanted to install it so after that save and quit and after that you need to run the command helm file sync ah we got some error over here and it says like could not find the protocol handler get https so that means we need to install the helm git plugin also so if you go to google then you just type in helm get plugin and just click on the first link which pops out over here so we need to have a helm gate plugin installed so that helm can pull the helm chart from the github repository so that's the plugin which is also required so i'm just going to copy this git plugin go back to my terminal and paste it over here so here you can see our helm git plugin has been installed so next thing i ch which i'm gonna do i'm just gonna again run the hell file sync command and here you can see uh the updated release so that means our hello world helm chart has been installed from our github repository and we can verify by running the command help list a and here you can see this is the hello world helm chart and this is the latest uh hello world helm chat which we have installed these two are the previous old one but we are just worried about this first one so this is how you are gonna use the github repository to store your helm chart and then you are going to use those github repository stored hand chart to pull in and install it via using help file all right so till now what we have seen we have seen like how to install the helm chart using the helm file and then how to uninstall the helm chart also using the helm file and then we have seen like how to use the github repository to pull in the help chart from a report remote github and install it using the helm file now consider a scenario like where you need to install multiple help chart and we are talking about more than one help chart over here so if you have a such a scenario then help file could definitely help you to simplify the installation and managing part of your helm chart so here in this instruction guide you will see we are trying to create a two uh helm chart this is hello world one and this is hello world two and after that we are going to create a helm file and in that helm file we are going to install both of the home chart at the same time and then again we are going to run the same helm file sync command so this single command uh is going to read our helm file and it is going to read the configuration of our both of the health chart that is hello world 1 and hello world 2 and it is going to install it ok but before that we have some old helm chart runnings in our kubernetes cluster which we need to delete it before so here we can see uh we have two hello world one and two which is running so i'm just gonna run the command helm delete hello world and paste it over here that has been done two also and that has been done i'll clear the screen and i'm just gonna run the helm list a command and now you can see there is no helm chart uh installed and which is running over here so our uh kubernetes cluster is clean okay uh i'm just gonna copy this configuration from here uh sorry we need to create the chart before so first of all let's create the hello world helm chart i'll clear the screen and here you can see we have only the help file we don't have any uh helm chart created earlier so i'll just paste the command and now we have created our first hello world helm chart that we can see this is the one and again i'm just gonna run the same command with the little bit change and this is the second hello world and i'm just gonna verify so here we have both of the hello world help chart 1 and 2. all right let's copy the configuration of our helm file from here copy it go back to your terminal first of all erase the content of our helm file done verify it that your helm file is clean that is also clean open it in a vi mode and paste the content over here and remember we are trying to install two helm chart hello world one hello world two and both the flags are true over here simply save and quit and yeah clear the screen run the command helm file sync enter and here you can see updated release information so here we have installed hello world one and hello world two and clear the screen hell list a and here you can see uh we have successfully installed both the hello world help chart and both have just installed on our 25th on the day where i am recording this session so this is how you can install multiple helm chart using the helm file so if you have more than two helm chart then you can just keep on adding the configuration of your helm chart over here into the helm file and you can just simply run the helm sync command and that is going to install the both of your helm chart into your kubernetes cluster and again you can use the same github repository feature if you have stored multiple helm chart remotely on a github repository then again you can use the same github feature and you can just mention the name of your helm chart and then it can pull the all the helm chart which is stored on your github repository and just gonna install it so this is how simple it is with the help file along with that uh helm file also provide you the features of a template and environment variables so in case if you want to templatize or you just want to make a template of your home chart then you can use this values yml dot go dmpl feature that's really cool feature and you can just inject the environment variable based on your local development test and production so this is a little bit more information and how to pass the environment variable into your home file so just try to go through this instruction uh and you can just improve your help file quite a lot with this so this was a little small session on how to use helm file to manage your helm chart and i hope this session will help you to getting started with your helm file but as i told you you should have a basic understanding on how to use the helm chart to manage your kubernetes deployment and services so if you know the helm chart then it will be really easy to understand what this helm file is and what you can do with your helm file so with that i hope you like the today's session on how to manage your health chart using the help file and if you are interested into the similar session then please do follow this channel where i keep on posting similar content on a weekly basis uh it's mostly on a terraform helm chart kubernetes and sometimes on a docker so see you into the next session of devops till then bye bye and take care
Info
Channel: Rahul Wagh
Views: 633
Rating: undefined out of 5
Keywords: helmfile, helmchart, kubernetes, devops, tutorial
Id: r9KePPg0KQY
Channel Id: undefined
Length: 24min 22sec (1462 seconds)
Published: Mon Nov 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.