1
00:00:00,000 --> 00:00:10,600
Hi, Let us understand how to use GitHub repository as repository for helm. In the earlier lecture we

2
00:00:10,600 --> 00:00:17,666
discussed about how to install Chart Museum and use that as a repository. In this case I'm going to create

3
00:00:17,666 --> 00:00:24,866
a GitHub repository and do the changes so that it can be used as a repository to store the charts.

4
00:00:24,866 --> 00:00:29,999
For that we need to do some prerequisites like creating access token and create a new repository

5
00:00:30,000 --> 00:00:33,200
within GitHub. Let's go ahead and do that.

6
00:00:33,200 --> 00:00:35,566
I'm into my GitHub repository. Here

7
00:00:35,566 --> 00:00:38,499
I'm going to create a new repository.

8
00:00:38,500 --> 00:00:53,700
Let me give a name helm git repo. Let me create the repository.

9
00:00:53,700 --> 00:00:58,833
And its going to give instruction on how to add files to this particular repository using the command

10
00:00:58,833 --> 00:01:03,133
line and installation of command line git, it's very easy.

11
00:01:03,133 --> 00:01:07,833
Depending on the operating system, you can install it and the instruction is very well available over

12
00:01:07,833 --> 00:01:14,833
the Internet. I'm going to follow the same instruction on how to install and the installation instructions will be

13
00:01:14,833 --> 00:01:24,499
added as a part of the lecture. Now next thing I'm going to do is I will be getting into the settings.

14
00:01:24,500 --> 00:01:28,233
And within settings, I get into developer settings.

15
00:01:28,233 --> 00:01:31,533
There, there is an option called personal access token. Here

16
00:01:31,533 --> 00:01:37,033
I can generate a new token which is equivalent to the password so that I don't need to give the actual

17
00:01:37,033 --> 00:01:41,799
password and I can generate new token whenever I want.

18
00:01:41,800 --> 00:01:47,066
Let me give a name and I'm going to give what are all permissions

19
00:01:47,066 --> 00:01:57,199
That particular token will have. I will select all the permissions other than admin access.

20
00:01:57,200 --> 00:02:01,633
Let me go ahead and generate the token.

21
00:02:01,633 --> 00:02:05,833
The token is available and this particular token will be visible only now.

22
00:02:05,833 --> 00:02:11,733
And once we navigate to the other pages, we cannot access this particular token back.

23
00:02:11,733 --> 00:02:14,033
So copy the token. Keep it in a safe location.

24
00:02:14,033 --> 00:02:18,633
And I am going to delete this token after the lecture gets over.

25
00:02:18,633 --> 00:02:26,199
Also, please do make sure not to share this particular token to others because this is equivalent to your password.

26
00:02:26,200 --> 00:02:31,433
With all the available details, let me go ahead and create GitHub repository locally and push it

27
00:02:31,433 --> 00:02:36,866
into the remote. As this particular session is not about Git

28
00:02:36,866 --> 00:02:41,632
I'm not going to get into the details of git commands.

29
00:02:41,633 --> 00:02:44,699
Now, let me get into the demo.

30
00:02:44,700 --> 00:02:52,666
Let me get into the folder that I had created within this, I'm going to create a small readme file

31
00:02:52,666 --> 00:02:56,999
So I'm going to echo helm repo into readme.md file

32
00:02:57,000 --> 00:03:05,500
I'm going to initiate a git repository locally, so empty repository would get created in this specific folder.

33
00:03:05,500 --> 00:03:16,166
And I'm going to add the readme.md file as a part of the local GitHub repository using the command git add readme.md

34
00:03:16,166 --> 00:03:21,366
And if you're doing it for the first time, you have to configure your e-mail and username.

35
00:03:21,366 --> 00:03:25,899
And this needs to be done only once. So I'm  adding the e-mail

36
00:03:25,900 --> 00:03:30,600
Using the command git config --global user dot e-mail

37
00:03:30,600 --> 00:03:36,900
And this is the e-mail address. And I'm going to provide the user name as well.

38
00:03:36,900 --> 00:03:41,133
So I'll provide the user name once this particular information is provided

39
00:03:41,133 --> 00:03:44,299
I will be in a position to commit the code.

40
00:03:44,300 --> 00:03:49,166
Let me go ahead and do the commit using git commit and the commit message

41
00:03:49,166 --> 00:03:52,132
I will make it as first commit.

42
00:03:52,133 --> 00:03:59,266
So once the local repository is committed, I can mention what is the remote repository that needs to

43
00:03:59,266 --> 00:04:02,032
be mapped against this particular local repository.

44
00:04:02,033 --> 00:04:10,433
So I will be adding the remote repository. So one file is committed.

45
00:04:10,433 --> 00:04:16,565
Now I'm going to add the remote repository using the command git remote add

46
00:04:16,565 --> 00:04:24,266
And then I will add the origin as the reference and the GitHub repository link.

47
00:04:24,266 --> 00:04:29,899
So this can be taken from this particular location. I can get into the repositories.

48
00:04:29,900 --> 00:04:37,600
This is the repository. And I can copy the link from this specific location.

49
00:04:37,600 --> 00:04:45,433
So once the remote repository is added, I can add the file that we created that is readme.md

50
00:04:45,433 --> 00:04:50,933
into the remote repository using the command git push -u as the origin

51
00:04:50,933 --> 00:04:54,799
That is the reference and I'm going to create a master branch.

52
00:04:54,800 --> 00:05:03,866
So it's going to ask for the user ID. I'll provide the user ID

53
00:05:03,866 --> 00:05:10,966
And I will provide the access token that we generated as the password.

54
00:05:10,966 --> 00:05:14,899
So it's going to count the object push the objects into the repository.

55
00:05:14,900 --> 00:05:19,833
Now, I should have readme.md into this particular repository.

