1
00:00:00,000 --> 00:00:11,866
Hi, Let us introduce the templating concept. In the earlier lecture we saw how to create the config

2
00:00:11,866 --> 00:00:16,799
map, YAML file and deploy the config map as a part of kubernetes cluster.

3
00:00:16,800 --> 00:00:22,800
So this is what the config map yaml file that we had created. I'm going to use the same config map yaml

4
00:00:22,800 --> 00:00:25,933
file and introduce the templating concept.

5
00:00:25,933 --> 00:00:28,866
Let me get into this particular file and here

6
00:00:28,866 --> 00:00:34,799
As a part of the name, I'm going to introduce the template and for the template derivative to include

7
00:00:34,800 --> 00:00:41,400
within the code, we will be using the double open flower bracket and double closing flower bracket

8
00:00:41,400 --> 00:00:43,633
I'm going to change the name. Here

9
00:00:43,633 --> 00:00:49,599
I'm going to introduce the derivative so that it can get the values either from the values file or

10
00:00:49,600 --> 00:00:51,433
from the built in objects.

11
00:00:51,433 --> 00:00:53,699
Now let me introduce the two ways where

12
00:00:53,700 --> 00:00:55,533
We can get the values for the template.

13
00:00:55,533 --> 00:00:58,033
One is from the values file. Another one

14
00:00:58,033 --> 00:01:02,533
There are some builtin objects which can provide the value. To get started

15
00:01:02,533 --> 00:01:05,366
We are going to understand about the built in objects.

16
00:01:05,366 --> 00:01:07,766
Builtin objects are nothing but every chart

17
00:01:07,766 --> 00:01:13,232
It will be having a list of values which can be retrieved using the builtin objects

18
00:01:13,233 --> 00:01:20,433
Variable name say, for example .release.name will provide the name of the release that we are creating

19
00:01:20,433 --> 00:01:22,833
using that specific chart.

20
00:01:22,833 --> 00:01:27,033
So let me go ahead and use this so that I don't need to create the values file, in the next lecture

21
00:01:27,033 --> 00:01:29,799
We will see how to use the values file.

22
00:01:29,800 --> 00:01:39,600
So within the flower bracket derivative, I will insert this particular value. So the syntax is .release.name, Similar to this

23
00:01:39,600 --> 00:01:46,933
There are n number of builtin objects like namespace, IsUpgrade so we can go ahead and use slowly in

24
00:01:46,933 --> 00:01:51,399
the future lectures we will start using one after the other.

25
00:01:51,400 --> 00:02:00,500
Now let me go ahead and save this particular config file and install this specific template.

26
00:02:00,500 --> 00:02:10,100
So let me install the template helm install and name of the release.

27
00:02:10,100 --> 00:02:17,633
So this is what will be used within the release.name, and it will get substituted when it is creating

28
00:02:17,633 --> 00:02:24,799
that specific config file. The chart got deployed.

29
00:02:24,800 --> 00:02:32,666
Let me go ahead and get the details about the deployment helm ls. So I do have a deployment

30
00:02:32,666 --> 00:02:36,299
the name release name-test

31
00:02:36,300 --> 00:02:43,300
I can get more details about this particular deployment using the command get manifest.

32
00:02:43,300 --> 00:02:48,366
So it's going to provide the manifest file, that is the YAML file that we had used

33
00:02:48,366 --> 00:02:55,532
If you look at the derivative that we had used that got replaced with the release name that we had provided.

34
00:02:55,533 --> 00:02:59,399
So I should have a config file with this specific name

35
00:02:59,400 --> 00:03:02,700
I can check whether that particular config file, existing or not.

36
00:03:02,700 --> 00:03:11,666
kubectl describe config map and the name of this specific config map. Yes, I do have.

37
00:03:11,666 --> 00:03:17,099
So we have successfully used the template derivative for the first time and within the YAML file, we

38
00:03:17,100 --> 00:03:23,033
have used the builtin object to replace within the template derivative.

39
00:03:23,033 --> 00:03:32,633
Let me go into the charts and get more detail about this particular YAML file.

40
00:03:32,633 --> 00:03:38,066
So this is what the template derivative that we had introduced and to fill in the value for this particular

41
00:03:38,066 --> 00:03:41,499
derivative we use the builtin objects.

42
00:03:41,500 --> 00:03:47,633
So in the next lecture, we're going to use the values file and replace this particular template derivative.

43
00:03:47,633 --> 00:03:50,866
So in a quick summary we have seen how to use the template derivative

44
00:03:50,866 --> 00:03:54,866
and what is the syntax of it and how to use the builtin objects.

