Single Helm Chart, Multiple environments

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone this is deeshit welcome to my channel in this particular video i am going to discuss about how we can reuse a single helm chart to be deployed across multiple environments so let's say i have an application if i want to deploy that particular application then in the kubernetes cluster i want to create a deployment object and a service object and let's assume you don't have multiple environments you have a single environment in that case you're going to create a single yml file and in that single by ml file you will define deployment and a service and then you will deploy if there is no change across multiple environments let's assume if you want to deploy this particular application across dev environment qa environment product production environment and pre-production environment so if there is no change in the configuration or definition so then you can go ahead and can you reuse that particular single file and then you can deploy it but let's assume when when you want to deploy your application and multiple environments so there is high chances that the configurations will gonna change so configurations as in for example replicas in the lower environments you can have less number of replicas and then you can deploy but when you go for higher environments like qa pre-broad and production you will end up using more replicas because you want to make sure your application is highly available and also not only that let's assume this resources part in the deployment definition this resources you can define less in dev environment but when when like if you want to deploy the same application in production you might need a little more resources you are going to change these values so in that case where in like single yml file you can't use it to deploy it across multiple environments so what you'll be doing is you will create one yml for each environment and in that one viable per environment you are going to define deployment.yml service.viable and then you will deploy it but lets assume two more environments will gonna come and come in uh to picture in that case again you need to create two more manifest files and then you need you need to make sure that all the yml files uh at least the definition should match only the configurations will gonna change and this is a kind of a very bad practice to maintain multiple communities manifest file if there is no change in the definition so that's where we can use a helm chat so what we can do is in help chat all the manifest files we can shift it to the templates directory of the help chat and whichever the value which is changing so then we can create values dot viable and we can shift those uh values whichever is changing per the environment to the value so far so by which we can uh handle this kubernetes manifest files a little better when we are deploying it to the multiple environments by using help chats and if you don't know what is lm chat and if you want to know other advantages of elm chat because this is not only the advantage uh wherein like helmchat provides it has lot many other advantages if you want to know that you can refer my playlist and help chat when i have discussed about um from the basics uh till the advanced level i'll gonna provide that playlist link in the video's description now let's see how we can manage our kubernetes manifest files by using help chat a little better and if you don't go for health charts so what you'll be ending up doing is wearing like per environment so in my case i've created a one yml file so in each vml file so service and deployment is there and also in production one extra object which is hpa and only the changes uh in the deployment and service the number of replicas you can see in the production i have four so let me open the dev yml so i'll open it in the right side and let me click here and open the dev manifest file you can see the only changes replicas and also the resources in the production i wanted a little higher resources so that's the reason you can see one core and two gb of memory i've used in the dev there might not be a lot of load and lot of testing it might not be done in dev so that's the reason i want to use the lower limits and also that's the reason i've given a very less value so now this is a wrong way because let's assume two more environments will come into picture in that case again you need to create two more yml files and if you need to change only these configurations rather than this but in like uh how we can manage these things uh in a better manner in the helm chat so that is what we're gonna see now let's create a help chat so let me execute one command so help create and then whatever the directory name i want to create it with like the folder name that i want to give but in like i can give that so now what will happen is it is going to create the directory uh with the name whatever i've given here i've given ui and with that particular name it has created a directory under that it is going to create the standard files and directories which help chart will have usually charts directory you can see and the templates directory and we will do a little cleanup because i don't need ingress service service i need service account is not not needed wearing like whichever is not needed i will gonna remove that and also we have charts.yml which is which has the meta information about your chart and values.yml which will have all the values which will gonna change i mean depending on the environment in my case so we're gonna see that we were gonna clean up all the things first first thing is i don't need this uh test directory because i won't do any uh i won't use any uh hooks in this case so i'm gonna remove this and also on in the helpers.tmpl also where in life i'll remove whatever things which are there i'm gonna tell you and we will keep this particular file the other thing that i'm gonna delete is notes.txt and uh i don't need ingress as well as service account i'm gonna remove these three files and apart from this i have a deployment hpa and service so i'll also remove whatever is there so i just wanted folder structure so that's the reason i use this particular command and has been created and deployment also i'll remove it and let's save it and also now let's take deployment file from our kubernetes manifest file we will templatize this particular one first let me take into deployment yml and then also service dot wireless so i'm going to take service definition so let me put it into the service.yml and also hpa let me go into the prod and uh let's take this hpa definition and let me put it under hp okay so now we did whatever the manifest files which we want to create for our application has been created under templates directory the next thing that we know we want to do is values not viable also i'll clear it off all the things i'll gonna create my own values.yml and then i'll render my manifest and then we will see we can see that renderation also i'm going to show you uh in a while so first thing is let me open deployment file here and also in the other window when i'm going to open uh my values.weber so let me open values.yml here and first thing is you need to remember like whichever the value which is getting changed so depending on the environment are like uh depending on the application in my case depending on the environment the values will going to change right so those values i should place it under values dot one so that we need to remember first thing is replicas so because that is changing across the environment so that's the reason where in life i will change uh i'll put this value in the value stockpile so for that what i need to do is so first let me define a variable or you can say uh it has a dictionary in the yml format so under this wherein i am going to define replicas as my field replicas and then i'll gonna define one and if you want to refer this value from the values.yml to your health chart so the way you do it is dot values and under that dot values when like app is there under app you have replicas so now whenever i do execute helm install command helm template command so it'll gonna first refer this values.yml and whatever it is gonna search under the values.file this dictionary is there under that replica whatever the value is there right you're gonna try to replace it here and then the next things that you're gonna change you can see that this environment will also change because in the dev environment the value of environment will be there and for qa it will be qa and production it will be brought so this value will also will gonna change let me take this also and let me put it under app so this i will make it as dev and now so the next things and also we will see let's not parameterize let's not refer this value from uh here because one main thing is see this labels section wherein like it is repeated at multiple places you can see at the labels it has been repeated and also at the metadata which is whenever i want to refer the pod in the definition a deployment definition this is also wherein like which has been referred and also in the service yaml also in the selector section and also in like label section that has been repeated so that we will create something called as a named templates and then we will refer it but before that so let us create other values where in like whichever is getting changed right we will try to create it in the values. and then refer it and then let's create a new tip at the next value uh i can see the image will also be changed because across the environment uh in the production and all you will take stable images and you might deployed and in the dev environment and qa environment some unstable code wherein like as and when a little code is added you want to test it so in that case you're going to change the image and you will deploy it so that's the reason this image will gonna change so that's what i'll try to do is so i'll create one more variable our field and i'll go and create the container so this is this issue is because we're in like as in when i type container so it has created you can see the container definition under the deployment file are powerful that is because i have installed few of the extensions so that's the reason my intellisense uh wearing like it has printed that onto the my file so now let's uh i've defined as container so under this i will gonna define image image i will say this image and also if you want to refer this particular one here the way i do it is i need to define dot values and then dot so i should give uppercase v you need to remember this and then after that we're in like i need to type in app dot under that you can see container dot image is what i need to give it so when i type in so we're in like uh you can see that intellisense has recognized that and uh so now whenever i render it this value whatever i have referred in this value will be replaced here and the next thing is compute resources this is also changing across the different requirements so this also i want to put it under values dot one so let's do that so let me save this file first values.windmill and let me remove it from here and also before that let me create one one more field which i'll call it as compute resources compute rc resources and then under this let me put it put these values and let me put it here and also these are the yml files you need to make sure that indentation is proper so let me correct this indentation i have corrected the indentation and now so if you if you want to refer this value but in like this block actually now i don't want to refer key value here so until that like until this point we have referred a key value there you can see replicas and this value will gonna be rendered here but now this block i want to render under resources tag so for that what i need to do is so first before let me uh one thing i will do is i will count the spaces that i want to prefix when i print that particular block so i guess it is around like 10 so let's check it out first let's render it and we will check it out first thing is let me remove it from here and if you want to print a vml block anywhere in kubernetes manifest files in the helm sets i have a function which is called as 2 yml so let's use that particular one so i'm going to use this and 2 y amls to my aml so that is a function that i need to use and here i need to refer that particular compute resource field okay so let me do the way you do it is so you need to do dot values and then under that dot app under that dot app compute resources so this is what you need to call it and also i need to indent it properly because when like whenever it whenever i call 2 ml and this particular block it will gonna print whatever is there under that particular field so in my case this limits and requests will be printed but it won't be indented uh properly prefixed it should be prefixed with some spaces right so that won't happen properly so that's the reason where in life i need to use a function again which is called as n index and this is a pipe symbol uh the output of this particular function will be sent to the next function in the health chart it is same as if you know a pipe symbol in shell scripting it is same as that so now so let me give it as 10 and now so my whatever the values that is it is changing across the environment but in like i have templatized but when like the other thing which is remaining is this labels where in like for this we will create something called as name templates have mentioned right so let us create that so it is very similar to function so when something is repeating when like you can create a function and whenever you require you will call it right so likewise some block is repeating so whenever that is happening you can call that you can define that in underscore helper statement and you can call whenever you need it so let's see how do we do that so to define some function our name templates in the health chart so first thing is you need to do uh define so we have a function called as define so and then you need to give the name of the function so in my case as my helm chart directory name is ui right so let me give ui dot so i'll give labels as the name and then so i'm gonna copy from deployment yml so what is that block i'm gonna copy this and i'll gonna put it under this particular function and also let me remove this uh spaces and also i should end this particular named template so the way i do it is so you can type in n so when you do this so whatever the function that you are defining like by using define so that will gonna end it here so this is the last line of this particular named plate is what i am trying to say and now the next thing is uh what i need to do is how how can i refer this particular one there and also here i i don't want to r code any value so i want to refer it from values dot ym so the way i do it is type in dot values and then dot app and dot i need to specify field that as environment so in my case which is environment enb okay so now so i have defined it here so now let's call it into the deployment. so the way we will call that is we should give so let me calculate how many spaces it should be prefixed with i guess it should be prefixed with four spaces so that's the reason not prefixed it should be suffixed with so let me do one thing so we're in like to call any named templates in the templates directory so then we need to use a function called as include so once we use that includes so then only we can call that particular function so let me uh do that and we should mention this uh minus because if you don't do this so it will gonna print whatever uh that function we will gonna call right it will gonna have one empty line and then after that it will append so i don't want that so that's the reason so so let me create like this first i need to call include okay and so you can see that whenever i type in double quotes it is showing like what all the name templates which are there under helper stacking pl so this is because i have used the extension i have installed extension that is the reason it is auto suggesting and now once this is done so i need to send what are all the objects which i which should this ui.labels function we're going to use because uh in this ui dot labels if you could say i've used some object but in like this this particular values dot dot env is there in the values object so that's where this dot is very important you should definitely send it if you forget this then your help chat will not work and after this i need to use any indent also if i don't use when in like in that case it won't be able to print it it will gonna print it but with the suffix spaces it won't be able to happen so uh yml because in kubernetes manifest file uh indentation plays a very important role so i i'll use n indent and also four because four spaces i want to us suffix it with so that's the reason i am used for so likewise we will gonna change wherever this labels are being used so i'm gonna update it here also here i guess i need eight so let me correct this so i'll put it as 8 and likewise where in in the service dot yml also i need to update this here also 4 is enough so that is fine if i don't give indentation in this right helen chart will going to manage that and one more thing very important thing is hpa is not required for dev environment i need to ignore that so for that in the values dot ml i'm going to introduce one more dictionary i'll gonna say that the dictionary name as hpa and i will say under that one field i'll create enabled and i will say false and this value i should uh depending on this false true when like enabled if it is false i don't want to create its peer if it is true i want to create it so in that case when like let me go to hpa so let me open it in this site and also value stored vm in this set so if condition i need to use and then so i can ignore this first if and then i need to provide the condition in my case i'll do dot values dot hpa dot enabled so if this particular value is not true so then i don't want to create anything and also this if condition we need to end it with this end key the way we will do it is this wherein like when now when i render it so when it like this hp shouldn't be created for this dev environment and also let me rename this values.yml or two values iphone dev because now i want to create multiple values.yml for different environments so that's the reason why like i'll rename it as values i find dev okay now let's render the chart so for that so when like i can use elm template command so when i use elm template command it won't deploy it onto the kubernetes cluster but in like it will gonna render your health charts so that means it will gonna replace whatever the values that you have referred it from the values.yml onto the templates directory so then it will gonna show on the screen so now let me execute helm template and then so let's provide now my values yml is not values.yml it is values iphone one so i need to definitely explicitly call that particular values.yml and then so let's give the location of the health chart and also i should provide the release name so let me provide the release name as dev deployment so i am not using the release name anywhere but it is in the helm tree especially we should provide the release name so now let's generate it and it is getting printed on screen i don't want it let me store it in some of the file so let me put it into dell dot yml file so let's see now whether it has rendered properly or not you can see the service only the thing that we have templatized here is this particular part so which is fine in my case and also you can see that uh this these are the things wherein like i've called it from name to template the indentation is fine and the replica also you can see that i'm calling it from uh values.this is also looking fine and the labels this is also fine container images the only problem here is i have some indentation issues uh in the resources section so let me do that change when i'm like i guess i want to do the changes in the deployment yml i want to add two more spaces so that's the reason when i want to give an indent one so let me again do helm template so now so let me see whether it has created properly you can see now it has been indented properly i am not going to deploy this so we will see uh how it will be indented and then so the same files will be deployed on kubernetes cluster so this video this demo is basically to show how to manage your kubernetes manifest files so when like if it is creating this manifest file so that that means these are the things that it will gonna deploy so now so for dev it is done so now let's do it for qa so i'm gonna copy uh this particular values.yml and then i'll rename it with values hyphen qa and then let me do the changes here in the values i need to do qa here and also let me do replica account change it to two and also image let it be that only and also this one i'll gonna make it little higher one cpu and also let's make this uh as 2gb 2gi and also very like under the request also let me do one and also 2gb and also hpa i don't want to create it so that's why i've made enabled faults the other things it remains the same now what we will do is so now let's create the helm chart by using values hyphen qa dot yml so also i'll store the output in um qa dot yms so now qa dot ml has been created let's check it you can see the labels are fine uh environment is set to qa in the deployment and the service you can see the replicas and also the resources part is also fine so now let's create one values.wireml for prod so let me rename this to prod values hyphen prod.yml prod and under this i'll gonna let me correct it properly the file name which has extra y so let's remove that and under this the replicas were in six i'll define it as six and also the environment will be production prod and then resources i will gonna do it more 4 and also i will say 16 gi and likewise here also i am going to change 4 and 16 and then in production i want to enable it so i can give true and also in the hpi also there are many uh things that we can parameterize we can see maximum replicas when replicas or target cheap utilization so uh this values might change so that's the reason why like we can easily templatize onto the values dot so let me open the values.yml of the prod on the right side so let me open it here i've made it as true so let me define few more fields under the hp 8x3 so i'll gonna say max replicas and i will say it has 10 and let me do min replicas so i'll define this as 4 and also when i will say target utilization cpu so i'll define this value cpu utilization and i will gonna make it this as 50. so whatever is there i'm trying to instead and now let's refer it from values.let's not do it from this particular one so i just want to do it from my values.yml so that's the reason so in that case dot values and then so i can do hp under hda i have max replicas so this is a value it should come here and also likewise let me copy this the same thing and let me put it here and i will do it here them in replicas and also cpu utilization also let me again copy this and put it here and it should be cpu utilization under hp and this value again this we can call it as a named template so let me copy it from [Music] deployment yml let me put it under hpa i'm going to remove this rather than just hard coding it so i can make it as now in indian four so that is fine so now let's templatize that where in like uh we will render it and we will see whether everything is looks fine or not prod so when i do this a broad yml will be created you can see that it is still qa so let me check why it is giving okay so we are supplying the wrong values to whatever so we should supply the different values for one more so per environment i have different values so let me prod okay when i do that you can see that so now uh the labels has been properly changed and also replicas you can see hpa hp has been created because we have set enable to so that's the reason hp has been created and also you can see max and min replicas are uh it is getting it from the value structure let's change this one let's change it to 90 and let's see whether it will gonna render it properly or not you can see that now as soon as i change and template when i execute template uh template commands you can see rendered output as 90 okay so uh so this is how when like whenever there is a configuration change uh depending on the environment so this is the way wherein like you can have different values dot family for each environment and then ah kind of like you can call that particular onto your template stock now this is fine so when in like let's assume i have a config file uh so my application has a config map so which uh basically have some configurations which will change according to environments let's assume let me create one file here so let's say i have one uh by ml file especially so this is the configuration that is that is the configuration that i want to copy on to the my application application whenever kind of my pod will be created so let's let me create some random yml file so now uh year itself so let me create the name of the file as config wireless okay so let's assume this is a file and which has basically let's assume timeout is the timeout and so in the dell it is 10 seconds and in q a so let's assume it should be five seconds okay and also when like in the plot it should be even lesser so that is the ask then also when like we have other parameters like let's say log file let's assume i'm gonna store log files under slash app var and slash log dot txt so let's assume this is where logs will be printed and also we have database details also in the config file so database under this ip is there okay and also let's say ip is 10.20.30.20 okay and again like uh name database name that also which has and also let's let's assume for your development uh environment so ui dell is the uh db name that we need to use and for qa we need to use ui qa and we're in like for production the ui production it'll be and also this ip also will gonna change and this time out will also gonna change so in this case when like i can't when it like uh place this data under config map directly and i can't use it so let's say for example if i want to copy any configuration file onto the kubernetes pod so in that case we're in like i will gonna create the config map and then i'll gonna refer it in my deployment variable as a volume mount i will be able to copy the config file from the local onto the port but here the problem is per environment for each environment these values will gonna change for dev it is 10 seconds so we're in like uh in the higher environment production wherein like it will be two seconds so then how do we tackle this particular because values that is fine wherein we had different different values.yml and then we could able to manage it but these configurations will gonna change so how do we kind of like manage this particular one so these things also we can manage it uh through value stored vmware let's do one thing so let me go to my any one of the configuration or like values dot wireless so let me let us open that config files are like values file under right side so here so let me open this del first so let me create one more dictionary here let's say i will say config okay under that config so what i will say is name of the config file okay i will say config dot yml i will say data data and then i will give this whatever the config environment this data is there right i'm gonna provide it under this data and also i need to render it properly as how it is in the config file i will render it properly so now uh so we need to create one more manifest file under the templates directory because i want this config file to be copied onto the deployment so that's the reason where in like i should use the configmap object in that case so i'm just giving the file name as config variable so that's fine and also let me create the config map here so for that like i can so this is a config map i have referred it from one of my other manifest file so let's change the things when like first metadata so let let's make ui a react ui react ui uh so i'll also name it as configmap i will say config and it should be hyphen not is equals to are not allowed in the name of the objects and also labels i don't want to use this i want to use the name template in that case so what should i do is i will go to deployment yml and let's take this particular one and put it under configm so i'll gonna do this and it should be indented for so that is totally fine and also now data so this is where i want to get the file name so when i want to get the file name here so i have referred in the dev if you could see i've defined the file name also here so let me refer it from that dot values.values.i i need to define config so app is not required so in like i need to define uh config dot under that con config i have data so before that data so this is a file name right so that's where i can use the name and so this is where i want to print the data but here it is there in the values.one yml only when like i don't want to refer it from any other external file so i want to refer it from values.yml only in that case what i can do is 2 ml i can refer it like dot values and dot under that config i have and data dot data when i do this so wearing like uh it will gonna print it will gonna take whatever is under the data it is gonna print it here and also i need to indent it properly so that's where i can use n indent and it should be indented four four uh spaces should be uh suffixed sorry it's not suffix it should be prefixed so that's where i'm just giving four so now let's see let's render it first and then let's see so first we will gonna do dev only so you can see that values.yml whatever i am using it here it is there and here also i've defined this config and everything in the dev values let's see what will be the output of the rendered command you can see that config map and there is one new line has been added but that's fine you can see other thing other things like it has been indented properly and whatever is there in the value start variable i could able to refer here so if i want to remove this empty line so in the config yml i can add a minus here so that like when like it will go now because whenever it prints right so empty space is created because of these uh curly braces so that's the reason when i give minus empty line will be removed you can see now that has been removed so now this is fine but in like i did it for dev environment so now let's do the same thing for production and also when type qa so let me go for production and add it here also so here config bam will let it be the same as this is a production so timeout i want to keep it very minimal two seconds and the log file will be the same but for dv ip it might change so in production ip definitely gonna change 120 let's say 21.31 and then like uh this value will also let's assume it will be broad okay now let's render it first so i'm going to use broadwaymill and the output will go to broadband now this should have four objects one is config map you can see that production and whatever the ip that we have given that is that itself it is giving and also timeout is also two seconds so now we are able to kind of manage this config file also per environment and you can see service has been created and also likewise deployment as well as you can see hpe has been also created so let's implement this for qa also let's copy the values.ml so here also so let's do that particular one so let me make it as five seconds and uh so the ip let it be same and also i'll keep it as qa so this is just for renderation how if we have any yml file where in like uh per environment it will gonna change so in that case how do we render or how do we manage config map i just wanted to show that so that's the reason where in like i'm introducing this dictionary extra dictionary and i am calling in the kubernetes manifest files you can do now or you can see now i am just putting qa into broadband so let's see in the prod only so what would have been happen you can see that hp is not created but configmap with the qa values now uh we uh we come to know that like how do we refer if the yml config if there is a config file uh which is in a yml format we can easily call let's assume like non vml file so which is not a yml file but where in like there is an xml file or a json file let's assume there is an xml file so that i want to refer it in my port where like as a config map i want to copy it onto the part so here i am not referring it i am not using mount or something so as i mentioned earlier so like we are learning how to template not to uh the importance here is to templatize it not to deploy it onto the kubernetes cluster so when like now uh one file was the config map when uh this was the yml format so that's where i could able to define it in values.ml and then i could able to bring it onto my configmap but right now let's assume like there is a scenario wherein like the configuration file is not yml file it is a xml file so and also that xml file file also we're going to change it according to the environment so in that case how do we uh handle it uh let's assume these are the uh this is the config xml that i want to copy it on to my port upon the creation so if i want to do that so definitely i need to use the configmap so this is the xml file not the yml file so in this case how do we handle this particular one in the helen chart so that also we will see so for this very like we need to go for other strategy uh so for this what i'll be doing is there there might be a lot of ways but what i will be doing is first let's create a config directory i will gonna create the config directory so under this config directory what i will try to do is uh i will gonna create three directories one is for qa dev and production so now you can see that i have created a directories like dell broad and qa and also i have copied the config xml and why we are going with the strategies as i've already mentioned we're in like this xml also has a change so each and every environment you can see in the dev where like i have delay only and also deny is set to zero so in the production where in like i have dna and hello so this is a configuration you don't need to worry about what this configurations are but so here i just want to show you when like per environment per each environment where in like the configuration this config.xml is also changed so depending on the environment so when we need to under this config map also so and this is also where in like this is xml file not the wiring file that also we should keep in mind so now i have defined three uh directories under the conflict so which is their prod under each directory i have different different conflict xml so now let me go to templates and let me create one more config viable uh so let me copy this only so copy and also put it under templates only and also i'll rename this particular one with the config by my iphone xml okay and also i'll remove the space yeah so iphone xml i will say and also the name will be react ui i will say xml okay and here the main thing is this labels will stays uh same and the values.config name will definitely will gonna change because let me close this all the things but in like let me open your the dev values. so i will gonna do one more thing so when like i will say config config.xml and under that i will say name of the file so the name of the file will be i will say app.xml that app.xml should uh is the file name so that it should print here so in that case what i should do is config file xml i should provide it here and then the name i want to provide it here so the name is fine so that is fine so now main thing is now what i need to do here is depending on this value stored value so depending on this values.yml whatever i supply when i run the command so depending on that so if i run if i provide values dev yml in that case what it should do is it should read it should go to dev directory and it should read this config xml so if you want to do that what i want to do is i want to change the logic here first thing is i will identify the location first i will do that and then i will take the content our data which is there in that particular config moment first thing is let me create one variable so if you want to create a variable in the health chart so this is a format so dollar let me first identify the path path i will define a variable named path and what i will do here is in the helm chart so there is a directory which is config under that so when like i will expect some parameter to be printf this is a function i'm trying to define like let me define it first so printf printf is uh is the function and also for this printer printf where in like i am supplying one of string here okay very like you can see that config slash uh percentage v and slash i am defining config environment so in my case uh it's not a config variable it should be config xml config xml because this is a file name right so when like i'll tell you what is this v will be replaced with so then after that so there is a environment variable which is in my case very like this particular one right so there and also for qa it is qa and for production it is broad so what i what i mean i'm i made sure is whatever the environment name is the right depending on that only i have created a folder c for dev so this environment name and this uh config under the config directory there is a directory called as dev so that name is same and also likewise if i open qa production if you see prod so for products i've created one so if you see qa so for qa also i've created one so that's why i will gonna supply that particular value dot values and dot where in like i need to refer this particular value which is e and b okay when i do that what happens is whenever my helm executes it comes to this line right it'll execute this printf config and percentage v when i use this right whatever the value that i'm supplying as a second parameter so it's gonna take the actual value of this particular whatever the thing that i've referred you so it's gonna take the actual value which is in my case when i supply values iphone dev dot ml it will be the value will be dev so that will be replaced with percentage so now so once this is done now i know the file name i know the path where my file is now the next thing is i need to print it so if i want to print it there is a object called as dot files so whatever the things which are not part of like templates directory which will be there under dot files object and let me uh type in dot and also you can see there is a function under this particular object which is called as get the location of the file in my case it will be dollar path and also wherein like it should be indented and indeed four is what algorithm because whatever this particular object which which is gonna print right so it should be indented four times so that is what i'm gonna try to do it now okay so likewise whatever the changes that i made uh here wherein i should also do it in the qa as well as in the productions and very important things are you need to make sure that whatever the environment that you are supplying it here this value and the folder name here whatever you have created it should match because that is the logic here so i am referring this particular value so depending on whatever the value that i will gonna give so this path variable will be set and then that only will be predicted so now let's execute it one by one first i will gonna go with dev so you can see that uh there are some unclosed yeah so one issue is when i am not closed printf function so let me do that again and let me execute it you can see that without any uh issues my health chat has been rendered properly and so when i go up so it is not able to print it so why let me check it out why it is the issue let me go to the config map uh one uh issue is when like dot values it should be dot app and the enb because under the app only i have a emd so that's the reason so it was failing so i've corrected it so now let's render it so when i go to dev yml so now you should be able to see that xml okay you can see that so whatever we have given to dev so in my case when i go to dev directory config ml you can see that so let me open that rendered file right left side so which is dmr you can see that without any issues and if you want to remove the spaces we know that we're in like you need to give iphone in after that curly braces so then it will be removed so likewise we will render the qv and the production also let's see prod first we will do it so let me go to broad wire and you can see that now in this uh dna analog so let me open the prod here you can see that dna and although one also the value so it will gonna work fine for qa also actually this is what i wanted to show in this video but in like how do we manage the configurations and also config files if it is a yml file if it is a non-violent file as we can easily manage it with the helm charts so this is what i wanted to show if you liked the video please like share and subscribe thank you have a good day you
Info
Channel: Deekshith SN
Views: 26,251
Rating: undefined out of 5
Keywords: kubernetes, helm charts, devops
Id: ZvG8rfJ4XxM
Channel Id: undefined
Length: 44min 55sec (2695 seconds)
Published: Wed Mar 09 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.