1
00:00:00,000 --> 00:00:08,566
Hi, Let us understand how to add a chart as a part of the repository.

2
00:00:08,566 --> 00:00:14,499
Already we discussed about how to host our own repository using Chart Museum, using the local storage

3
00:00:14,500 --> 00:00:19,233
and add repository by pointing to the url. Once the repository is ready

4
00:00:19,233 --> 00:00:21,633
I will be in a position to add charts into it.

5
00:00:21,633 --> 00:00:24,799
Let's go ahead and start the Chart Museum.

6
00:00:24,800 --> 00:00:27,033
I have created a folder called Chart Museum.

7
00:00:27,033 --> 00:00:30,833
I'm going to start the chart museum in the port 8080.

8
00:00:30,833 --> 00:00:35,866
And I'm mentioning the storage as local and the directory where it is going to store

9
00:00:35,866 --> 00:00:39,366
The information is within a directory called chart storage.

10
00:00:39,366 --> 00:00:43,366
And that will get created within the current directory.

11
00:00:43,366 --> 00:00:46,466
So this will start listening in port 8080

12
00:00:46,466 --> 00:00:50,366
I can check the same directory.

13
00:00:50,366 --> 00:00:54,399
There shouldn't be any directory once if I start adding the charts into it.

14
00:00:54,400 --> 00:00:58,000
It will create the required directory and get things done.

15
00:00:58,000 --> 00:01:04,266
Now I'm going to add this particular repository as a part of my repolist that I have and in a quick summary

16
00:01:04,266 --> 00:01:07,732
if I have to refresh what we are going to do

17
00:01:07,733 --> 00:01:11,966
I am going to create charts and add that particular chart or push

18
00:01:11,966 --> 00:01:14,199
that particular chart into the repository.

19
00:01:14,200 --> 00:01:18,400
The process of adding and pushing we do that using index.

20
00:01:18,400 --> 00:01:24,666
Now, I'm going to add this particular repo by pointing to this particular repository.

21
00:01:24,666 --> 00:01:33,566
So I'm going to create a repository called mychartmuseumrepo and point to this specific url and the port

22
00:01:33,566 --> 00:01:34,666
The repo will get added

23
00:01:34,666 --> 00:01:41,832
Now I can go ahead and list whether it is available as a part of the list helm repo list.

24
00:01:41,833 --> 00:01:44,733
Yes, it is available.

25
00:01:44,733 --> 00:01:48,233
And there should not by any charts available within that particular repository.

26
00:01:48,233 --> 00:01:54,933
I can search through the repository with the command helm search repo and name of the repo

27
00:01:54,933 --> 00:01:56,866
There are no results found.

28
00:01:56,866 --> 00:02:03,166
Now I'm going to create a new chart and add it as a part of this particular repository, adding it

29
00:02:03,166 --> 00:02:10,166
There are multiple ways I can package it or I can directly mention the chart directory and use push plugin.

30
00:02:10,166 --> 00:02:13,232
So I'm introducing a new terminology plugin as a part of helm

31
00:02:13,233 --> 00:02:14,699
I can have multiple plug ins.

32
00:02:14,700 --> 00:02:20,633
We will have a separate discussion, but I'll quickly demonstrate how to install the plugin and add it

33
00:02:20,633 --> 00:02:23,199
First let us see the easiest option.

34
00:02:23,200 --> 00:02:40,900
Let me create a directory. Let me get into the directory.

35
00:02:40,900 --> 00:02:44,266
Within this, I'm going to create a chart.

36
00:02:44,266 --> 00:02:48,999
I do not have anything. I'm going to create a chart called repo test.

37
00:02:49,000 --> 00:02:55,466
I will use the command helm create repotest so that will create a folder repotest.

38
00:02:55,466 --> 00:03:02,799
And within that, it's going to have sample charts and the configuration about chart.yaml, values.yaml

39
00:03:02,800 --> 00:03:07,933
and as a part of templates I will be having some sample templates.

40
00:03:07,933 --> 00:03:12,366
Let me not worry about these templates.

41
00:03:12,366 --> 00:03:21,266
This is a nginx deployment. Now I'm going to modify the chart.yaml

42
00:03:21,266 --> 00:03:33,532
Let me update the description.

43
00:03:33,533 --> 00:03:39,066
And the content within the chart.yaml will be used by the Chart Museum to maintain what version

44
00:03:39,066 --> 00:03:42,366
it is and what is the description and other informations.

45
00:03:42,366 --> 00:03:53,599
Now, I'm going to use this specific directory and package the charts within it and push it into the repository.

46
00:03:53,600 --> 00:04:00,966
Let me go ahead and create a package out of this repotest, for that I will be using the command package

