Hi, Let us introduce the templating concept. In the earlier lecture we saw how to create the config
map, YAML file and deploy the config map as a part of kubernetes cluster.
So this is what the config map yaml file that we had created. I'm going to use the same config map yaml
file and introduce the templating concept.
Let me get into this particular file and here
As a part of the name, I'm going to introduce the template and for the template derivative to include
within the code, we will be using the double open flower bracket and double closing flower bracket
I'm going to change the name. Here
I'm going to introduce the derivative so that it can get the values either from the values file or
from the built in objects.
Now let me introduce the two ways where
We can get the values for the template.
One is from the values file. Another one
There are some builtin objects which can provide the value. To get started
We are going to understand about the built in objects.
Builtin objects are nothing but every chart
It will be having a list of values which can be retrieved using the builtin objects
Variable name say, for example .release.name will provide the name of the release that we are creating
using that specific chart.
So let me go ahead and use this so that I don't need to create the values file, in the next lecture
We will see how to use the values file.
So within the flower bracket derivative, I will insert this particular value. So the syntax is .release.name, Similar to this
There are n number of builtin objects like namespace, IsUpgrade so we can go ahead and use slowly in
the future lectures we will start using one after the other.
Now let me go ahead and save this particular config file and install this specific template.
So let me install the template helm install and name of the release.
So this is what will be used within the release.name, and it will get substituted when it is creating
that specific config file. The chart got deployed.
Let me go ahead and get the details about the deployment helm ls. So I do have a deployment
the name release name-test
I can get more details about this particular deployment using the command get manifest.
So it's going to provide the manifest file, that is the YAML file that we had used
If you look at the derivative that we had used that got replaced with the release name that we had provided.
So I should have a config file with this specific name
I can check whether that particular config file, existing or not.
kubectl describe config map and the name of this specific config map. Yes, I do have.
So we have successfully used the template derivative for the first time and within the YAML file, we
have used the builtin object to replace within the template derivative.
Let me go into the charts and get more detail about this particular YAML file.
So this is what the template derivative that we had introduced and to fill in the value for this particular
derivative we use the builtin objects.
So in the next lecture, we're going to use the values file and replace this particular template derivative.
So in a quick summary we have seen how to use the template derivative
and what is the syntax of it and how to use the builtin objects.