Hi, Let us understand how to start building our own chart. In the earlier lecture we discussed about how
to create the file structure using the chart create command.
And we created the folder, mychart
So within mychart, we do have these folders
That is charts, templates and a YAML file.
That's going to be the core file, which is going to have the entire description about this particular
chart and values.yaml file. Within templates
file, we have some sample templates.
We went ahead and deleted them.
So there should not be any template within it.
Now, within this, I'm going to create a config map, config map is nothing but an entity within
kubernetes, which is going to hold key value pair
And that will be used by other entities to read the values corresponding to the key.
Let me go ahead and create a sample YAML file.
Within this, I'm going to create the API version, kind, metadata and the data required for this particular
config map. You might be wondering what template and what templatizing we have brought in.
This is a very simple sample.
This is the starting point where I will be creating a config map and in the next lecture I'm going to
introduce how to insert a template language and read the values from the value file.
So don't worry, this is just to get started so that we can deploy this particular chart and check whether
the entire workflow is working fine or not.
So I do have the config map where I do have the key value, myvalue as the key.
And this is the value corresponding to it. Sample config map.
And this will be creating a config map with the name mychart-config map
I can use the kubectl command to create the config map, but I am going to use the chart to deploy
this particular config map into the cluster.
So I updated a YAML file within the templates and the folder that we're using is mychart.
Now I'm going to install this particular mychart with the name helm demo config map
Before that, let me go ahead and list the config maps available.
I can use the kubectl describe command config maps and the name of the config map just to make
sure that particular config map does not exist.
So I'm issuing the command kubectl describe config maps and name of the config map that's going to
get created using the helm install command.
This is to double confirm this particular config map is not existing within the kubernetes cluster.
I do not have this particular config map
Now, I am going to install the chart so the command is helm install and name of the chart.
I'll give it as helm-demo-configmap.
And the folder where I do have the resources required for this particular chart.
I will give the folder name mychart.
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.
Now let's concentrate on how to build this particular chart.
The other details like test suite, revision all this
We will be discussing it later.
Now, let me go ahead and list the entities available as a part of helm ls
So I do have this particular chart deployed and the version that got deployed is one.
Now, let me go ahead and describe the config map.
Yes, I do have a config map that got deployed with the key
myvalue and the value sample config map.
So this is our first successful chart that we had created.
And from here we are going to develop and start introducing the templatizing of this particular YAML file
and start using the values file.
Let me go ahead and uninstall this particular config map and keep the system clean, helm uninstall
and then name of the chart.
So the chart will get uninstalled and all the entities related to this particular chart will also get
removed from the kubernetes cluster.
I can confirm that by describing the config map.
So that is also removed from the kubernetes cluster.
And within helm, I should not have the release related to this particular chart.
So in a quick summary we have seen how to create a chart and update the template folder and install the
chart using the helm install and after installation, how to remove them as well using uninstall.