1
00:00:00,000 --> 00:00:11,066
Hi, Let us understand how to start building our own chart. In the earlier lecture we discussed about how

2
00:00:11,066 --> 00:00:14,566
to create the file structure using the chart create command.

3
00:00:14,566 --> 00:00:17,466
And we created the folder, mychart

4
00:00:17,466 --> 00:00:20,099
So within mychart, we do have these folders

5
00:00:20,100 --> 00:00:23,000
That is charts, templates and a YAML file.

6
00:00:23,000 --> 00:00:27,800
That's going to be the core file, which is going to have the entire description about this particular

7
00:00:27,800 --> 00:00:30,833
chart and values.yaml file. Within templates

8
00:00:30,833 --> 00:00:33,166
file, we have some sample templates.

9
00:00:33,166 --> 00:00:34,999
We went ahead and deleted them.

10
00:00:35,000 --> 00:00:38,200
So there should not be any template within it.

11
00:00:38,200 --> 00:00:43,266
Now, within this, I'm going to create a config map, config map is nothing but an entity within

12
00:00:43,266 --> 00:00:46,732
kubernetes, which is going to hold key value pair

13
00:00:46,733 --> 00:00:51,899
And that will be used by other entities to read the values corresponding to the key.

14
00:00:51,900 --> 00:00:57,200
Let me go ahead and create a sample YAML file.

15
00:00:57,200 --> 00:01:03,266
Within this, I'm going to create the API version, kind, metadata and the data required for this particular

16
00:01:03,266 --> 00:01:08,832
config map. You might be wondering what template and what templatizing we have brought in.

17
00:01:08,833 --> 00:01:11,133
This is a very simple sample.

18
00:01:11,133 --> 00:01:16,233
This is the starting point where I will be creating a config map and in the next lecture I'm going to

19
00:01:16,233 --> 00:01:22,766
introduce how to insert a template language and read the values from the value file.

20
00:01:22,766 --> 00:01:28,999
So don't worry, this is just to get started so that we can deploy this particular chart and check whether

21
00:01:29,000 --> 00:01:32,466
the entire workflow is working fine or not.

22
00:01:32,466 --> 00:01:37,899
So I do have the config map where I do have the key value, myvalue as the key.

23
00:01:37,900 --> 00:01:41,600
And this is the value corresponding to it.
Sample config map.

24
00:01:41,600 --> 00:01:47,166
And this will be creating a config map with the name mychart-config map

25
00:01:47,166 --> 00:01:52,732
I can use the kubectl command to create the config map, but I am going to use the chart to deploy

26
00:01:52,733 --> 00:01:56,099
this particular config map into the cluster.

27
00:01:56,100 --> 00:02:03,166
So I updated a YAML file within the templates and the folder that we're using is mychart.

28
00:02:03,166 --> 00:02:10,066
Now I'm going to install this particular mychart with the name helm demo config map

29
00:02:10,066 --> 00:02:13,966
Before that, let me go ahead and list the config maps available.

30
00:02:13,966 --> 00:02:18,732
I can use the kubectl describe command config maps and the name of the config map just to make

31
00:02:18,733 --> 00:02:21,999
sure that particular config map does not exist.

32
00:02:22,000 --> 00:02:27,333
So I'm issuing the command kubectl describe config maps and name of the config map that's going to

33
00:02:27,333 --> 00:02:30,133
get created using the helm install command.

34
00:02:30,133 --> 00:02:37,066
This is to double confirm this particular config map is not existing within the kubernetes cluster.

35
00:02:37,066 --> 00:02:39,266
I do not have this particular config map

36
00:02:39,266 --> 00:02:48,299
Now, I am going to install the chart so the command is helm install and name of the chart.

37
00:02:48,300 --> 00:02:53,533
I'll give it as helm-demo-configmap.

38
00:02:53,533 --> 00:02:59,266
And the folder where I do have the resources required for this particular chart.

39
00:02:59,266 --> 00:03:02,466
I will give the folder name mychart.

40
00:03:02,466 --> 00:03:10,099
So this is going to create the config map and the status it is saying deployed and the revision that it's deployed is one.

41
00:03:10,100 --> 00:03:13,266
Now let's concentrate on how to build this particular chart.

42
00:03:13,266 --> 00:03:17,032
The other details like test suite, revision all this

43
00:03:17,033 --> 00:03:19,633
We will be discussing it later.

44
00:03:19,633 --> 00:03:25,999
Now, let me go ahead and list the entities available as a part of helm ls

45
00:03:26,000 --> 00:03:31,766
So I do have this particular chart deployed and the version that got deployed is one.

46
00:03:31,766 --> 00:03:37,199
Now, let me go ahead and describe the config map.

47
00:03:37,200 --> 00:03:40,500
Yes, I do have a config map that got deployed with the key

48
00:03:40,500 --> 00:03:44,566
myvalue and the value sample config map.

49
00:03:44,566 --> 00:03:48,099
So this is our first successful chart that we had created.

50
00:03:48,100 --> 00:03:54,000
And from here we are going to develop and start introducing the templatizing of this particular YAML file

51
00:03:54,000 --> 00:03:57,066
and start using the values file.

52
00:03:57,066 --> 00:04:03,032
Let me go ahead and uninstall this particular config map and keep the system clean, helm uninstall

53
00:04:03,033 --> 00:04:05,499
and then name of the chart.

54
00:04:05,500 --> 00:04:10,266
So the chart will get uninstalled and all the entities related to this particular chart will also get

55
00:04:10,266 --> 00:04:12,132
removed from the kubernetes cluster.

56
00:04:12,133 --> 00:04:15,833
I can confirm that by describing the config map.

57
00:04:15,833 --> 00:04:18,599
So that is also removed from the kubernetes cluster.

58
00:04:18,600 --> 00:04:24,100
And within helm, I should not have the release related to this particular chart.

59
00:04:24,100 --> 00:04:29,900
So in a quick summary we have seen how to create a chart and update the template folder and install the

60
00:04:29,900 --> 00:04:36,633
chart using the helm install and after installation, how to remove them as well using uninstall.

