Hi, Let us understand how to use GitHub repository as repository for helm. In the earlier lecture we
discussed about how to install Chart Museum and use that as a repository. In this case I'm going to create
a GitHub repository and do the changes so that it can be used as a repository to store the charts.
For that we need to do some prerequisites like creating access token and create a new repository
within GitHub. Let's go ahead and do that.
I'm into my GitHub repository. Here
I'm going to create a new repository.
Let me give a name helm git repo. Let me create the repository.
And its going to give instruction on how to add files to this particular repository using the command
line and installation of command line git, it's very easy.
Depending on the operating system, you can install it and the instruction is very well available over
the Internet. I'm going to follow the same instruction on how to install and the installation instructions will be
added as a part of the lecture. Now next thing I'm going to do is I will be getting into the settings.
And within settings, I get into developer settings.
There, there is an option called personal access token. Here
I can generate a new token which is equivalent to the password so that I don't need to give the actual
password and I can generate new token whenever I want.
Let me give a name and I'm going to give what are all permissions
That particular token will have. I will select all the permissions other than admin access.
Let me go ahead and generate the token.
The token is available and this particular token will be visible only now.
And once we navigate to the other pages, we cannot access this particular token back.
So copy the token. Keep it in a safe location.
And I am going to delete this token after the lecture gets over.
Also, please do make sure not to share this particular token to others because this is equivalent to your password.
With all the available details, let me go ahead and create GitHub repository locally and push it
into the remote. As this particular session is not about Git
I'm not going to get into the details of git commands.
Now, let me get into the demo.
Let me get into the folder that I had created within this, I'm going to create a small readme file
So I'm going to echo helm repo into readme.md file
I'm going to initiate a git repository locally, so empty repository would get created in this specific folder.
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
And if you're doing it for the first time, you have to configure your e-mail and username.
And this needs to be done only once. So I'm adding the e-mail
Using the command git config --global user dot e-mail
And this is the e-mail address. And I'm going to provide the user name as well.
So I'll provide the user name once this particular information is provided
I will be in a position to commit the code.
Let me go ahead and do the commit using git commit and the commit message
I will make it as first commit.
So once the local repository is committed, I can mention what is the remote repository that needs to
be mapped against this particular local repository.
So I will be adding the remote repository. So one file is committed.
Now I'm going to add the remote repository using the command git remote add
And then I will add the origin as the reference and the GitHub repository link.
So this can be taken from this particular location. I can get into the repositories.
This is the repository. And I can copy the link from this specific location.
So once the remote repository is added, I can add the file that we created that is readme.md
into the remote repository using the command git push -u as the origin
That is the reference and I'm going to create a master branch.
So it's going to ask for the user ID. I'll provide the user ID
And I will provide the access token that we generated as the password.
So it's going to count the object push the objects into the repository.
Now, I should have readme.md into this particular repository.
So I do have readme.md file helm_repo
I'm going to use this particular repository to store the chart packages and when the chart packages is
getting stored along with that I need to store the index file as well.
So we will see how to generate the index file also.
So this particular folder will be used to store the packaged charts as well as the index.yaml file.
Let me go ahead and create a chart.
I'll use the helm create command. I'll create a chart.
The name gitrepotest, so a folder with gitrepotest will get created.
Within that, I am going to have the sample charts, templates everything.
Let me go ahead and modify the charts.yaml file
I'll provide some changes to the description.
I'm going to use this particular chart folder to generate the package.
So where the package would get generated, I can generate over here or directly
I can get into the location where I wanted to have the
repository and generate the package.
So let me give the command helm package and the package path
So this is the chart resources location, and I'm going to give the command helm package and then the folder path
So the chart package will get generated and it's getting stored in this specific location.
That is in the current directory.
Now, I need to add this particular file into the github repository. Before that
I need to generate the index file.
Index file is nothing but it's going to have a collection of the resources for the chart repository
and it's going to have the syntax. As we discussed earlier
It's another yaml file, which is going to have entries on various packages, it's going to check the
folder that we're referring as a part of the index command
And generate all the entries. In this particular folder we do have only one zipped folder.
So one entry will get generated. I can use the command helm repo index dot
That is the current directory. So the index.yaml file would get generated.
you might have a question we did not do that when we're using the Chart Museum.
The reason because Chart Museum automatically generates this index.yaml file
Once we add the zipped content into the storage location.
I can check the content within the index.yaml file
So it's going to have entries on what is that API version, app version and when it was created,
the description about that particular chart like that I can have n number of entries depending on the
number of charts within the folder. Now, I do have these two files.
That is index.yaml file and the chart repository.
I need to add this into the local repository. So I have used the command git add dot
that is all the files within the local directory will be added into the GitHub repository.
I need to commit the added files into the local repository.
So I'll use the command git commit -m
That is the message that I want to add for the commit.
So the two files got changed and they got added into the repository.
Once these files are added into the local repository, I can push it into the remote using the git push,
command git push -u origin
That is to the master. I'll ask for the user ID and let me provide the access token as the password.
It will identify the changes and it's going to push it into the remote repository.
Now I can check the remote repository. So this is what it is.
And one biggest advantage provided by the github is it provides the raw access. Raw access
is in the sense without any web style
I will be in a position to access the file as a text. So this is the link
I will be using it to mention that, this is where the repository is available.
So this is one way of getting this specific link.
I am going to copy this particular link and keep it so that the same link, I will be using it while
adding the repo. So we created a git repository, pushed that into the github
And I do have the raw link from the GitHub repository for the charts that we had added.
And in the next lecture, I'm going to create a new repository by referring to this specific link and access the charts.