56
00:05:19,833 --> 00:05:24,133
So I do have readme.md file helm_repo

57
00:05:24,133 --> 00:05:30,999
I'm going to use this particular repository to store the chart packages and when the chart packages is

58
00:05:31,000 --> 00:05:35,133
getting stored along with that I need to store the index file as well.

59
00:05:35,133 --> 00:05:38,433
So we will see how to generate the index file also.

60
00:05:38,433 --> 00:05:47,199
So this particular folder will be used to store the packaged charts as well as the index.yaml file.

61
00:05:47,200 --> 00:05:50,733
Let me go ahead and create a chart.

62
00:05:50,733 --> 00:05:54,366
I'll use the helm create command. I'll create a chart.

63
00:05:54,366 --> 00:06:01,699
The name gitrepotest, so a folder with gitrepotest will get created.

64
00:06:01,700 --> 00:06:05,233
Within that, I am going to have the sample charts, templates everything.

65
00:06:05,233 --> 00:06:06,999
Let me go ahead and modify the charts.yaml file

66
00:06:07,000 --> 00:06:14,400
I'll provide some changes to the description.

67
00:06:14,400 --> 00:06:19,233
I'm going to use this particular chart folder to generate the package.

68
00:06:19,233 --> 00:06:23,533
So where the package would get generated, I can generate over here or directly

69
00:06:23,533 --> 00:06:26,666
I can get into the location where I wanted to have the

70
00:06:26,666 --> 00:06:29,732
repository and generate the package.

71
00:06:29,733 --> 00:06:35,399
So let me give the command helm package and the package path

72
00:06:35,400 --> 00:06:42,533
So this is the chart resources location, and I'm going to give the command helm package and then the folder path

73
00:06:42,533 --> 00:06:47,299
So the chart package will get generated and it's getting stored in this specific location.

74
00:06:47,300 --> 00:06:49,600
That is in the current directory.

75
00:06:49,600 --> 00:06:53,700
Now, I need to add this particular file into the github repository. Before that

76
00:06:53,700 --> 00:06:56,066
I need to generate the index file.

77
00:06:56,066 --> 00:07:02,099
Index file is nothing but it's going to have a collection of the resources for the chart repository

78
00:07:02,100 --> 00:07:04,900
and it's going to have the syntax. As we discussed earlier

79
00:07:04,900 --> 00:07:10,366
It's another yaml file, which is going to have entries on various packages, it's going to check the

80
00:07:10,366 --> 00:07:13,366
folder that we're referring as a part of the index command

81
00:07:13,366 --> 00:07:19,299
And generate all the entries. In this particular folder we do have only one zipped folder.

82
00:07:19,300 --> 00:07:26,000
So one entry will get generated. I can use the command helm repo index dot

83
00:07:26,000 --> 00:07:32,700
That is the current directory. So the index.yaml file would get generated.

84
00:07:32,700 --> 00:07:37,200
you might have a question we did not do that when we're using the Chart Museum.

85
00:07:37,200 --> 00:07:41,666
The reason because Chart Museum automatically generates this index.yaml file

86
00:07:41,666 --> 00:07:46,566
Once we add the zipped content into the storage location.

87
00:07:46,566 --> 00:07:50,066
I can check the content within the index.yaml file

88
00:07:50,066 --> 00:07:55,599
So it's going to have entries on what is that API version, app version and when it was created,

89
00:07:55,600 --> 00:08:01,100
the description about that particular chart like that I can have n number of entries depending on the

90
00:08:01,100 --> 00:08:05,833
number of charts within the folder. Now, I do have these two files.

91
00:08:05,833 --> 00:08:09,099
That is index.yaml file and the chart repository.

92
00:08:09,100 --> 00:08:13,566
I need to add this into the local repository. So I have used the command git add dot

93
00:08:13,566 --> 00:08:19,799
that is all the files within the local directory will be added into the GitHub repository.

94
00:08:19,800 --> 00:08:23,500
I need to commit the added files into the local repository.

95
00:08:23,500 --> 00:08:26,800
So I'll use the command git commit -m

96
00:08:26,800 --> 00:08:30,633
That is the message that I want to add for the commit.

97
00:08:30,633 --> 00:08:35,166
So the two files got changed and they got added into the repository.

98
00:08:35,166 --> 00:08:41,532
Once these files are added into the local repository, I can push it into the remote using the git push,

99
00:08:41,533 --> 00:08:45,966
command git push -u origin

100
00:08:45,966 --> 00:08:53,499
That is to the master. I'll ask for the user ID and let me provide the access token as the password.

101
00:08:53,500 --> 00:08:58,966
It will identify the changes and it's going to push it into the remote repository.

102
00:08:58,966 --> 00:09:05,132
Now I can check the remote repository. So this is what it is.

103
00:09:05,133 --> 00:09:12,066
And one biggest advantage provided by the github is it provides the raw access. Raw access

104
00:09:12,066 --> 00:09:15,099
is in the sense without any web style

105
00:09:15,100 --> 00:09:19,100
I will be in a position to access the file as a text. So this is the link

106
00:09:19,100 --> 00:09:24,933
I will be using it to mention that, this is where the repository is available.

107
00:09:24,933 --> 00:09:27,799
So this is one way of getting this specific link.

108
00:09:27,800 --> 00:09:33,300
I am going to copy this particular link and keep it so that the same link, I will be using it while

109
00:09:33,300 --> 00:09:39,600
adding the repo. So we created a git repository, pushed that into the github

110
00:09:39,600 --> 00:09:47,533
And I do have the raw link from the GitHub repository for the charts that we had added.

111
00:09:47,533 --> 00:09:55,333
And in the next lecture, I'm going to create a new repository by referring to this specific link
and access the charts.

