Helm Chart Deployment to Azure Kubernetes Service AKS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to our video helmet chart deployment to azure kubernetes service eks in this video we will see a complete tutorial about helmet chart and how to use helm to help you deploy and configure application for azure kubernetes services so we will get an overview about film helmet charts why to use helm how to use helm and many others so first we will get understand what is the helmet chart i thought it spitter to start with helmet chart instead of a start with what is held because once we understand the helmet chart and then describing helm it will make more sense after that we will understand what is him and the definition of hell and then we will understand why to use him and after that we will understand how does helm work so we will understand the process in version 2 and version 3 and what is the difference between helm version 2 and version 3 the major change in between version 2 and version 3 and how to use it and then get some examples of helm commands or switches like for example create which generate the helm charts or template and then install which install the application on kubernetes and then repo add which is add a community repo for the helm and then searching for searching a pre-configured helmet charts and then we will go for the demo in the demo first we will start by configuring the prerequisite which is first install azure cli and then install windows package management chocolaty this will be used to install the helm so i can install helmcli as a client on my machine and then provision azure container registry or acr on azure and then provision azure kubernetes service or aks on azure and then git clone for assemble application node.js application from github on a microsoft sample application and then building a docker image for the node.js and push that image to the acr or azure container registry and then generate the helmet chart using the helm command and then updates this chart with my values that including where is my image and where is my azure container registry and so on and after that execute the helmet charts to send that to the azure kubernetes service to deploy my application to the kubernetes but first let me give you a quick introduction about myself my name is mohammed radwan i'm a developer technologies mvp and principal devops consultant i have been doing software development for more than 17 years now worked on several projects for different enterprise customers across different regions and countries i heavily participated in the community developed several frameworks presented many sessions holding various certificates for azure and devops i started back in 2002 as a classic asb developer relocated multiple times in multiple countries worked with several technologies and for different roles and positions and for the last eight years i moved to consultancy-based role where i focused more on helping different companies some of them from the fortune 500 to improve their software development and delivery using devops and automation i have developed and authored several frameworks command line tools and guides you can find them on github and azure devops marketplace i have presented many sessions in several user group conferences events and customer side as well in different countries so i got the chance and the opportunity to work in different culture project size and company size as well which helped me to have different experience i like to share my experience this is why i have a youtube channel and blog where they have hundreds of videos and posts that share different topics from my real experience here some links for my activities what is helmet chart helmet chart this is just like a bunch of files we can say that it is a package of file that will be used to deploy application to kubernetes so it's just a bunch of files that has all the information to deploy the application to kubernetes so it consists of the first is the chart the cml and this including the metadata for the chart including for example what is the version of this chart like you know because again it's a package management so you know you have different version every time you deploy your application to kubernetes you know it's just incrementing the version and the chart here including the version of the application you are going to deploy to the kubernetes so the chart is the metadata for the complete chart or the application and then the values the values here this is just including the values for the template the main idea of helmet chart is just punch of template that i can inject the values in this template on the runtime and the values the tml file is the file where i put the values to be injected in the templates and then we have the directory or the folder which called templates and inside this templates i have the deployment yaml this is a normal deployment that we use to deploy deployment or services to the kubernetes but in this case we don't have the value directly in the file we just have a variable and this variable will has the value inside the values.tml in the chart i have also the services yaml i have help bars which include some predefined functions where i can use to concatenate some values and so on i can even create my own functions inside this helper in the helmet charts which will be recognized by helm tool so it can interpreter my function or the built-in function to change that values so this is a helmet chart as we now understand the helmet short let's understand what is hell so helm is a tool that use package management to enable creating installing and managing application inside kubernetes much easier configurable and repeatable this is the main idea so it's just a tool with the package management configuration that help me to make managing kubernetes application is much easier configurable and repeatable so why to use hell just imagine you know again by using helm it mean that i can search for pre-configured or pre-packaged which is we call charts let's say for example i want to deploy an application with mongodb node.js so i can search for any help repo for a similar charts and then just download this chart just to change some of the values and then use it so pre-package charts and then i can find them also i can easily create my own package which is bunch of files and then using these files i can store them on the package management again you know storing them maybe in get or any repository where i can redistribute them deploy the application to kubernetes so it is the same idea i can search for pre-package or i can create my own package also i can install packages into coupons cluster this is the main functionality of helm to use the packages to install application to kubernetes cluster also i can query cluster to see what package are installed and running you know for example if i want to see what is the version of my chart that installed on the kubernetes now so i can query that let's say for example it's version 2 or version 3 version 4. so it's very easy to query to understand what is the current version of my package on the kubernetes also i can delete roll back this is one of the very important feature of helm which means i can roll back to a previous version let's say for example that i deploy a chart version 2 and then it has some error and then i need to roll back to version one so this history is stored on the helm so i can roll back to version one and this is the main idea of having helm is the easy of roll back to a previous version so help me make it easy to run application inside kubernetes this is the main idea of using hell so let's see how does helm work so if i start with helm version 2 because there is major change between version 2 and version 3. with helmet version 2 we have the client cli that we installed on our client machine and then we have the server which is tiller on the kubernetes side and then here i have the helmet chart either on my client machine or maybe on a remote repository and then i will start send the request with this helmet chart to the server or the tiller and this server will start executing this chart to create the deployment the service the pods etc of the kubernetes so it will just interpret the charts and inject the values in the chart file into the deployment yaml and so on so it will be executed in the runtime to be understand by kubernetes so it can create the deployment and services pods and so on so this is inversion two in version three what is the mean different there is some concern about security and how tiller is having really huge security concerns about the ability to create many things this is why in helm version 3 they remove taylor and instead the using the kubernetes apis for the same capabilities so it still can store the the previous deployment and so you can roll back and so on and this is the mean different or the measure a change between version 2 and version 3. some example of helm commands we have the create switch or command with helm which will generate the charge or the template for me where i can just changing that with my own values i can also use install switch which will send the requests to the helm server or the kubernetes apis in the version 3 for example so it can create the charts execute the charts and create what inside the charts which is the application the deployments the services the pods and so on repo ad if i want to add a repo to my home so for example let's say i add a repo one in the community and then i can search this repo for a pre-configured charts where i can just search and then download and then just changing that to the way that is you know suitable for me search where i can search the added ripple and and there is many other commands so let's go for the demo so first let's navigate to the command line and open it in elevated mode as an administrator so if we type easy which is azure cli or command line interface we can see that we don't have azure cli so the first step is to install azure cli and in order to do that i will just open the url that i can download azure c live for windows now download and then just accept and install once this completed now it's completed just close this minimize and if i type easy of course it will not work because it's not loaded so i just need to open a new window let's close the old one and type easy so now we can see azure cli is installed let's now install helm but to install helm i just need to install chocolaty first and chocolaty is a package management for windows so if i type choco we can see it is not installed and in order to install that i just need to open chocolaty website and just copy this command here in the cmd just now it's completed if i type choco we can see now it's installed then i can install helm if i type helm we can see that it's not installed so if i type choco install kupernetes helm this will install helm client put a for all and then just give now if i type helm we can see that now helm is installed okay so now i have all the prerequisite installed so let's close that and this is my azure subscription i just have two resource group then i'm going to create a new resource group okay so here i will start by typing first login so i can log in from the command line so i can have enough permission i can close this windows and now as we can see i'm logging the first command is to create a resource group and i will name my resource group is eks resource group and the location is uk south here again just refresh to show you here i don't have this resource group then just type enter now if i refresh fresh again now i have my resource group and it is an empty resource group so the next step is to just create azure container registry so here i will specify which resource group i want to create and then the name of the azure container registry and the sq which is basic in our case and then just type enter now it's created just get back to my resource group just to refresh wait for sometimes and refresh now it's created as we can see if i navigate to the repositories we can see it's empty it doesn't include any images then let's navigate back to our resource group and the next step is to start create azure kubernetes services or aks and in this command i will just give my resource group which is aks resource group rg and the name of my azure kubernetes services which in this case my aks the location which will be yuki south and i will attach the acr this attachment switch will make sure to get the permission between the aks and azure container registry or acr and then here to generate ssh key which will be used to this authentication just hit enter now the service principle created and it will start creating the aks now it's completed let's get back here and refresh of course it will take some times and here my ak is created so let's navigate back to the command line if i type cubic tail which is the command line tool for work with kubernetes we can see it is not installed so in order to install that i will use easy eks install cli which will install the cubic till for azure cli so now it's installed so i just need to take this pause of course this is an azure version of cubic tail and then here i just go for the environment variable and in the path just edit and add a new value with the current pass of cubic tilde so let's navigate to this pause so you we can see the tool so as we can see this is the cubic tail now it's okay and again if i type cubic till yes it's not recognized because this is an old window let's open a new one and if i type cubic till we can see now it's installed so what i'm going to do now is to get the permission for cubic till to communicate with the aks to use cubic till to run a command that can access the eks or azure kubernetes service i need to get the permission from cubic till to the aks and in order to do that i will use this command line which will get the credentials for this is the name of the resource group and the name of my azure cubernator services and git credentials command so this will generate the credentials and store that credentials in this pause so let's navigate to see that so if i copy that and let's navigate to this location we don't need the config this is the file so we can see this is a config file and if i open that we can see here i have here the name of my aks which is the azure kubernetes service and here also i have the client certificates which will be used to authenticate from the command line to the azure kubernetes services on azure okay let's close that so now i can run command from cubic till to my aks now let's use a sample application that we can deploy to the aks using helm so in order to do that i will navigate to a github sample application that created by microsoft and if we go navigate to the node gs here with front end this is a sample application i will use so in order i just need to use git to clone that but first i need to check that git installed on my machine and as we can see it is not installed so i will use choco or chocolaty to install git and just type choco install git so this will install git on my local machine just confirm all and now adjust type git of course it's not loaded let's open a new window and type git so as we can see git is installed so let's now clone the repo that i showed you before so get clone the url of the repo now the ribbon is cloned and let's navigate to the application i showed you which is the web front end node.js and here in the getting start and with front end just to navigate to the location of the app and if i just copy that here to see the cloned repo on my machine we can see that just here yes so inside web front end so now i will just create a new file to make a docker file and inside that i will type this command which will pull the last node image from a docker hub and then copy my web front end this sample application to this image and copy the json file and then run node package management installed copy everything and expose port 80. so and just save this as a docker file without any extension docker file just close that and i don't need tickets i just need the docker file let's review that to make sure the code is exist yes just to close that so now i have my docker file and then the next step is to just navigate let's navigate to the azure container registry to repost trees as we can see it's empty so the next step is to just create or build an image from the docker file and push this image to azure container registry so in order to do that i will just type this command which will build the image and the name will be web front end version 1 and this is the registry or azure container registry and this is the docker file so this will build this image and push the image to the azure container registry it will take some times of course i speed up all the process now it's completed if i navigate back here refresh we can see now that i have the image now if i get back here to just run cubic till git pods because we don't deploy any bots yet we don't have anything then this will show me that no resource is found for the default name space there is no pods created yet in my azure kubernetes services okay so now i'm going to navigate here this is the place the directory and i will start to create a helmet chart in order to do that i will use helm create with front end so create will just create a templates or a chart for me using helmet charts so once i run this command just look as you can see this directory created including all the file of helmet chart so for example i can go for the templates which include all the templates this is a deployment yaml including all the variables so i can just use it as it is or just modify it and here this is the ingress yaml all of these generated from the create command this is the service yaml so this is just as a template as we can see and the most important file is the chart and the values so let's open the chart so we will change the version of course with every change i made to the helmet chart and values i should increment the version in that chart file so for example here because this is the first one so i will just version that as version one and use semantic version by the way and then here i will go for the values edit that so what i'm going to change here this is the place where i have my image or my docker image so i will here just get the address of my azure container registry this is the address login server and forward by the name of the image which is with front end and then instead of cluster ip in the service i will choose to be load balancer now i will just save these values so now i'm ready to run helm install so what i'm going to do now is just run cubic till get service watch before run helm install so i can see what i have in my aks so if i run now we can see that i just have cube native cluster ib and this is the internal ib and now if i run helm install with front end and with front end this is the name of the chart and using the chart template after i change all the changes install command of helm will just run the charts and the values in the charts to start pushing and creating the pods and the services the deployment and push the image to the azure kubernetes services so just hit enter and let's go for watch again so we can see if i watch now we can see now i have the low balancer and it is bending this is the front end and now it has an ip external ip but it will take a little bit to push that let's open a new window and if i just type here cubic till git pods so we can see the actual pods we can see now i have one pod which is whip front end and it's running but still not ready yet so just wait to be ready and also while this let's close this one open a new command line in innovative mode as well and now i'm going to browse to the kubernetes dashboard but in order to do that i just need to give the permission to the cluster user and in order to do that i will just delete the cluster binding let's delete it first to get the pods it's ready now as we can see and then just here i will delete the cluster binding now it's deleted and start creating again with as we can see here this is the user cluster user which is this is the user i will use to open the dashboard of kubernetes in some cases it will just show you that the user already exists if this is the case you just delete it again two times this time yes deleted and deleted again and then create the role binding now it's created doesn't give me the error as user already exists and now let's browse to the dashboard of the kubernetes this will open a proxy tunnel now ask me for authentication i will use the config file that i created when i get credentials which create the config file on my machine so i will use the config remember this step and then sign in here so once i sign i can see the pods the deployments the replicaset and all the component of the kubernetes let's navigate back here to the aks so we can see here this is the public or the external ib so if i copy that let's got here so as we can see it must be ready so navigate that to here in a new tab we can see now the application which is assembled node.js application is loaded successfully on running on aks or azure kubernetes service and if i click on this button and just say that at the end i would like to thank you for watching the video please if you have any question or comment don't hesitate to reach out you can find more information on my plug which will appear at the end of the video along with some other related video thank you [Music] you
Info
Channel: Mohamed Radwan - DevOps
Views: 10,293
Rating: undefined out of 5
Keywords: Kubernetes, Docker, Azure Kubernetes Service, Kubernetes Cluster, Azure Container Registry, Helm, Helm Chart, AKS
Id: wuHpqRJMh6Y
Channel Id: undefined
Length: 31min 12sec (1872 seconds)
Published: Mon Aug 03 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.