Hi, Let us understand how to add a chart as a part of the repository.
Already we discussed about how to host our own repository using Chart Museum, using the local storage
and add repository by pointing to the url. Once the repository is ready
I will be in a position to add charts into it.
Let's go ahead and start the Chart Museum.
I have created a folder called Chart Museum.
I'm going to start the chart museum in the port 8080.
And I'm mentioning the storage as local and the directory where it is going to store
The information is within a directory called chart storage.
And that will get created within the current directory.
So this will start listening in port 8080
I can check the same directory.
There shouldn't be any directory once if I start adding the charts into it.
It will create the required directory and get things done.
Now I'm going to add this particular repository as a part of my repolist that I have and in a quick summary
if I have to refresh what we are going to do
I am going to create charts and add that particular chart or push
that particular chart into the repository.
The process of adding and pushing we do that using index.
Now, I'm going to add this particular repo by pointing to this particular repository.
So I'm going to create a repository called mychartmuseumrepo and point to this specific url and the port
The repo will get added
Now I can go ahead and list whether it is available as a part of the list helm repo list.
Yes, it is available.
And there should not by any charts available within that particular repository.
I can search through the repository with the command helm search repo and name of the repo
There are no results found.
Now I'm going to create a new chart and add it as a part of this particular repository, adding it
There are multiple ways I can package it or I can directly mention the chart directory and use push plugin.
So I'm introducing a new terminology plugin as a part of helm
I can have multiple plug ins.
We will have a separate discussion, but I'll quickly demonstrate how to install the plugin and add it
First let us see the easiest option.
Let me create a directory. Let me get into the directory.
Within this, I'm going to create a chart.
I do not have anything. I'm going to create a chart called repo test.
I will use the command helm create repotest so that will create a folder repotest.
And within that, it's going to have sample charts and the configuration about chart.yaml, values.yaml
and as a part of templates I will be having some sample templates.
Let me not worry about these templates.
This is a nginx deployment. Now I'm going to modify the chart.yaml
Let me update the description.
And the content within the chart.yaml will be used by the Chart Museum to maintain what version
it is and what is the description and other informations.
Now, I'm going to use this specific directory and package the charts within it and push it into the repository.
Let me go ahead and create a package out of this repotest, for that I will be using the command package
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
that we had mentioned as a part of charts.yaml file.
Now, I can add this particular chart as a part of the repository using curl or using push command
Now I'm going to use the curl command, curl and I'm going to pass the data as
binary and what file I'm going to pass, that is repotest-0.1.0 the same file that
are available in this particular directory and the location where the Chart Museum repository is running port/api/charts
So it's going to give the response back saved as true.
Now, let's go ahead and check the list of repositories.
So this is the repository that is available locally with this specific name.
The content of the charts will be available within this particular
server. Now I can get into that server location.
And see the chart storage.
The repotest that we had added that would have got added into that particular storage
repository. So the repository is nothing but it's just like a web server hosting the zipped content of the
charts and an index.yaml file.
The index.yaml file will get generated automatically when we are doing the update.
Now I'm going to update all the repositories. So what it will do
It's going to connect all the repositories and check is there any new chart
If it is available, it is going to pull the new version of the chart and keep it within itself.
So this is how things happens.
So I'm going to have n number of charts created add it as a part of the repository.
And in any machine I can go ahead and do add the repo.
So if I add the repo when I am doing the list of repo, it's going to list what is the name of
the repo and in what server it is pointing it to.
So in this case, it's pointing to this particular server running in the port 8080.
If I had added one chart to it, if I had added one chart to it, that particular chart will get refreshed
into this particular list
When I'm doing the update. This is very similar to the APT update or yum update that we do as a part
of the operating system. So before doing the update let me go ahead and search
What are all the charts available locally in this particular repository. There are nothing found.
Now, let me go ahead and do the update.
So it's going to connect to the server and check
Is there any new charts available
And if it is available, it is going to refresh itself and get the new charts.
Now, let me go ahead
And search the repo as a part of the repository that we have mapped.
And I do have the chart name, the description that we had added it is available.
So this should connect all the dots
Let me explain the entire workflow. So what did we do
We created the repository and we created the charts.
We added the chart as a part of the repository.
And once if I add the repo I should be in a position to refresh what are all
the charts available as a part of the repository and keep my local cache up to date.
So the next lecture we will discuss about how to create different versions and add or update the existing
charts within the repository and keep the repo list up to date and see the detailed version list of
charts available within the repository.