Complete Helm Chart Tutorial: From Beginner to Expert Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there this is Rahul and welcome to the helm chart Series this series is gonna be a little longer series because I have divided this whole series into the seventh chapter and you can see onto the screen the name of the each chapter so take a pause over here and just go through the each chapter and it doesn't matter whether you are a beginner or you are an expert you will definitely get something out of this particular series if you are a beginner then I would highly recommend to start from a chapter one and then go all the way till chapter 7. so we will start from the very basic and at the end of this chapter number seven you will be able to know more about the helm chart and you will be able to create your own health chart and if you are an expert or if you are already using the helm chart then feel free to check the description section where I have put the timestamp so that you can skip some of the topics which you feel comfortable already working with so without further Ado let's start with our chapter number one welcome to the chapter one of this Helm chart Series in the chapter 1 first we are gonna take a look on what is Helm chart second we are gonna take a look why we need a kubernetes cluster third we are gonna take a look how Helm chart can help us to manage our kubernetes cluster and finally we are gonna take a look on how to install a help chart let's start with our first point what is Helm chart so let's take a couple of steps back and focus on the one of the most basic element when we talk about the kubernetes and help chart and the basic element which I'm talking about is the docker container so with the help of Docker container you can package any application whether it can be a python application whether it can be a Java application or whether it can be a go application so you can containerize an application inside a Docker container and you can ship that container to anyone or you can use the same container to deploy it into a production environment so that your application can serve to the end users let's increase the complexity of this particular use case where we are using a Docker container so if there is a Docker container and there is a single user like a developer who is running a Docker container on a developer machine then that particular Docker container can easily serve a single user but what if if you want to use the single Docker container to serve a millions of a request can a single Docker handle those millions of a requests so the answer is no and you need to rely on some kind of a framework to manage the docker container so that you can serve millions of our requests and the framework which we are talking about is the kubernetes cluster so with the help of kubernetes you can manage your Docker container and kubernetes will take care of your auto scaling Auto deployment load balancing of your Docker container so that you don't need to worry about how many users are requesting for that particular Docker container so any Docker container which is deployed inside a kubernetes cluster can serve millions of our requests and kubernetes cluster will take care of all the auto deployment Auto scaling Auto healing of our Docker container but you might be wondering then why we need a Helm chart since we have a Docker container and for managing the docker container we have a kubernetes cluster but as soon as you start moving into the production like environment then you realize that managing a kubernetes cluster is not an easy task and you need a some abstract framework which can sit on top of our kubernetes clustered and with a minimal effort you can do the complete kubernetes cluster management so that's where Helm chart comes in so whenever you work with a kubernetes cluster then you interact with a lot of ymls and those ymls can be a service yml or deployment yml and a lot of group CTL commands which you need to run to manage a healthy kubernetes cluster but Helm chart provides an top layer abstraction so that you can run a minimal Helm chart command which can internally communicate with our kubernetes cluster and can produce the same results with more efficient way here is a disclaimer if you are a beginner and this is the first time you are interacting or trying to learn the harm chart then things might sound little complicated but don't worry we have a demo and this is just a first chapter of this particular Series so once we jump into the demo then these all points which we have discussed so far in this first chapter gonna make more sense to you and then things will get more leaner and easier to understand all right moving forward we are still trying to answer like what is Helm chart so for that I have prepared a rough sketch where I have divided into two diagrams or two workflows so here you can see onto the screen this is the first workflow where I have used the docker container and a kubernetes cluster and in this first workflow I am not using a help chart but in the second workflow I am using the same Docker container same deployment y ML and service yml and using the helm chart to deploy inside my kubernetes cluster but let's start with our first workflow where we have used Docker container and we are not using the help chart so here on the left hand side you will see a Docker container image where it can be any application which you have written in Python Java go or any programming language and you have a Docker container so to deploy inside a kubernetes cluster a very simple application then you need to have a deployment yml where you will Define like this is the docker container image and you should Deploy on this particular Port so that's the simplest way you can create a deployment yml and then what you will do to deploy a con container inside a kubernetes cluster then you will run a command Cube CTL apply F deployment.yml and with the help of this command you will be able to deploy a Docker container inside a kubernetes cluster okay now you have deployed your coupon Docker container inside a kubernetes cluster the next thing is you need to expose that deployment as a service so that end user can access that service running inside a Docker container so doing a deployment is not sufficient enough you need to expose that service uh to the outside world so that end user can access that service running inside a kubernetes cluster so for that purpose you create a service.yml and if you are familiar with the kubernetes cluster then you have a three types of service that the cluster IP note port and load balancer so these are the three ways you expose the service of a Docker container which is deployed inside a kubernetes cluster so using those service.ml service dot yml you expose the docker container as a service and you need to run the command Cube CTL apply F and then service Dot yml and with the help of this command you will be able to expose that service and after exposing that service a end user will be able to access that particular service which is running inside the docker container and the docker container is running inside your kubernetes cluster so this is how the deployments work when your not using a Helen chart but you are relying on kubernetes cluster and Cube CTL commands let's move to the second flow and here we are using the helm chart so just keep the thing simple I have taken a very few ymls but in actual there will be quite a lot of ymls but we will take a look into the demo part where we will be doing all the modification into those yml but here again I am taking the deployment.yml and service.yml of my Docker container so here instead of creating this deployment.yml and service.yml you need to modify the chart.yml and deployment.yml and there are some other service.yml which is present inside your Helm chart setup so you need to make an entries into those ymls so what you need to mention in those yml is your Docker image URL so that Helm chart can access your Docker container from that particular URL the port where you will be running your Docker container and the type of service you want to run or expose into your on a test cluster whether it's a load balancer node port or a cluster IP so you need to make those entry into those chart.yml of your Helen chart and once you created all those entry stores into those yml then you just simply need to execute this command which is Helm install my chart so this is a single command which you need to run and that will take care of your Docker deployment that will take care of your exposing the service inside your kubernetes cluster whether it's a load balancer cluster IP or a note Port that will be taken care by hand chart and once you run this command then it will just do the deployment exposing everything for you inside your kubernetes cluster and you don't need to worry about it so here in this diagram you can see the difference so previously when we were not using the helm chart then you were running couple of commands like Cube City will apply for deployment and cubesatel apply for your service.myml but when you start using the helm chart then you just need to run a single command and that will take care of all this Cube CTL command internally so that's the the benefit you will get when you start using the hunt chart alright so moving forward the next question is like why we need a kubernetes cluster so I hope now you will be able to answer this question because we have discussed some of the points like why we need a kubernetes and why we need a Helm chart for managing our Docker container so here I am again assuming that we have a Docker container where we are having a python application running inside it and when you want to execute or when you want to run that Docker container then what you need to do is you need to build that particular Docker container and this is the command which you are going to use to build that particular Docker container and once you have built it then you need to use the docker run command with the ports on which you want to expose that particular Docker container and then you need to mention the docker image name so that's how you manage your simple Docker container build as well as Docker container run now why we need a kubernetes so when you start talking about the kubernetes then these are the benefits you will get to manage your Docker container with kubernetes so first thing is the scalability so single Docker container cannot serve millions of a requests but with the help of kubernetes you can scale that particular Docker container to serve millions of our requests the second benefit which we are talking about is the automate Docker deployment so you can automate the docker container deployment inside your kubernetes cluster so you don't need to manually take care of the docker deployment inside your kubernetes cluster the third benefit which we are talking about over here is the auto healing so what is auto healing so if a Docker container is unhealthy then its responsibility of our kubernetes cluster to do the restart or do the fresh deployment of a Docker container inside a kubernetes cluster so you don't need to worry about the like unhealthy Docker container running inside your kubernetes cluster the fourth Advantage which you will get is rollout and raw back so if there is something wrong with your Docker container then kubernetes cluster or kubernetes will help you to do the roll back and roll out of a new container inside your kubernetes cluster let's try to answer like how Helm chart can help us to manage our kubernetes deployment or kubernetes cluster so here on the left hand side you will see I have written down some Cube CTL command and if you are not using a Helm chart then you need to run these many number of cube CTL command to do a Docker deployment inside a kubernetes cluster but on the other hand if you are using the helm chart then you just simply need to run two commands like Helm install and then your Helm chart name and that will take care of your deployment service or in grace.yml which can be executed inside your kubernetes cluster and once you are done with it and if you want to delete everything from your kubernetes cluster then you just need to run the helm install and then your Helm chart name and that will take care of all the deletion of your Docker container which is running inside your kubernetes cluster but on the other hand if you are not using the Kuba haven't chart inside your kubernetes cluster then you need to manually run this Cube CTL commands to remove the docker container which is running inside your kubernetes cluster so that's a way very basic level difference or Advantage you will get when you will start using the helm chart inside your kubernetes cluster moving forward let's talk about the final point of this chapter one like how to install the helm chart let's talk about the prerequisites for installing the helm chart so the prerequisite for installing the helm chart is you need to have a kubernetes cluster so to get the kubernetes cluster there are four options so here I have highlighted onto the slide you can see the four options for getting the kubernetes cluster so the first three option the eks gke and AKs these are the paid option because these are the kubernetes cluster from a cloud provider so the first cloud provider I'm talking about is Amazon or AWS so where we can get the eks and the Google kubernetes engine where we can set up GK which they call it as a Google kubernetes engine and the third one is from Azure from Microsoft for Azure kubernetes services so these are the three paid options for setting up your kubernetes cluster but since we are just getting started with the helm chart so we need to have some free options so that we can play around with our kubernetes cluster and also we can do some demo on the help chart so for that we are just gonna use the micro k at s so this is a free kubernetes cluster which you can set up onto your laptop or your desktop and these option this is the fourth option which I'm talking about is free and that's really a good kubernetes environment which I have been using for Learning and Development purpose uh when I'm playing with the kubernetes along with the help chart now one point I would like to highlight it over here is apart from installation of a micro K8 cluster all the steps are gonna be the same and it doesn't matter which kind of kubernetes cluster you are using either you are using from Amazon Azure or Google Cloud all the principal all the commands are gonna be the same so only part which is going to differ over here is we are just going to see the installation of a micro k8s and then after that we are is going to start using our kubernetes cluster and then after all the things will be seen it doesn't matter which kind of a kubernetes cluster you are using with any cloud provider let's start by installing the micro k8s so this is the official website for getting the package which is needed for installation of a micro k8s so here you just need to click on get started so here it will show you the three option so Linux Windows or Mac OS so it depends like what kind of operating system you are using so if you are using Windows then just click on Windows and here you will find the option to download and then you can just follow the instruction for Windows and with that you can just install the micro creators on your Windows machine and similarly for Linux since in this session I'm just gonna use a Linux virtual machine which is running onto my local laptop so I'm just gonna follow the Linux version of instructions for installing the micro K8 task and if you are using Mac OS then simply you can follow these instruction so these are the instructions which is available for getting micro k8s installed onto your laptop all right so since I'm using the Linux virtual machine so I will just use the Linux version of instructions the first thing is you need to get the package installed so this is the command which I'm just gonna use I'm just going to copy the command and switch to my terminal and here I'm just going to paste the command and it will take a couple of minutes to download and then after we are just gonna do the installation all right so here you can see after running this particular command it has downloaded the micro K8 test package and also it has done the installation onto my Linux machine Let's Take a Look onto the guide for installing the micro k8s and the next instruction which I can see over here is the check the status while kubernetes is start so this is the next command which I'm just going to run over into my Linux machine so I'm just going to switch over to my terminal I'm just gonna hit the command and hit enter and here you can see insufficient permission to access micro k at us you can either run the sudo or add user Ubuntu to the micro care desk group so this is the first command which I'm just gonna run to fix the permission so I'm just going to copy this one and hit enter so that's been done the next thing which it says is like a change on or permission of a DOT Cube directory this dot Cube directory doesn't exist yet so that's why I'm just not gonna run this particular command so the next thing which I'm just going to take a look over here is after this reload the user group either via reboot or by running the new graph micro creators so I'm just gonna run this command over here and hit enter so that's how we have just done the micro K test installation and we have fixed the group permission the next thing which we are gonna do we are just gonna install the cube CTL command line interface so which is different so the next step which we are going to see is to install the cube CTL so here are the instructions for installing the cube CTL so I'll put the link of this particular guide into the description section and this is the official website of a kubernetes for getting cubes it will installed onto your developer or desktop So based on the operating system you need to choose the instructions so Linux Mac OS or Windows since I'm using Linux that's why I'm just going to follow these instructions and Cube CTL is a command line interface to interact with your kubernetes cluster so that's why we just need Cube CTL so here I'm just going to choose the version so I'm just gonna use Arm because I'm using the Linux ARM version so here this is the instruction for installing the cubesatel which I'm just gonna copy I think this is going to install the latest version so I'm just gonna be little specific over here so I'm just gonna use this command to get it installed the correct version I just noticed one issue with the latest version of group CTL so that's why I'm just gonna use the older version of a cube CTL but that you don't need to worry about you can just install the latest version of a group CTL as well and if it doesn't work then you can just use the older version which I'm just gonna show you to uh into the installation step so here I'm just gonna copy this one and go to my terminal over here and I'm just gonna paste and I'm just gonna use the version I think it's 23.6 and maybe once this video is up and running then you might get some latest version where they have already fixed those issues so you can use the letter lattice version also that's absolutely okay so here I'm just gonna hit enter and I can run the ls command so you can see the package which has it as it is downloaded so here you can see this is the package which had which it has downloaded over here the next thing which we need to do is we need to install it so for that this is the command which you need to run with the sudo install it will set the installation into the correct directory I'm just gonna hit enter and the cube CTL is installed so after installation of a cube CTL let's verify the installation by running the cube CTL version command so here I'm just gonna run the command Cube CTO version and here you can see this is the output which I have got which shows like I have installed 1.23 uh dot six that's the version I have installed it onto my Linux machine all right so now we have installed the micro k8s and also we have installed the cube CTL but those aren't like a different packages and those are not communicating with each other and for that we need to configure a DOT Cube config so that's the next step which is needed so that Cube CTL command can interact with our micro k at as kubernetes cluster so for that this is the uh again one more instruction guide which I'll post into the description section which you can follow and that is from canonical which is like the maker of micro k8s so here you need to uh insta you need to configure the dot Cube directory which holds the configuration for your kubernetes cluster so here what you need to do you need to follow these instruction where you need to create a DOT Cube directory and inside the directory you need to generate the config configuration of your micro K atas kubernetes cluster all right so first of all let's switch to the home directory I'm just copying the First Command and that's I have executed so now now right now I'm into my home directory second I'm just gonna run the make dir that will create a DOT Cube directory over here and which we can verify over here after creating so here you can see this is the directory which I have just created all right I'm just gonna clear the screen next thing I'm just gonna switch to that directory and that's been done and after that I'm just gonna generate the config and that config is I'm just gonna write into the config file so this is the explanation of this command so I'm just going to copy this command and paste it over here and that's been done and we can verify the configuration by running the cat command first of all let's check the ls lart and check the config file so here you can see this is the config file which has been generated so this particular command has generated the configuration and then using this operator and this file name we have written into the config file so that's the purpose of this particular command and we can verify by running the cat config and enter so here you can see this is the config certificate Authority data microcode cluster and so yeah this is pretty much the standard kubernetes configuration which I have copied into my DOT Cube directory for our micro k8s cluster alright so now you need to take a pause and whatever machine you are using if you are using a Windows machine if you are using a Mac OS or if you are using a Linux virtual machine then you need to restart your machine now otherwise your kubernetes cluster will not be up and running and your new Cube CTL configuration will not work with your micro k8s kubernetes cluster so right now I have just restarted my virtual machine so just give a restart to your whole machine if you're using virtual machine or Mac OS or Windows operating system so just give a restart so that all the configuration are in correct place all right so now I'm assuming that you have restarted your respective machine so next instruction which we are gonna see is start using kubernetes cluster so here this is the first command which we are going to see so here you can see it is using micro k at as cube CTL get all namespaces but since we have already installed the cube CTL package so we don't need to prefix micro k8s we can simply copy this command from here micro k at us get all namespaces and we can verify our kubernetes cluster so I'm just going to switch to my terminal and paste the command over here and here you can see all the respective configuration of my kubernetes cluster which is running a micro k a test cluster so here you can see these are the like a Parts these are the services these are the demon set these are the deployments and these are the replica sets so this is my kubernetes cluster from micro k8s which we have installed we have successfully configured the cube CTL and now we are able to run our Cube CTL commands let's take a look onto the slides which we were following for this chapter one so here you can see uh this was the slide which we were into for installing the helm chart but we have just now finished the prerequisite so we have just set up our kubernetes cluster so as I told you earlier things will get more easier and easier once we get into the demo site of the things so first of all we have set up the kubernetes cluster and now we are able to run the cube CTL command and we are able to interact with our kubernetes cluster now the next thing is we need to set up a Helm chart so we need to install the helm chart also so this is the installation instructions which we need to follow to install the help chart and I'll post the instructions into the description section and if you don't find into the description section then there will be a blog post link where I'll mention all this instruction into that particular blog post so just refer into the description section and see what are the information available and you will find all those instructions over there okay so here is my terminal of my virtual machine I'm just gonna clear the screen and the command which I'm just going to run to first of all download the helm chart binary so here I am using the version 3.8.2 but you can use the whatever latest version available during whenever you see this video so you can use the latest version of a harem chart so I'm just gonna hit enter and we can verify the command by running LS lart and that should be a Helm package over here all right so here you can see it has downloaded the home package the ZZ file after that it has already done the installation and it has already moved my Helm into the local bin directory which means it has already installed into the single command which we have used just now so I'm just gonna clear the screen over here and we can verify the command by running Helm version and here you can see under Hull has been installed and the version which I'm using is 3.8.2 so that single command is sufficient enough to download and install the alarm chart onto your machine so with that we have concluded our chapter one so we have seen like what is harm chart why we need kubernetes cluster and how Helm chart is going to help to manage our kubernetes cluster and finally we have seen how to install our micro K task kubernetes cluster and after that we have done the helm chart installation on top of our micro K8 kubernetes cluster so in the next chapter we are just gonna take a look on what is Helm chart architect lecture how we can use the helm chart CLI which is command line interface and Helm chart command and finally we are just gonna create a hello world Helm chart so that you can get more familiar with the helm chart and how to create a Helm chart and deploy it inside a kubernetes cluster welcome back to the chapter 2 of this Helm chart series and in this chapter we are going to take a look on to the helm chart architecture what's the helm chart architecture looks like along with our kubernetes cluster second we are going to take a look on to the home chart CLI we will where we will be taking a look on to the basic Helm chart command and how we can interact with our kubernetes cluster using those commands and the third thing which is most interesting is we are just gonna create our first hello world Helm chart so that you can see like how we can create a very basic Helm chart and we can deploy it inside our kubernetes cluster all right so let's take a look on to the helm chart architecture so first take a look on to this diagram but first thing I would like to mention over here is this divider line which is in yellow color so on the left hand side you will see this is our Helm chart territory and on the right hand side you will see this is our kubernetes cluster or kubernetes territory so first of all let's talk about the right hand side where our kubernetes cluster resides so this is our kubernetes cluster where we will be deploying our Docker container which we will see later into this series but here you can see there are a couple of nodes that is Node 1 and node 2 and in the kubernetes cluster you can spin up as many number of nodes as needed based on your demand and here you will see a pipe which is a cube API server so that's the main thing which is com responsible for getting the communication done between our kubernetes cluster so here you have seen on the left hand side you will see a cube CTL that is a cube CTL command line interface that will which we have done the installation in our previous chapter so that particular cubesatel command will be communicating with our Cube API server so that we will be able to communicate with our kubernetes cluster so any container which we want to deploy using the helm chart so we will be using Helm along with the cube CTL that will communicate with our Cube API server and then we will be able to communicate with our kubernetes cluster and that will eventually we will deploy our Docker container inside our kubernetes cluster so this is the right side territory we you can check the documentation of kubernetes to go into the nitty-gritty of your kubernetes cluster but this is just a high level overview I'm just giving over giving to you and on the left hand side you will see the helm chart territory so here we have seen in the previous chapter that we have installed the cube CTL command line and we have also installed the help chart so that we have our Helm command also so help internally interact with our Cube configuration so that our Helm chart can understand which micro K atas or which kubernetes cluster it is interacting with and on the left hand side you will see a Helm wrapper so where we will have our charts so we will create our charts then we will use our Helm CLI which is Helm install Helm install so that we can install the helm chart and which will ultimately interact with our Cube API server which is our kubernetes cluster server and then it will deploy our respective Docker container inside our kubernetes cluster so this is a very high level rough representation on how the communication will happen between the kubernetes cluster and the helm chart moving forward the next thing which we are going to take a look is the commands which we are going to use for this particular hello world Helm chart demo so the three basic command which we will be using inside the demo is the helm install command so we will first install our hello world Helm chart second after installation and once we have verified our Helm chart deployment inside our coupon it is cluster then we are just gonna use the helm delete command so that we can remove that particular chart from our kubernetes cluster and also we are going to take a look onto the helm list a which is a very useful command which we are going to use quite a lot to verify our chart which we have already deployed inside our kubernetes cluster so these are the few basic command which we will take a look but gradually we will increase these commands and we will take a look on to the deeper type or we will take a deeper dive into the helm chart Advance command also all right so now we have seen the architecture of Helm chart and now we have we know a little bit about the helm CLI or the help command the third thing which we are going to take a look right now is to create our first hello world Helm chart and for that I have just created this guide this is a blog post where I have documented all the instructions which is needed to run your or to create your first help chart so here this is the section where you need to look upon write or your first time chart hello world so the First Command which we are going to run onto our Linux machine where our kubernetes cluster and hand chart setup is done so the first command is Helm create Hello World so this is the first command which you need to run to create your Hello World Helm chart so I'm just going to copy it I'm just gonna head over to my terminal I'm just gonna clear the screen and I'm just gonna paste the command and here you can see uh creating a hello world Helm chart and you can verify by running the command LS lart and here you can see this is the hello world Helm chart which has been created I'm just gonna clear the screen and we can just go into the directory hello world and just run the ls command and here you will see some of the default ymls that is charts dot yml that values.yml and also you will see if you go into the run the ls command site the templates directly then you will see deployment.yml HPA in Race Service account dot yml so once you create a Helm chart using this command which is let me show you once again this command Helm create Hello World so once you run this particular command then you will get all these yml by default created inside your Linux machine so here let me explain this command once again so this is Hull which is a keyword create is also a keyword which you need to remember but the third thing that is Hello World this is a custom you can put any name of your choice so here just for the Simplicity I have kept the name as hello world just to show you the hello world help chart so this is the first command to create your Hello World hello chart and if you follow along the guide then here I have done the similar explanation so here you can see if you run the tree command then you will see all those files which is generated by running the helm create Hello World CLI all right so the next thing which we need to do is we just need to deploy this hello world Helm chart inside our kubernetes cluster and for that what you need to do you need to update some of the values so the values which I'm talking about over here is you need to go into the directory which is hello world you need to update the values.yml and inside the value dot yml you need to change the service type to node port because we just wanted to expose that deployment within our kubernetes cluster we don't want this service to be available to the outside world we just want to access that particular service within our kubernetes cluster or the Linux environment which I am using right now okay so what I'm just gonna do I'm just gonna head over to my terminal over here and I'm just gonna check which directory I'm in so I'm already into the hello world directory right now and I'm just gonna run the VA command on the value start yml and here you can see if you scroll down further then you will find a port this is the one so here you will see the service which is cluster IP and it is running on a port 80. so instead of cluster ipu I want to change it to the node board so I'm just go into the edit mode I'll press I from the keyboard because I have opened the VA editor and here I'm just gonna delete it and I'm just gonna do node port I'm just gonna press escape and I'm just gonna save and quit wnq and hit enter so that's how you are just gonna change the service type so that we can verify that particular service later after we do the installation of this particular hello world Hull chart all right let's follow the next instruction into the guide so we have updated this thing the next thing which we need to do is we need to run the install command so the install command you need to pay careful attention over here so here you need to use the keyword help then second keyword is installed that you need to remember then third keyword is my hello world so this is again a custom name so that's the name which you want to deploy inside the kubernetes cluster so that can be any name which you can keep but the fourth keyword which is hello world so that's the directory name of the Hello World Helm chart which you have just created so let me show you if I go to terminal over here so PWD and here this is the hello world directory which I have got once I have run the helm create command that I can show you also Helm create Hello World so when I run this command that's why I have got the directory hello world so don't get confused with those keywords so I'll show you once again if I scroll it down further so here so this is the directory name and this is the helm chart name which we are going to deploy inside the kubernetes cluster and this is the directory name where my Helm chart exists so that's the key difference between those two so I'm just going to copy this command from here I'm just going to head over to terminal over here and I'm just gonna jump back to the directory so right now I'm inside my Hello World directory so I cannot run this command inside the hello world directory I need to get out of this directory and here you can see I'm into my home directory we can again run the ls command so here we have the hello world directory so now I'm just gonna clear the screen and I'm just gonna paste the command and simply hit enter so here you can see we have just installed our hello world Helm chart let's run the helm list command to verify what are the helm chart which we are running inside our kubernetes cluster so the command for that is help list and a so here you can see this is the helm chart we have just installed and which is up and running and this is the time stamp which you can also see over here so this is another command which you will use quite a lot when you are working with the help chart all right when you look back into our guide so here you will also find the same command over here where I have used the hand list a to verify the helm chart installation the next thing which I would like to tell you is to check the service where our service is running so here you can see we can use the cubesatel get service command also that is for our own verification purpose so I'm just going to copy this command over here and I'm just going to show you like why we need this command so again I'm just going to switch to my terminal and I'm just gonna paste it over here and hit enter so here you can see this is our chart or our Docker container which has been deployed inside our kubernetes cluster it is running on a note port and the this is the cluster IP and this is the port where we can access it so now what we will do we will just try to access this particular endpoint onto this particular Port so that we can verify that our hello world Helm chart is deployed successfully or not since this whole setup I am running it on to my virtual machine which is an Ubuntu Linux machine but in case if you have installed this micro K8 cluster locally onto your Windows or Mac or a local Ubuntu system without a virtual machine then you can just simply use the localhost or 127.0.0.1 IP address but since this is a virtual machine so I need to know the IP address of my virtual machine so that I can access that particular service which I have deployed so for that I'm just gonna use the command to know the IP address and this is a Linux Ubuntu command which will be only applicable for Linux machines so just check the respective command to know your IP address based on your operating system so here this is the IP address of my machine which is 192.168.64.6 and this is the port 3374 so for first of all let's copy this IP address from here and go to browser and paste IP address and after that I am I'll just switch back to the console once again into the terminal and here I'm just going to copy the IP address and I'm just gonna paste it over here and here you can see this is the hello nginx page so this is an uh like a very basic Helm chart which I call it as a hello world Helm chart where I have just opened the nginx page so once you see this page that means you have successfully deployed your Helm chart or or in other words we can say you have successfully installed your Helm chart onto your kubernetes cluster and which is running and that particular service is running on a note port and that is accessible onto the IP address and this is the port where you can access that particular service now since we have deployed our first home chart successfully I would like to show you one more thing which is kubernetes dashboard and that UI is really useful to troubleshoot and view our deployment so what you need to do if you are using micro creators then you can simply run the command micro creators dashboard proxy but if you are not using micro creators and if you are using some other kubernetes like from AKs or or from gke or from AWS then you can just substitute this command with their respective dashboard command but since I'm using micro k8s but all the stuffs which I'm just going to show you right now are going to be the same for other kubernetes cluster also so I'm just gonna execute this command first of all and this will start our dashboard service on this particular Port that is 10443 and here this is the IP address since this service is running locally on a virtual machine that's why it say it says the Local Host IP but since I'm using the virtual machine and the IP addresses this one so I will access the same dashboard using this particular IP address so I'll just copy this IP address and go to over here I'll just close this one so that you can see from the scratch and then I will just put the IP address 10 uh 443 and you need to put https also over here and you will be able to see this so this is the kubernetes dashboard it will ask for the token and if you go back to terminal once again over here where I have executed so this is the token which you need to copy from here I'll just copy this one go to here enter the token and click on sign in and as soon as you enter the token then you will be able to see the dashboard and here you can see the UI way of like what are the services and deployment which are running so if you click onto the deployment over here then you can see the my hello world so here you can see this is the uh like the first Helm chart which we have deployed and which is running inside my kubernetes cluster so that's the one way to view the things what is happening inside our kubernetes cluster using the kubernetes dashboard all right so now we have deployed our first time chart so let's try to delete or uninstall the helm chart which is running inside my kubernetes cluster and for that what I'm just gonna do I'm just gonna switch to terminal go back to my terminal over here and I'm just gonna first of all run the command Helm list a and here you can see the name is my hello world so the command which I'm just going to run is Helm install and followed by the chart name which is this one so you need to put a space over here also and after that you just simply need to hit enter and here you can see the message which pops up is like mines my Hello World Helm chart has been uninstalled and you can just go back to your kubernetes dashboard over here and here you can see there is no deployment which is running so this is how you can just install and you can verify and then after once you are done with your testing then you can uninstall the Helen chart and which you can confirm from viewing into the kubernetes dashboard so with that we conclude our chapter 2 and in this chapter we have focused on like understanding the helm chart architecture uh playing with the helm chart CLI and also we have seen like how you can do the first installation of your Helm chart and finally once you are done with the verification and testing then how we have installed our help chart in the next chapter of this Helm chart series we are going to take a deeper dive into the helm commands welcome to the chapter third of this Helm chart series and in this chapter we are gonna dig deeper into the help command to manage your help chart all this command mentioned in this chapter we are gonna use on a sample chart which we are going to create and also these commands are so important that it is going to be used later on also so it's really important for you to get familiar with all these commands with let's take a first two commands in this chapter which is Helm create and help install so as the name suggests Helm create which means you need to use this command for creation of your Helm chart so here in this example you can see Helen create Hello World so this is going to create a hello world Helm chart for me once I execute this particular command the second command is Helm install so in the step one first we are going to create a hello world Helm chart using the help create command and once we have created that particular Helm chart then we are going to use the helm install command so here you can see Helm install these are the two keywords which you need to use for performing the installation of your Helm chart secondly you need to specify the release name and this my Hello World which I have kept over here my Hello World release it's a custom name which you can keep for your Helm chart so that's going to be a release name which you can keep for your Helm chart and after that the actual chart name which you have created in the previous Mark so here if you compare both the command then you will find that hello world is the name of the chart and the same hello world we are going to use into the install chart command also the only thing which you will differ over here is you need to specify the chart release name so here I have a specified the chart release name as my Hello World release all right so this is my terminal and the First Command which I'm just going to run is to help create Hello World so the command is help create hello world and here you can see the message creating hello world and you can verify the helm chart which is just created by running the command LS and here you can see this is the hello world Helm chart which has been created and we can deep dive into this particular directory also so LS lart and you can type the name of the directory and here you can see it has created the values.yml it has also created the chart.yml it has also created the templates and the chart directory so this is the default Helm chart which has been created using the command Helm create Hello World all right since we have created the helm chart the next command which I'm just gonna run is to install that particular Helm chart and the command for that is Helm install followed by the release name which is my Hello World release and the actual chart name which is hello world and once you write this command then simply hit enter and here you can see it has installed that particular Helm chart and the release name or the chart release name which you can see over here is the my Hello World release and you can verify this particular installation of Helm chart by running the command Hull list a and here you can see this is the name of the helm chart which we have provided during the installation and the revision number is one because this is the fresh installation of the halam chart which we have done so that's why the revision number which comes over here is one we are going to use this revision number later on for rollback command also as well as for upgrade command when we are going to take a look onto the helm rollback and upgrade command all right moving forward the next third command which we are going to take a look is to how to upgrade your Helm chart and the command for the upgradation is Helm upgrade followed by the hello world release name which is my Hello World release and the name of the chart which is hello world so one thing you need to keep in mind if you modify anything into your Helm chart let's say if you want to increase the replica count if you want to change the service type from node port to Cluster IP or load balancer or in a simple term if I would say if you want to make a change into any of your service or into any of your your Helm chart configuration then you need to run the helm upgrade command so that new changes can be installed onto your Helm chart and with that what will happen it is going to increase the revision number so let's jump to the terminal and see this particular command in action since I have already installed my Helm chart and this is the first release which you can see over here so what I'm just gonna do over here I'm just gonna make some modification to the helm chart and for that what I'm gonna do I'm just gonna go into my Helm chart directory going to the values.yml and here I'm just going to increase the replica count so here you can see on the top the replica count is one so I'm just gonna make a modification and make it two just for the demo purpose and I'm just gonna save and quit and after that what you need to do you need to type in the helm upgrade the name of the chart the release chart and the directory that is hello world because this is the helm chart which I have created when I use the home create command and you simply need to hit enter and here you can see the revision is 2 because we have upgraded our Helm chart and the chart which is hello what my Hello World release so now we have upgraded our Helm chart using the helm upgrade command now we need to verify the version what is whether it has been actually reflected or not so I'm just gonna clear the screen over here and the command I'm just gonna run is Helm list a and here you can see the revision is 2. so now you if you can relate with your first command which is Helm create or Helm install so first we created the hand chart then we did the installation so for the first time we got the revision one and when we did the upgrade then we got the revision 2 over here so that's the purpose of your Helm upgrade command all right so now we have seen the helm upgrade command then how about roll back so the fourth command which I'm just gonna take a look is the helm rollback command and the command is again pretty simple you just need to use Helm rollback the release name of your chart which is my hello World release and the actual name of the chart which is hello world so the command is pretty simple so here is my terminal and I'm just going to run the rollback command and sorry I need to correct one thing over here so you need to use the revision number to provide a rollback onto your help chart I'm just going to show to you so this is the command which I'm just gonna use so here you will see Helm rollback which is this one this is the keyword this is the keyword this is the name of your chart and I just need to correct this one so that is going to be hello world release and after that you need to specify the revision number of your particular chart so here I'm just gonna use one instead of actual hello world chart name so that's the difference and that's the thing which I need to correct it over here so I'm just gonna specify one over here because I'm just rolling back it to the previous version and right now the version is 2 and I'm just rolling it back to the previous version which is one so you just simply need to hit enter over here and here you can see rollback was success and now it has been rolled back but the key thing over here is once you roll back the changes but still that's an another change which you have performed so once you will run the helm list command over here then you will see three so I'm just going to explain uh one more thing over here so once you have created your Helm chart then you got the version one but when you have done the replica count to two then you have done the second revision and the third revision is like when you have again rolled back so you are you have the increment is happening sequentially one two and three one is for creation second is for upgradation of a replica count and third is for again rolling back so this revision number will keep on changing which is this one but you need to keep in mind like whenever you are using the rollback command then you need to know like which specific version or number you want to roll it by so this is how you are just gonna use the rollback command and I have just used this command over here so just keep in mind you don't need to use the hello world Helm chart keyword over here but instead you need to use the revision number the next command which we are going to take a look for Helm chart is to debug and dry run so here you can see I have created a little bit of flow chart diagram over here but let me explain why we need to use debug and dry run so imagine you are having a Helm chart which is little bit complex and you have made a little change into that particular Helm chart and before you want to actually install or upgrade that particular Helm chart you want to debug and do a dry run so that you get to know the errors if there are any misconfiguration which you have created into your help chart so this debug and dry run gives you a upper upper hand actually to debug and to know the issues associated with your Helm chart so before running an install command it is good to run the debug and dry run with your Helm chart so here on to the screen you can see I have created a like a flowchart which tells you that whenever you are going to run a Helm chart with the flag debug and dry run then it is going to communicate with your kubernetes API server so that means it is going to actually validate your home chart against kubernetes and if it's validate and verifies that your Helm chart is correct then it is going to allocate and tell you that this chart is correct and you can execute or you can install that particular chart onto your kubernetes server so this is my terminal over here and here I have written down this particular command to run a dry and debug onto my existing hello world Helm chart so again I'm just gonna explain this command that is Helm install because that's the command I just want to debug and dry run this is the release name of my Helm chart which is my Hello World release and these are the flag which is debug and dry run and followed by my actual hello world help chart which I have created so I'm just gonna simply hit enter over here and here you can see it has rendered some of the template with its actual value over here and which you can see I will start from the top over here so here this was the command which we have run and if you check the status over here pending install which means it is just doing a debug and dry run it is not going to install that particular command so although we are running Helm install command but we have supplied the flag debug and dry run so it is actually debugging and dry running that particular Helm install command so that's why the pending status is installed it has not installed that particular chart yet and also it has resulted all the values which is present into the yml which creates that particular Helen chart so here you can see all the values this is like a test connection this is the service account.yml and here you can see the name the version oh also sorry I have just copied some wrong value I'm just gonna clear it and here you can see our different different deployment.yml its values its replica count so you can pretty much find all the details which is necessary to validate your Helm chart using the debug and try run so that you can debug the issues before you actually deploy that particular Helm chart or before you actually install that particular health chart into the production environment so this is how you are just gonna use the debug Android run to provide a little bit more of debugging to your health chart the next command which we are going to take a look is the helm template command so this command is also a little bit similar to the debug and dry run but in actually the help template command doesn't interact with your kubernetes server to validate your Helm chart it just simply validates your ymls which is present inside your hello world Helm chart which we have created so if you are using the help template on any of your Helm chart then it is simply just going to validate your ymls and render that particular template locally onto your terminal so let's switch to terminal and see this Helm template command so here is my terminal and the command which I'm just going to run is the helm template followed by the actual Helm chart which I have created not the release name so I'm just gonna hit enter over here and as soon as you hit enter Then it is going to generate all the Helen chart yml in the form of template over here so here you can see this is the service account yml and here you can verify all the details which has been rendered so here you can see the version hello world name of your chart you can also verify your deployment.yml like what it's going to be deployed onto our kubernetes cluster so all these details are available over here so this is also a preparation setup when you're just trying to release or install a particular Helm chart on the production environment so you just simply need to run the helm template command and it will render you all the templates or all the yml associated with your particular hemp chart so that you can verify all the values which you have modified or which you have just created for your help chart the next command which we are going to take a look is the helm lint command and this particular Helm lint command is used to verify if there are any misconfiguration or error associated with your Helm chart so the command is pretty simple you just need to use harm lint followed by your chart name which is Hello World which we have just created into this chapter so I'm just gonna head over to my terminal and the command which I'm just going to run is Helm lint hello world and here you can see it produce an output so one chart linted so it has linted one chart and there are zero chart fill which means there are no error associated with your particular Helm chart so this is also a preparatory stuff which you can use before you release or install your Helm chart so that you can verify if there are any errors associated with your particular Helm chart then you can debug and troubleshoot that particular error and the final command which we are going to take a look is to uninstall the helm chart so this is the command which you need to use if you want to remove or get of your particular help chart so the command is pretty simple you need to use Helm keyword followed by uninstall and then your Helm chart release name which is my Hello World release this is the command which you just need to use and that will install and delete your help chart let's switch over to the terminal and see this command in action so this is my terminal over here and I'm just going to run this command and here you can see uh release my hello world has been uninstalled and we can verify the helm chart by running the command whether it has successfully installed or Not by running the hell list a and here you can see the list is pretty much empty which means we have successfully installed our help chart so with that we conclude our chapter 3 on getting familiar with the helm chart CLI or Helm chart commands in the next chapter which is chapter 4 we are just going to create our own custom Helm chart so till now we have been using a very simple hello world Helm chart but in the chapter number four we are going to create our own custom app which is going to be a python application in which we are just going to create a rust API or a rest endpoint and then we are just going to create a Docker container of that particular python project and after creating a Docker image then we are just going to push that Docker image to the docker repository and once we have pushed the docker container to the docker repository then we are just going to create a Helm chart for that particular python project and then we are just going to use the docker image inside our Helm chart so that we can deploy that particular Docker inside our custom ah inside our kubernetes cluster using the helm chart so that is going to be a little bit more interesting and I hope you have followed the previous three chapters because where we have covered a lot of Basic Ground to understand what is Helm chart and how to get familiar with your home chart so if you are just jumping on directly onto the chapter 4 and if you are beginner to the helm chair then I would highly recommend to follow these previous three chapter because that will help you a lot to understand the harm chart so see you into the next chapter and we'll create our first custom python project for our Helm chart hello and welcome back to the chapter 4 of this Helm chart Series so in this chapter we are gonna talk about how to create your own custom chart and for creating our own custom chart we are gonna use a python application when we are going to create a Docker container of that particular python application and then we are gonna use the docker container to push it into the docker repository and later on we are gonna use the hunt chart to deploy that particular Docker content into the kubernetes environment well if you are new to this Channel and if you are new to this particular Helm chart series then I would recommend you to follow the previous three chapter where we have covered a lot of basic onto the helm chart and which is really necessary to understand the basics of Helm chart and which we are going to use in this chapter so if you are new to this Helm chart then please go and follow those previous three chapter and that will really help you to boost the understanding of your health chart to begin with our first point which is our python application and this is going to be our rest based application where we will be creating a rust endpoint so here I have created this public GitHub repository and I'll post the GitHub link of this particular repository into the description section so feel free to clone that wrapper so I'll switch over to my ID and I'm just going to show you like how I have implemented this particular rest API so this rest API is quite simple it's not something complicated which I have built but the concepts are gonna be the same it doesn't matter which kind of application you are building since I have taken a python but you can take even take a Java angular node.js application or golang application also the mandatory thing is you need to create a Docker container but let's focus on this particular rest API application so here the application is quite simple I am using the flask framework for Python and here I have created a hello world rest API endpoint which can be accessible via hello and then here it will return the hello world message in the form of Json data so that's the simplest application which I have built so first of all I'm just going to run this application locally onto my machine so here since I'm using ID so I can simply click here and run main but in case if you are not using ID and if you wanna use the command line then you can simply execute python3 main.py and this is the main.py file which is present inside this particular GitHub repository so as you can see this application is running on a 9001 Port because I have a specified this port over here that's why it is running on a 9001. okay so now it is running so what I'm just going to do I'm just gonna copy this particular URL head over to my browser I'm just going to open a new tab press the URL and type hello and here you can see this is the data which is it is returning so this is a response which I got back from my python application so this is the idea behind my python application now the next thing what I'm just gonna do I'm just gonna create a Docker container locally and just run and verify that particular Docker container before pushing it to the docker repository all right so the next step is gonna be build the docker image and then run that particular Docker image for building and running the docker image I have created a readme file which you can find it from here and here I have mentioned all the commands which is necessary for building this particular Docker image so the first thing is you need to build the docker image so for that I'm just gonna use this Docker build command which is Docker build T is used for tag this is the name of my Docker image which you can keep anything and then you need to suffix it with the dot so I'm just going to copy this particular command I'm just gonna open my terminal over here and let me check the path okay I'm into the correct path and I will also check the docker file and here I can see the docker file which is present over there but before we build the docker image I just can't I just wanted to show you the docker file also so this Docker file is also quite simple here I'm using the version python 3.8 I have created a work directory which is app I'm just copying all the content from my current directory which means I I will be copying these these these and these files into the app directory and once I have copied that then I'll be running the PIP install requirement.txt because in the requirement.txt I have specified the library which is flask and which is really necessary to run this application so here in the docker file I will just run this pip install command so that all the libraries are getting so that all the libraries get installed into a one Docker image and then finally I'm just gonna execute my main.py so that's the simplest Docker file which I have written it over here now what I'll do I'll just open the terminal and I'll just build the docker image locally I'm just gonna clear the screen over here once again and I'm just gonna paste the command and here you can see Docker build t for tagging and this is the name of my image python project and then Dot and simply hit enter it might take a couple of minutes to build your first Docker image if if you haven't built a Docker image before alright so my Docker image had just finished which you can see over here and I'm just gonna clear the screen and verify my Docker image so I'm just gonna run the command Docker image LS and it will list down all the docker image which is present inside my directory so here you can see this is the image python project which I have just built 37 seconds ago so that's the docker image which we are going to use it now let's switch back to our readme file and before we push our Docker image to the remote Docker Hub repository first we want to verify our Docker image by running it so the command for that is Docker run and this is the port which is 9001 and the image name which is python project so I just wanted to verify that I am able to run the docker image successfully or not so I'm just gonna copy this particular command go to my terminal over here I'm just gonna clear the screen and run the docker image and here you can see it is running on that particular 9001 and I'm just gonna open the terminal I'm just gonna copy this URL once again I'm just gonna close that Tab and I'm just gonna re-paste it over here and here you can see I'm able to access my particular Docker container uh rest endpoint which is running inside my Docker container with my python application so my Docker container is up and running the next task is we need to push the stalker image to the docker Hub Repository so for this demo purpose I will be using the docker Hub as my remote repository so as you can see over here this is my Docker Hub account and this is the repository which I have already created for my python application which is python flask rest API project so this is the repository where I'll be pushing my Docker image so that I can access this Docker image later on when I'm you when I'll be creating my Helm chart so this is the docker Hub account which you need to create if you are using Docker Hub but in case if you are not using Docker Hub or if you are using AWS or Google Cloud then you need to use the respective container registry or artifact registry available into the respective cloud account so here for example if you are using AWS then you need to rely on a Amazon ECR so it is again a container registry or repository which will hold the container images Docker container images for you and in case of if you are using Google Cloud then this is the artifact registry which you need to use for holding the container or like building an where you can actually build and post Docker container image and this image image will be available onto this artifact registry or of our Google Cloud okay let's switch back to our Docker Hub and I'll just gonna close the AWS and Google Cloud tab so this is the repository which I'll be using and what we need to do we just need to go to ID and again follow the readme file over here since I have created this Docker image with the project python python project name now I need to re-tag that particular image with the docker Hub repository name so here you can see I have rendered command Docker tag over here and here I'm using the python rest API I think this is incorrect name which I need to correct it and here I need to put the correct name over here which is python flask rest API project that's the repository name of my Docker Hub I can show you once again so this is the name python flask rest API project so here you need to suffix that name correctly otherwise you will not be able to push that Docker image into the docker hub all right so what I'm just gonna do I'm just gonna go back over here and I'm just gonna correct this particular uh command so I'm just gonna use Python project because that's the image name which we have already built so I'm just gonna use this one and yeah and I think I can use this one also all right so now I have updated my command uh with the correct Docker image name now I need to open the terminal over here okay I'm just gonna clear the screen over here but one thing I forgot to tell you you need to perform the docker login from your command terminal otherwise you will not be able to push the docker image to your remote Docker Hub account so what you need to do you need to run the command Docker login and once you run this command it will ask for a username so I just need to put in my username and then password over here and hit enter and here you can see on the login succeed which means you are now able to authenticate from your command line interface and once it is authenticated successfully then you will be able to push your Docker image but before pushing the docker image you need to tag that image again with the name of repository so here we have updated this particular command and here I'm using the image which we have already built so I'm just gonna copy this command head over to terminal sorry not this one I'm just gonna clear the screen over here and I'm just gonna run the docker tag command over here and again we can verify by running the docker image LS command and we should be able to see here you can see uh this is the image which we have tagged right now for our python project so the next thing is we need to push this Docker image to the docker Hub so again follow the readme file for Docker push and here you need to copy this particular command and you we need to correct this by a name python rest API which is incorrect so I'm just gonna copy it and head over to my terminal I'm just gonna clear this screen and go over here then it should be I'm just gonna recopy that name python project go to terminal and I'm just gonna perform the docker push over here and it might take a couple of minutes to push that particular Docker image to the docker hub and as you can see over here our push has been performed and now we can go back to our Docker Hub account and refresh the page to see if that Docker image is available there or not so here I'll just switch back to my browser and here you can see this was the page which I have not refreshed it yet and this whole image repository is empty and I just need to refresh it and here you can see this particular image is available right now into my Docker Hub repository so this is how we are just gonna build the docker image and push it to the docker Hub and now the image is available now we will start working on the helm chart creation so first we will create a Helm chart and then we will just update the repository URL of this particular Docker image so that our Helm chart can access this particular Repository all right so now I'm switching back to my terminal where my kubernetes cluster is running and where I have already installed the help chart and now we have already created a python project we have already created a Docker image and Docker image is available onto the docker Hub so the next thing which I'm just gonna do over here I'm just going to create a Helm chart so what I'm gonna do I'm just gonna run the command Helm create and after that we can put some suitable name over here so which I'm just gonna take uh like a python flask rest API project I'm just gonna switch to terminal and hit enter so now we have created our first Helm chart for our python project and we can verify by running the ls command so here you can see uh this is the helm chart directory which has been created and we can verify by running lslart so that we can view all the content inside that particular help chart so here you can see values.yml chart.yml which are present over there so the next thing what we need to do over here is we need to update the docker image name into the chart.yml and which I'm just gonna show to you so what we need to do we need to go and open the chart.yml into the edit mode so I'm just gonna run VI and then python directory and then I'm just gonna open the chart.yml into the edit mode so here you can see I have opened it into the edit mode and here first of all we need to comment out the app version because we are not using any app version over here so I'm just gonna go into the insert mode I'm just gonna put hash and I have just commented this one save and quit okay so first thing we have updated about the chart.yml the next thing which we are going to update is the value start yml so again VI python the directory name and the value start yml and here you will find the repository URL name in the previous we have updated the values where we have updated the version but now we are going to update the repository URL so I'm just gonna go into the edit mode and here you will find this repository which is this one which I have highlighted right now okay so here by default it provides you the nginx but I need to remove this one go back to your Docker repository and you should copy uh this name from here and the project name also which is python project I'm just going to copy this and paste it over here and after that you save and quit okay so now we have updated our repository URL so Helm chart knows like from where to pull the docker image so that's we have done the next thing which we need to do is we need to specify the service type so that kubernetes know like which kind of a service type which we are expecting from this particular Docker image so again I'm just going to open the same values.yml and here I'll just go down and this time we are just gonna use the node Port so that we can access that particular rest API within our kubernetes cluster so here you will find the service which I can I'll show you over here this is the cluster IP which we need to change and I'm just gonna change it with the note port and after that save and quit so first of all uh we have updated the values.yml and then we have also updated the chart.yml and now we are just gonna update the deployment.yml also so we are just gonna open uh we are just gonna go into the python directory where our Helm chart exists then go into the templates and then we are just going to open the deployment.yml sorry I have mentioned the deployment.yml earlier but we are just now going to edit the deployment.yml previously we have updated the values as well as chart.yml okay so here uh the thing is uh since uh you remember that we are running our python application on a 9001 Port so the first thing which we need to change over here is you need to change the port number of our deployment.yml so that we specify the correct port number and which is 9001 and which you can see right now the container Port is 80 which we need to change otherwise you will not be able to access your application so I'm just gonna go into the edit mode and here I'm just gonna use the 9001 okay okay that's been done that's the one part the next thing which we need to change it over here is the props so probes are something which is like a liveness prop Readiness prop uh that we need to change because we have not created any liveness and Readiness prop yet because this is just a very basic application which you want to like so I'm just gonna put it into the edit mode once again and I'm just gonna either we can comment it out this lines over here okay so now we have commented out all those probes which is not necessary for this deployment so I have just commented out and now we have updated our Port so now our Helm chart is ready and now we can run the helm install command and we can verify that our hello world application runs or not this they forgot to tell you in the deployment.yml we need to update the app version also which we are not using actually I'm just gonna show you so if you go over here then you will find the app version which is this this particular line since we are not using any app version right now this is just a demo application and we have commented this variable into our chart.yml also so that's why we need to remove this particular expression from here otherwise we will not be able to deploy it so I'm just gonna go into the edit mode and I'm just gonna remove this particular values from here and remember it is using the app version which we have commented I'm just gonna re-show you that version variable once again to you so that's been done and now I'm just gonna save and quit and the value which I just wanted to show you is python uh chart.yml and here you can see this is the app version so this lineup I have already commented so that variable is no longer useful that's why I had I need to comment it out into the deployment.yml all right so now our Helm chart is ready and now we have updated the docker image ports and everything correctly the next thing which we need to do is we need to install the helm chart and for that I'm just going to use the command help install my python hell chart I'm just gonna put some some suitable name for my own own convenience and then I just need to put the correct Helm chart folder name which is this one and you simply need to hit enter over here and as you can see uh the status is deployed which means our Helm chart has been deployed and now the next thing which we are going to do we are just going to verify the deployment and we are just gonna access that particular hello world endpoint from our kubernetes cluster let's first of all check the helm chart list command so I'll just clear the screen over here and the command which I'm just going to run is list a and here you can see here you can see that my Helm chart has been deployed the revision is one because this is the first time I'm deploying it the next thing which I'm just going to verify is by running the cube serial deployment check so I'm just gonna run the comma I'm just gonna clear the screen so I'm just going to run the command group CTL get deployments and here you can see uh the this is the uh deployment which is running over there and the status is ready which means it has been deployed successfully and which is available right now the next thing which you need to verify is the cube CTL we just need to know the port where it is running so I'm just running the command Cube CTL get service and here you can see this is the deployment which is running inside my kubernetes cluster and the service is note Port because we have edited this into our Helm chart and this is the cluster IP and this is the port where it is accessible so now we are just gonna use this particular port and the IP address of my virtual machine because this whole terminal is my virtual machine this is running onto my Mac OS so I'm just going to use the virtual machine IP address prefix suffixed with this particular IP and then we are just gonna access that hello world endpoint all right so now we have seen that our deployment is successful and now we need to access that particular rest endpoint and because we have deployed that application using the helm chart and that application or the docker image is running inside our kubernetes cluster okay so to access that we need to know the IP address of my particular virtual machine since I'm using this virtual machine that's why I need to know the IP address of my virtual machine but if you are using the Google Cloud then you will get the public IP or if you are using the AWS then also you will get a public IP to access that particular kubernetes cluster service but here I just need to run the command host name I to know my IP address so this is the IP address of my local machine I'm just gonna copy it and I'm just gonna head over to my browser I'm just gonna paste it over here after that I just need to find the port which is three one eight six six I'm just gonna copy that one and I'm just gonna suffix it and then I'm just gonna hit hello and here you can see uh this is the response which I'm getting and now I'm getting this response from my kubernetes cluster service so now you can see that we have built the whole application from the scratch we have built the docker image and we have push the docker image to the docker Hub and then we have created our hump chart and using that Helm chart we have deployed or we have installed that Helm chart and now the docker image is deployed inside our kubernetes cluster and now we are able to access this particular hello world hello world endpoint from our kubernetes cluster okay so now we are to reaching towards the end of this particular chapter and if we retread all the points which I have shown you when we were beginning this particular chapter so here you can see the first point is python application with rest API yeah we have done it we have created it create a Docker container yes we have created Docker container locally push the docker image to the docker repository so yeah we have created Docker container and then we have pushed that image to the docker repository then we have created our Helm chart for that particular python application yes we have created we have updated the values in the values.yml chart.yml deployment.yml and then we have installed the helm chart and finally we have verified the helm chart after installation so how did we do the verification so we just access this particular endpoint which is running inside my kubernetes cluster so with that we conclude our chapter fourth and I hope now you have built a good understanding on the help chart and now you are a bit more familiar with the helm chart and how to create your first help chart hello and welcome back to the chapter 5 and in this chapter we are gonna talk about the help file before we Deep dive into the help file and into this chapter it is really important for us to understand what is Helm file so first of all Helm file doesn't come along with the helm chart installation so you need to install this hum file utility separately so with the help of file you can efficiently manage your Helm chart so there will be few command which you need to run when you are using the help file and those commands are quite basic command and with the help of those command you will be able to manage your complete Helm chart so instead of running Helm install Helm install Helm delete Helm rollback you can just rely on a single command which I'm just going to show you into the next slide and you can execute that particular Helm file command onto your command line interface and you will be able to manage your help chart so basically it improves the like a workflow of your Helm chart and you can efficiently manage your Helm chart to manage your kubernetes cluster before we install the helm file let's stay try to take a look on to the command line and which will make a difference when we are using the helm file and when we are only using the helm chart so here onto the screen you can see on the left hand side I have written down some basic command of my Helm chart which we have seen in the previous chapter so here I have written down the first command is help install and my chart second there is one more command that is Helm uninstall my app so first of all I'm just trying to install my Helm chart and then I'm just going to uninstall the helm chart and for that we need to run two commands that is Helm install and help install but once you start using the help file then you don't need to rely on these two command you can just simply run the single command which is Helm file sync which I have written down over here and it will take care of the installation as well as the installation but yeah I know it might sound confusing how can a single command manage the installation as well as uninstallation of a Helm chart so for that I have created a next slide and in which I can explain you like how the hell file works so whenever you're working with the help file then you need to create a Helm file for managing your Helm chart so this is the yml file which you need to create so this is a sample yml file which I have taken so here what you need to do you just need to add a first tag which is releases after that you need to mention the name like the release name of your Helm chart which is hello world just I am taking for the example purpose and the actual chart directory name so suppose I have created a chart which is hello world so I have executed the command Helm create Hello World then it will create a directory where it will place all the chart yml files so this is the name of that particular hello world Helm chart and this is the release name so don't get don't get confused with the name and the chart so chart is the directory and the name is the release name of my Hello World help chart and when you put the next flag which is install equals true into your help file that means you want to execute this help file command to give the installation instruction so when this flag is set to True which means that you are just going to install that particular Helm chart so whenever you execute this command like the helmsil command which is I have written down here so whenever you execute helmsync command and inside that file if you have installed flag equals true which means you are instructing the helm file to install that particular health chart so that's why it interprets this yml and try to install that particular help chart all right now we have done the installation then how about the uninstallation so what you need to do over here you just need to set this flag to false over here into the same yml file and once you set this flat to false then it is going to uninstall that particular Helm chart and again you just simply need to run the same command Helm file sync so now you can see you just need to run the single command but you need to update the file and you need to set the flag true and fault based on your requirement so this way you can manage the helm chart installation as well as installation using the helm file command and along with this chapter I'm just gonna share this guide with you here I have documented all the steps which I will be performing during this demo so just feel free to refer to this guide if you in case need to search for some specific command which I'm just gonna show inside the demo so the first thing over here is we need to install the helm file so here is the instruction which you can click on this particular link and here you need to remember the prerequisite you need to have the Helen chart already installed onto your local system or somewhere so that you can you are managing your kubernetes cluster using the helm chart or if you haven't installed the helm chart then please refer to the chapter one where I have shown you like how to install the help chart next thing the helm file and how to install the helm file so here you just need to click on this particular link which I have posted over here this is a GitHub repository link where you will find the installation command or the installation package for your help file so here different different packages based on the OS which you are using since I will be doing this installation on the virtual machine which is running locally onto my Mac OS so the machine which I'm using is the Linux Ubuntu virtual machine onto my Mac OS so remember although it looks like I'm using Mac OS but I'm actually running a virtual machine which is Ubuntu based here I need to choose the version since I'm using the Silicon chip so I will be using the Linux arm 64 and in case if you have a Intel based CPU or Intel based machine then just go for Linux AMD 64 because that's that's gonna work for you all right so here this is the version which I need to use so I will just copy this link over here from this particular GitHub repository link and after that you need to head over to your Linux machine and where you need to run the wget command to download it into your Linux machine alright so this is my Linux machine terminal the command which I'm just going to run is W gate to download that particular package for help file so I will just hit enter and it might take a couple of minutes to download it and now it has downloaded and the file name is Helm file Linux arm 64 and it might be a little bit different based on your operating system so just I'll clear the screen and I'll run the ls command to verify the file so here you can see this is the file which is present over here so first of all what we need to do since it's a really big name so I would like to change the name and the name which I would like to change is like I would like to make it only Helm file so I'll just copy this and then I'll rename it to help file so this is the name of the file which I would like to use from my command line so I have renamed it I'll just verify it once again so here you can see now I have changed it and it's now with the name hell file all right I'll clear the screen over here the next thing which I need to do is I need to change the permission so that it has a read write an execution permission because this is a command line utility and it should have execution permission set on to it so I can first of all check the permission so here if I do the this is the ls Ard so this I can verify the permissions which is set on to that particular file so here you can see it has it only has a read and write permission so I need to change it to make it uh executable also so what I'll do over here I'll clear the screen and I'll just run the CH mode command and I'll put 777 and Helm file so that will make it make it at executable I'll rerun the lslrt command to verify and here you can see it is executable now so now I can execute this uh from my command line interface after making it executable the next thing which we need to do is we need to move this file into the user local bin directory so that I can execute this particular Helm file from anywhere into my terminal so I'll clear the screen over here and the command which I would like to run is move and I'll put the helm file and the path which I would like to put is user local bin permission denied that's fine because I need to add a sudo over here because it needs root permission and here you can see I am able to move that particular file so I can run the command lslart and I will choose the part to verify that I have actually moved that file or not so here you can see I am running the ls command onto user local bin and yeah here it is this is the file which you can see over here all right so now we have done the installation of a Helm file let's run the helm file command to verify whether we have installed it correct or not for that I'll first of all clear the screen and I'll just gonna run the helm version I guess and here you can see this is the version which we have installed onto our Linux machine and now we are ready to work with our help file utility okay so we'll start again with the very basic example so that we can understand the help file pretty well so first of all I'm just gonna create a very basic hello world Helm chart over here so the command which I'm just gonna run is Hell create Hello World and it has created the hello world Helm chart for me and I should see a directory over here so I can run the ls command and here you can see this is the directory where I have created my Hello World help chart the next thing which I need to do is I need to create a Helm file over here and once I create the help file then I'll put and mention the name of my Hello World Helm chart which I need to install using the help file all right so let's create the file first of all so I'll just put VI Helm file yml and that will create a file as well as it will open into the edit mode now I have created that particular file and I'm into the edit mode but now I'll just go back to the guide which I have shared with you so I'm just gonna copy this whole content from here and I'm just gonna go back to my terminal and I'm just gonna paste it over here and here you can see the name which is uh this is the installation name or the release name of my Helm chart and this is the directory which is hello world and now I'm writing it as install true which means I want to install that particular help chart okay so I'll what I'll do I'll just rename this uh so hello world uh let's say I'll put it release name or release should be quite okay it's just a demo purpose that's why I'm just keeping this random name over here so I'm just gonna save and quit [Music] and here you can see LS so here we have the hello world directory which is my Hello World Helm chart and this is the helm file.yml so both are into this same location and we can verify the content of Helm file once again over here so that is Hello World which is correct so the name of the directory is also correct and this is the release name which you will see eventually so now the next thing which I need to do is I need to run the helm file sync command so what I'll do Helm file and I'll run the sync command over here if I type yeah that's correct and uh here you can see I'll just increase or I'll just what I'll do I'll just reduce the sign size of this particular terminal so that you can also see let's just give me a second yep here it is so here you can see this is the command which I have executed and it has installed the one chart which you can see one revision deployed and this is the name of the release which I have put it and this is the name of my chart and the version is 0.1.0 which means it has installed my help chart I'll clear the screen from here and I can run the normal Helm command to verify my chart so I what I'll do hell list a and here you can see this is the same hello world Helm chart that is the release name of my chart and the revision is one and this has the updated timestamp it has been deployed so this is how you can do the first installation of your Helm chart using the help file all right so now we have seen the installation the next thing which I would like to show is how to install that particular Helm chart so for that what you need to do you just need to open the helm file once again into the edit mode and now what we'll do I'll just change from True to I'll just change it to the false and I'll just save and quit and again I'm just gonna run the same command Helm file sync command so I'll just type Helm file and sync command and here you can see the message which it says like a deleted release and this is the release name which is got deleted or hello world Helm chart which has got deleted so you are using a single command which is Helm file sync and you are able to install as well as you are able to uninstall the help chart moving further so till now we have seen like how you can create your Helm chart locally and then you can create the help file locally and then you can do the helm chart installation using the helm file sync command but there is also one more good utility which I found with the helm file is that you can install the halem chart from the remote GitHub repository and what does that mean so if you take a look onto this particular guide then here you can see this is the repository name which is hello world and this is the helm chart which I have already pushed to my GitHub repository which I can show you so here this is the helm chart repository which I have created and here you can see this is the hello world Helm chart so in case if you are working working in a team and some of your team member has already published this Haram chart repo onto the GitHub repository then you can remotely use that Helm chart to install that particular hunt chart into your kubernetes cluster so that's the most advantageous thing which I have found with the helm file so here you can see here I have all the templates and everything which I which I generally have when when I work locally with the help chart so this is the sample repository which I have created for hello world and that you can also pretty much install using the helm file utility okay so that we are gonna see the next but there is a one plugin which you need to install so that you can work with the remote GitHub repository with your Helm chart and Helm file so this is the plugin and I'll put the link into the description section as well as you can find this link into this guide also I'll update this guide section also so that you can install this plugin also so here this is the name of the plugin Helm get which you need to install and you will find the instructions which is present over here so this is the command for that I'll just copy it first of all and I'll go to my terminal I'll paste the command over here and I'll hit enter okay so now I have installed the help kit plugin and the next thing which I need to do I just need to go to my this particular guide and here I need to create the helm file using this instruction so first of all I need to mention the repository name where I have already uploaded my Helm chart and after that the similar thing which I have just shown previously you need to put release a stack here you need to mention the release name here you need to mention the chart name since uh this is a remote chart so here we have a directory inside that so this is the helm chart directory and here you will find a one more directory which is hello world so that's why then there are two hello words this is the name this is the directory and this is the hello world chart name and then you need to set installed equals I have set it to false but you can set it to true for installing your particular Helm chart so let's head over to terminal let's create this Helm file and then we will do the Helms file sync command so that it can install the helm chart from the remote repository location okay so I'll clear the screen over here uh I'll type the command correctly okay so first of all I'll empty the file which I have already created so I'll okay so now I have emptied the file I'll re-verify it yeah the file is empty I have run the cat command that is empty I'll clear the screen I'll just open it in edit mode and I'll paste the content over here uh there are some spaces which I need to fix it I'll put go into the edit mode and here I need to fix this part hope there should not be any syntax error into this yml because I just copied it from my blog uh I think it looks good so I'll just skip seven quid and now once you have edited uh there is one more thing I need to verify hell file because it has a false flag which I need to set it to true because I just want to install it first okay I'll save and quit now so now I have edited my hello world sorry Helm file with the hello world Helm chat which is available remotely onto the GitHub repo the next thing which I need to do is I need just need to run the hell file sync command so that I can install that help chart okay so I'll clear the screen over here and the command which I'll run is helm file and then sync all right so here you can see adding the repo from this particular location affected release and here you can see listing the chart which it has installed so it has installed the helm chart hello world Helm chart from remote location I'll clear the screen and we can run the command that is Helm list a to verify the installation and here you can see it has just installed that hello world Helm chart from the remote location so that's the advantage which you will get if you if you are using the help file to manage your help chart and once we are done with the verification then what I'm just gonna do I'm just gonna clear the screen I'm just gonna go into VI edit mode and I'm just gonna set that flag to false over here okay that's been done save and quit and again run the Helen file sync command so that it can uninstall that particular health chart and you can see it has deleted that particular release all right so moving back to the guide so now we have seen like how to install the helm chart locally how to install the helm chart from the remote repository location using the helm file the next thing which is quite simple now and I would just walk you through so you can also install multiple chart using the helm file and how you can do that is here is an example which I have kept it over here so you will create a released again Helm file dot yml so this is the content of a Helm file yml and here you need to mention the particular like a hello world or not hello world but any Helm chart which you want to install so this is the first hello world hell chart which I want to install and this is the second hello world Helm chart which I need to install and remember these both the charts are not available on a remote location it is available locally so so using the single file also you can install multiple Helm charts so it so help file particularly gives you this feasibility so you can have a multiple Helm chart uh defined in a single file and you can simply run the help file sync command and that will install those Helm charts into your kubernetes cluster so this is also one example and you can just refer to this particular yml in case if you need to have like a multiple Helm chart installation getting done onto your kubernetes cluster so that's a really good utility which you can use to manage your Helm chart so with that we conclude our chapter 5 and I hope this chapter on a Helm file will help you to increase your knowledge on how to use your help file to manage your Helm chart and in this chapter we have seen like how you can create a basic Helm file hello world Helm chart then we have seen like how to include or how to import a Helm chart which is present on a remote repository location and get it installed and we have also seen like how you can manage the multiple installation of a Helm chart using the helm file in the next chapter we are going to talk about the helm chart repos and these wrappers are like a pre-built chart which is developed by open source community and which is ready for you to use and for example these repos are like a WordPress masculite and the MySQL so these are some readily available charts which you can use so we are going to take a look into the next chapter welcome back to the helm chart series and in this chapter 6 we are gonna talk about the helm rappers so what do you mean by the helm rappos so Helm rappers are the repository where we have a pre-built chart which is readily available so what does it mean by a pre-built chart so let's say for example if you want to install WordPress or if you want to install MySQL DP or if you want to install mysqlite DB then those charts are already made and available onto the helm repo which you can just download and get it installed onto your kubernetes cluster using the help chart so for that purpose we use the helm wrappers and we can just import those chart from those Helm wrappers now you might be wondering like how to search for those wrapper and how to find those chart using the command line so there are certain command which you need to use to search for that particular chart which you are looking for so for example this is a guide where I have written down one command like a help search Hub WordPress so here I'm just trying to find or I'm just trying to search for the helm chart for a WordPress installation so you can just simply copy this command from here and go to your terminal where you have already installed the helm chart I'm just gonna clear it and I'm just gonna paste the command over here and it can result into the various output over here so which you can see so here these are the artifact repository of Helm where they have already uploaded those chart and these are the versions which you can see over which is there so you just need to pick one of the version which is which you have just searched for WordPress and once you have find suitable version then you can install that particular Helm chart using the helm chart installation command so well that that's just something else uh how to do the installation from using this particular remote like a repository location but if you are interested in searching the like a various home chart then you just need to use this particular command which I have just shown to you that help search Hub and Then followed by the actual chart which you are looking for so since here I'm looking for a WordPress that's why I have used the keyword WordPress over here also one more thing if you see this particular uh URL which is bit shortened because the length of this URL is quite big so in that case you can use some one more command which is like this Helm search Hub WordPress and followed by the max column width 0 so which will output the whole like a URL of that particular repository location which I'm just gonna show to you so I'm just gonna head over to terminal I'm just gonna clear the screen and paste the command once again and here you can see the complete URL of that particular Helm chart wrapper so here you can see which is this is the URL for WordPress for the version 15.2.13. so this is something useful filters which you can apply onto the repo list command uh the one thing which you might be wondering also that how should I know that which uh chart or the which repo list which I have already added into my Helm chart uh where I'm where I have already running my Helm chart so this is the command which you can tell you that these are the repo which already been installed onto your Helm chart where you have already running uh let's say for example if you are running the helm chat onto your virtual machine then you can just run this command Helm rapper list to identify that which repository or the which remote wrapper which has been installed onto your machine so I'm just going to copy this command I'm just gonna head over to terminal I'm just gonna clear the screen and paste the command so here you can see that that is only Hello World which I have created but there is no like a remote wrapper which I have already added into my local Helm chart environment so for that what you need to do you just need to add that particular wrapper link over here so here you can see this is the command which I I will be using like a Helm wrapper ad with nami so bitnami is the most popular repository for finding the like most stable chart in the helm chart environment so I'm just gonna copy this particular link from here and sorry not this but this go to terminal I'll clear the screen over here and I'll paste the command so here you can see the bit not me repository has been added and now we can run the command and here you can see so hello world which we have already created and installed and then after I have installed the bitnami so this is how you can just manage the rapper links or the rapple list inside your Helm chart working environment now one more uh important thing which I would like to show you is that uh since uh for example let's say you you are looking for a chart which is a WordPress on a bit Nami repo but you after finding that particular chart you want to know like what's the installation instructions or the instructions provided by the developer who has built that WordPress help chart so how to do that so for that there is a like a readme command or that command which can help you to use the readme to follow the instruction on how to perform the installation so this is the command which I just like to show you Helm show readme and then you need to specify the repo and the chart which you are looking for so the rapper name is bitnami the chart is WordPress and you also need to specify the version so this command is bit old this post is bit old so I need to update the version over here so that I can look for the correct Helm chart version of Wordpress and with this command you will be able to check the a readme of that particular repo like a WordPress repo where we have a Helm chart available so I have just copied this particular command over here and I'm just going to head over to my terminal and I'm just gonna paste the command sorry I have just copied the version let me check if I yeah so here it is so help show readme and this is the repo link this is the WordPress which is the halem chart and this is the version I'm interested in so I'm just gonna hit enter and here you can see this is the readme which is like all the instruction which is needed for doing the installation of that particular WordPress Helm chart so you can just pretty much follow these readme and follow this instruction if you want to install that particular chart on to your kubernetes cluster from the repo of bitnami so with this we conclude the chapter 6 and in the next chapter we are gonna talk about the helm Hook and the helm tests welcome back to the helm series and in this chapter number seven we are gonna talk about the helm hook and how to use the help test to verify your Helm charts alright let's try to First understand what the hell hooks are and for that I'm just gonna take a very simple example so in the previous chapter we have seen like we have created a Helm chart and we have tried to install that Helm chart and as soon as you install the helm chart then you get a version one of that particular help chart so in previous chapter we have created a hello world Helm chart and that we have installed it so just assume that this is a simple chart on the left hand side which you can see and this we are just going to install using the helm install command and as soon as we install then we will get the version one but there are tricky things inside when we talk about the helm hook so there are different kinds of a Helm hook which are available so for example there is a pre-install and there is a post install hook so here what does it mean by pre-install and post install so if you want to perform some kind of activity before you install a Helm chart then you are just gonna use the pre-install hook and similarly if you want to do some post activity after the installation of a Helm chart then you're just gonna use the post install hook all right that's okay because I have just told you like when to use the helm hook but I have not told you why you need to use the helm hook so let's consider a scenario that you want to install this particular Helm chart but you want to set up a Cron job also so this is just a very basic hypothetical example I'm taking over here so if you want to set up some kind of a Cron job then you're just gonna use the pre-install hook so that before installing this Helm chart I just wanted to set up some some kind of a Cron job inside my Linux system or my kubernetes cluster so that's a one use case second not talking about the post install so once you have installed any Helm chart inside your kubernetes cluster then what you want to do you just wanted to run some cleanup script that could be a simple shell script so in that case you can use the post install hook so these are the two very basic generic use case which I can put it up for like when to use the helm hook well capability of a Helm Hook is not limited to the pre-install or post install if you take a look onto the actual documentation from a Helm chart then you will see there are pre-install hook post install hook pre-delete hook post delete hook and there are pre-upgrade roll back and there is also a test which we are going to take a look so it is quite like a feature Rich feature which is provided by a Helm so you need to be really careful when choosing this hooks like what's the situation and when you need to use this kind of a hooks so I would highly recommend to go through this documentation and check out like which Helm hook suits in your uh like application development or your requirement one more interesting thing about the help Hook is like you can create a normal kubernetes resource and you can use that Resource as hook so here I have taken some few example here is batch you can see here is deployment and here is a service resource these are simple normal kubernetes resources which you can deploy inside your kubernetes cluster so you can create a hook that can be of type kubernetes batch it can be of type kubernetes deployment and it can be of type kubernetes service so during the demo I'm just gonna take One X one of the example of kubernetes resource and create it as a Helm hook all right so let's start with the demo and here on to the screens you can see this is my terminal where I have already installed my kubernetes or where I have already set up my coupon disk cluster as well as I have installed the Helen chart so here I have already created a hello world Helm chart for this particular demo so first of all let's take a look where we create our hook yml inside my health chart so this is the hello world like a Helm chart which I have created I would like to show you the directory structure of this particular hello world Helen chart so here you can see uh this is the hello world directory inside we have a chart.yml and also there is a one more directory which is templates so just pay careful attention over here we need to create a hooks directory inside the template so this is our templates directory and there you will find a one more directory which is Hooks and inside that hook you can create a pre-install.yml I'm just going to show you the pre-install hook for this particular help chart so here you're just gonna place your yml and these ymls can be like a pre-installed post install like a pre-roll back post rollback so these kind of a hook which you can build place inside this particular hooks directory all right so now we know like where to place our hooks inside the templates hooks directory so I'm just going to clear the screen and I'm just gonna show you this particular help chart this is a very basic Helm chart and if I do the cat command onto the values.yml then you can see that I'm just doing a very simple thing over here I just wanted to keep the things simple I just wanted to focus most on to the concept of a hooks that's why I am keeping this like a Helm chart pretty simple over here so I'm just using a very basic nginx image which is by default provided by Helm chart and I'm just gonna run it on a note port on a port 80. so that's the basic health chart I am creating and I'm just telling it as a hello world Hub chart all right so now we know this the next thing I would like to show you is the hooks uh the pre-installed yml which I have created so I'm just gonna clear this screen over here and I'm just gonna run the cat command and I'll just go to Hello World then go to time plus directory then go to hooks directory and then I'm just gonna type the pre-install.yml hook so here you can see as I have told you like you can create any kubernetes Resource as a hook so here this is a batch resource which I will be deploying inside my kubernetes cluster and here these are some metadata like vodka what is the name of my particular hook so this is going to be a pre-installed job hook which I have suffixed and also here you can see The annotation this is a really important over here so here you will see this Helm dot assets dot hook this is just a standard definition but here you need to specify what kind of a hook you want it to be so here I'm specifying it as a pre-install hook and if you are interested in a posts installed then just you need to create a one more yml file and just rename it and make it as a post install hook then after that there are a couple of more properties the important one over here is the hook delete policy so this hook will be created before installation of a Helm chart but after the hook is succeeded then it is going to delete that particular hook also so you have like a pre-install hook whenever you run the help install command then it is going to install that particular hook and after that hook is succeeded then it is going to delete that particular hook also and then the command or then the execution will go and install the help chart because that is a pre-install hook so it will create the hook it will do the do your do its task and after that it is going to install the helm chart but yeah this is a delete policy which you need to keep on to your Helm chart for your particular hook all right so now we have created a hook we have defined the like what kind of a hook it is what's the delete policy on it but what this hook actually doing it so if you now look and pay careful attention over here then this is a very basic shell command I'm trying to do so in the pre-install hook I'm just trying to Echo this particular message and then I'm just gonna sleep for 10 seconds so that's the basic hook I'm just trying to implement so what will happen I'm just going to run the helm install command then this pre-install hook will trigger and this trigger after triggering of this particular hook our terminal will wait for 10 seconds and once the 10 seconds are over then this particular this particular hook will be deleted and then we are just going to install our help chart so this is the very basic example I just wanted to keep to explain what the pre-install hook does all right so now before I install the helm chat I have splitted this screen so that I can show you that when the hook is active and it will wait for 10 second and then after that you will just delete and then it will continue with the helm chart installation so for that I'm just going to run the command what checks Cube CTL get pod because it is going to create one part inside my kubernetes cluster and once that pod is created it is going to wait for 10 seconds and after that it is going to like install my Helm chat as and after that it is also going to delete that particular part because that is a part of our pre-install hook all right so now as you can see over here I have this particular cubes it will get pod command running every two second it is just going to refresh this command every time and it's just gonna show us the update what's happening behind the scene and there was one part previously running which I have just stopped and removed it so now our this sandbox environment is pretty much clean and we don't have anything running over here so what I'm just gonna do I'm just gonna run my or I'm just gonna first install my help chart so the command is Helm instead all my hello release and then the name of my Hello World help chart and I'm just gonna simply hit enter and here you can see uh this is our pre-install as you can see pre-installed job hook and it has just started and it is seven second nine second ten eleven and after that it is just going to uh like a delete that particular pod as you can see our pod has been deleted and that part belongs to our pre-install hook and after that we have just deployed our hello world or we have just installed our hello world help chart so that was a like a very short like a demo or not demo but actually how it works behind the scene our pre-install uh Helm chart hook and now we have seen like our Helm chart pre-install hook worked for 10 second it waited for 10 seconds and after that it has just installed the helm chart and now I would like to uninstall and since it was a pre-installed hook so there will not be any anything changed when I run the helm uninstall command so I'm just going to run the hell install command first of all I'm just gonna list because I need to copy the name so this is the name of my release Helm chart and I'm just gonna clear it and help uninstall my release and it has uninstalled and as you can see the pod which is only for our Helm chart got deleted but there was no hook which came into picture because that was a pre-installed hook not a post install hook so that was a really short uh like explanation and a smart demo a small demo on like how the pre-installed hook Works similarly you can create a post install hook also and you can Define your custom like a shell command or Chrome job setup or a cleanup script whatever you want to perform with your post install hook then you can just configure inside that particular post install yml hook all right so coming back to the topics which we have planned for this particular chapter so we have seen like what is Helm hook and when to use our Helm hook and we have also seen the demo like how we can create our first Helm hook inside our Helm chart now the fourth point is Helm test and how to use your Helm test to validate your Helm chart so that that's the thing which we are gonna see next alright so there is no specific PPT which I have prepared to explain the helm test but consider this Helm test as a unit test for your particular Helm chart so just like any other programming languages you just write a unit test to validate your functionality or the code which you have written so it is just a similar unit test for validating your health chart so onto the screen I would like to show you where is the test yml which just generally created when we create our uh any kind of a help chart so I'm just gonna run the tree command to show you the uh content or the place where our test yml exists so here this is the structure directory structure of my Helm chart so this is a Hello World Main directory and inside you will find a directory templates and inside the template you will find one more directed test which is just parallel to the hooks and inside the test you will find a test connection Dot yml and if you open that uh I would like to I would like to First clear the screen and then I can run the command Cat hello world template test and then test connection dot yml so this is a very basic test which they are trying to perform onto my Helm chart so I can just explain what the test it is so it is just running uh the name of the task test is duplicate and it is running on a BusyBox image and the command which is it is trying to execute is the W cat so wget is just a download command which you can run on any URL so that that's the very basic test it is going to perform on my Helm chart so what we are going to do first of all to run any kind of a test onto your Helm chart what you need to do is you need to install the helm chart first so that you can run the test on top of it so here I'm just gonna clear the screen and I'm just gonna check whether I have installed that particular Helm chart or not so this list is empty that means I have not installed the helm chart this particular list as you can see it is completely empty I'm just gonna clear this screen and I'm just gonna install that Helen chart and I'm just gonna keep my hello release the name of my Helm chart release and then the name of my help chart directory and just hit enter alright so now my chart has been deployed and what we can do we can just verify the URL uh by accessing that particular URL because we are just going to run a w get command on that particular URL so for that I'll just clear the screen over here I'm just going to run the cube CTL get service command so that I know on which Port it is running I'm just gonna hit enter and here you can see this particular my hello release hello world chart which I have just installed is running on a port 31836 all right so this is my virtual machine so I'm just gonna find the virtual machine IP address so what I'm just gonna do host name I and this is uh like a microcode kubernetes cluster but in case if you are running this on like AWS on gcp or Azure then you just need to know this particular uh like a virtual machine or the instance IP address and followed by this particular port number but since it is my virtual machine so this is the iup address like which is a public for me in this system so I will just gonna copy this uh and I'm just gonna head over to my browser paste and I'm just gonna copy the port over here so I'm just gonna copy this one and I'm just gonna paste it and hit enter so here you can see this is the welcome engine XPS of my Hello World hand chart now what we are gonna do in the test we are just gonna access this particular URL and I'm just gonna run the W get command onto it that's what my help test is doing so I'm just gonna switch over to my terminal and I'm just gonna clear the screen and I'm just gonna first list the chart because I will need this particular name which is this one and now I'm just going to run the test command so I'm just gonna do uh helm test and then the your chart name I'm just gonna copy it and paste it over here and here you can see uh the face succeed which means our test has just passed and it has run on our deployed uh help chart so which means we are able to test our Helm chart and that particular Helm chart works perfectly fine so yeah this was a very basic example on how to implement your Helm test you can customize this particular Helm test as per your requirement and as per your project setup and you can create more than one test for your Helm chart so that you can verify that particular Helm chart by running those test later on so with that we conclude our chapter number seven and this is going to be the last chapter for this particular Helm chart series and I hope you have enjoyed all these chapters and if you are jumping on any of the chapters in between like if you had jumped on a chapter number three or four then I would highly recommend to start from a chapter one if some of the concepts are not clear to you because I have covered everything from the scratch I have just started this whole series where I am assuming that you don't have any prior knowledge to the helm chart so I would highly recommend to go from a chapter one if you don't understand any concepts uh inside the help chart series and if you have any question then please put down into the comment section and also you can put down your suggestions like what kind of topics you want to see on to this particular Channel apart from help chart you will also find a similar series on terraform kubernetes ansible hashikov wall so these are the some previous series which I have already covered onto this channel so if you are just getting started with the devops then please go and check those tools and those series those are really useful for you and if you have any suggestions on to the devops topic then please please put down into the comment section I'll try to get back to those topics and in upcoming week you will also see a similar series on to the AWS also which I have been trying I have been planning to prepare for so stay tuned and keep follow this channel I hope you will like the content in upcoming weeks quite a lot so till then take care and bye bye
Info
Channel: Rahul Wagh
Views: 28,105
Rating: undefined out of 5
Keywords: helm chart, helm chart full course, helm cli, helmfile, helm repo, helm hooks, helm test
Id: DQk8HOVlumI
Channel Id: undefined
Length: 128min 3sec (7683 seconds)
Published: Tue Sep 05 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.