47
00:04:00,966 --> 00:04:15,366
helm package repotest. It's nothing but it's going to create a zipped content that is a tar file and it's going to append the version

48
00:04:15,366 --> 00:04:21,031
that we had mentioned as a part of charts.yaml file.

49
00:04:21,033 --> 00:04:27,199
Now, I can add this particular chart as a part of the repository using curl or using push command

50
00:04:27,200 --> 00:04:33,866
Now I'm going to use the curl command, curl and I'm going to pass the data as

51
00:04:33,866 --> 00:04:40,632
binary and what file I'm going to pass, that is repotest-0.1.0 the same file that

52
00:04:40,633 --> 00:04:51,099
are available in this particular directory and the location where the Chart Museum repository is running port/api/charts

53
00:04:51,100 --> 00:04:57,766
So it's going to give the response back saved as true.

54
00:04:57,766 --> 00:05:01,932
Now, let's go ahead and check the list of repositories.

55
00:05:01,933 --> 00:05:06,833
So this is the repository that is available locally with this specific name.

56
00:05:06,833 --> 00:05:10,133
The content of the charts will be available within this particular

57
00:05:10,133 --> 00:05:17,166
server. Now I can get into that server location.

58
00:05:17,166 --> 00:05:24,066
And see the chart storage.

59
00:05:24,066 --> 00:05:28,866
The repotest that we had added that would have got added into that particular storage

60
00:05:28,866 --> 00:05:35,799
repository. So the repository is nothing but it's just like a web server hosting the zipped content of the

61
00:05:35,800 --> 00:05:38,466
charts and an index.yaml file.

62
00:05:38,466 --> 00:05:44,099
The index.yaml file will get generated automatically when we are doing the update.

63
00:05:44,100 --> 00:05:48,000
Now I'm going to update all the repositories. So what it will do

64
00:05:48,000 --> 00:05:52,333
It's going to connect all the repositories and check is there any new chart

65
00:05:52,333 --> 00:05:58,633
If it is available, it is going to pull the new version of the chart and keep it within itself.

66
00:05:58,633 --> 00:06:00,899
So this is how things happens.

67
00:06:00,900 --> 00:06:06,966
So I'm going to have n number of charts created add it as a part of the repository.

68
00:06:06,966 --> 00:06:13,499
And in any machine I can go ahead and do add the repo.

69
00:06:13,500 --> 00:06:19,800
So if I add the repo when I am doing the list of repo, it's going to list what is the name of

70
00:06:19,800 --> 00:06:23,500
the repo and in what server it is pointing it to.

71
00:06:23,500 --> 00:06:28,233
So in this case, it's pointing to this particular server running in the port 8080.

72
00:06:28,233 --> 00:06:34,466
If I had added one chart to it, if I had added one chart to it, that particular chart will get refreshed

73
00:06:34,466 --> 00:06:36,299
into this particular list

74
00:06:36,300 --> 00:06:41,700
When I'm doing the update. This is very similar to the APT update or yum update that we do as a part

75
00:06:41,700 --> 00:06:46,100
of the operating system. So before doing the update let me go ahead and search

76
00:06:46,100 --> 00:06:51,966
What are all the charts available locally in this particular repository. There are nothing found.

77
00:06:51,966 --> 00:06:53,732
Now, let me go ahead and do the update.

78
00:06:53,733 --> 00:06:56,199
So it's going to connect to the server and check

79
00:06:56,200 --> 00:06:58,300
Is there any new charts available

80
00:06:58,300 --> 00:07:03,200
And if it is available, it is going to refresh itself and get the new charts.

81
00:07:03,200 --> 00:07:03,966
Now, let me go ahead

82
00:07:03,966 --> 00:07:08,099
And search the repo as a part of the repository that we have mapped.

83
00:07:08,100 --> 00:07:12,900
And I do have the chart name, the description that we had added it is available.

84
00:07:12,900 --> 00:07:15,200
So this should connect all the dots

85
00:07:15,200 --> 00:07:18,666
Let me explain the entire workflow. So what did we do

86
00:07:18,666 --> 00:07:21,399
We created the repository and we created the charts.

87
00:07:21,400 --> 00:07:24,166
We added the chart as a part of the repository.

88
00:07:24,166 --> 00:07:29,132
And once if I add the repo I should be in a position to refresh what are all

89
00:07:29,133 --> 00:07:35,199
the charts available as a part of the repository and keep my local cache up to date.

90
00:07:35,200 --> 00:07:41,833
So the next lecture we will discuss about how to create different versions and add or update the existing

91
00:07:41,833 --> 00:07:47,966
charts within the repository and keep the repo list up to date and see the detailed version list of

92
00:07:47,966 --> 00:07:50,199
charts available within the repository.

