Hi, Let us understand how to install an upgrade a chart into the kubernetes cluster.
Once the chart is created, I can directly deploy the charts into the kubernetes cluster as well as do
the other managements like upgrade and rollback.
And in case, if I wanted more management, I can add the charts as a part of the repository and do
the deployment from the repository or
I can use some CICD tools to pick the charts from the repository and deploy them into the kubernetes cluster.
Already we had seen how to add chart as a part of the repository and deploy them.
Now we are going to concentrate on the lifecycle of the charts within the kubernetes cluster.
That is installation, upgrade and rollback.
First, let's go ahead and create a sample chart.
I am going to create a chart with the name
upgrade-rlbk helm create and name of the chart.
The folder should get created.
If I get into the specific folder, I should have a set of templates, chart.yaml and values.yaml
And within templates, as we discussed earlier, it's going to have some sample
deployments, services, ingress details.
I'm going to deploy it as it is, I'm going to modify the description within the chart.yaml file
I'll add some details to the description.
Now, I do have the chart. Now I'm going to push this chart into the repository.
Let me go ahead and add a repository within chart museum that is running.
Let me go ahead and list the repositories available.
So these are all the repositories available.
Let me go ahead and create a repository.
I'm adding a repo with the name mychartmuseumrepo
Using the repo add command
And point it to the IP address of the machine and the port number. So repo got added.
Let me go ahead and list the repos. So I do have the repo.
Now I can go ahead and search
What are all the charts available within this particular repository with helm
search repo and name of the repo. I did not have any charts.
I'm going to add this specific chart using the push command already
we saw how to use the push plugin. I'm going to use the push plugin and add this specific chart into the
repository. So I'll be using helm push and the folder and the name of the repository.
So it is pushed and I need to update the local cache.
This is little confusing for those who are new to git. This looks very similar to the local git repository
and the remote git repository. Whenever I'm going to do
the push the data going to get added into the remote repository and I need to update my local cache as well.
Otherwise, I will not be in a position to get any repository using the search. Now without doing the
update I am doing the search. So it should not list any charts.
Now I can go ahead and do an update.
So update what it will do it will connect to the server url and the port and check
Is there any new updates available and it's going to pull the details.
So it got an update from this particular repository.
Don't worry about this particular error.
The reason because the access key was removed.
So it's getting the error message, to avoid that
We can go ahead and remove the repository as well. To avoid any future error messages
I'm going to remove that repository helm repo remove name of the repo. It is removed.
So there should not be any elements. Just now, all the available repo got updated.
Now I can go ahead and search
The charts available within the repository helm search repo and name of the repository.
I should have one chart that we added.
So upgrade-rlbk with version 0.10
And the description that we provided, it is available within the chart.
Now I'm going to install this particular chart into the kubernetes cluster.
I do have a kubernetes cluster up and running with one master and three worker machines. I can check
What are all the entities running within it using the command
kubectl get all. There's one service started by kubernetes
Other than that, there is no other service running.
Let me go ahead and do the installation.
I can use the command helm install and name of the installation.
That's a custom name I can provide and the chart and the repo name.
So this is the chart and repo name that directly I'm referring to the repository. So its going to get
the chart and do the installation and give the instruction as we do have within the notes.txt file
Lets not worry about the other details what got deployed.
I can get the details about the entities that got deployed within the kubernetes cluster.
So all required pods, services, deployments, replica sets it got deployed.
I can get the details about the deployments using helm list
So I do have one deployment and the revision is one
And when it got deployed, I do have the details and the status is deployed.
Now, I'm going to make changes to that specific chart. Let me get into the chart folder.
Let me go ahead and update the values file. The replica count
I wanted to make it as two. So what I did
I modified the values file and changed the replica count to two.
So it should deploy two pods.
And I'm going to modify the chart.yaml file because we've made change.
And I'm going to add some description and I'll be making change to the version as well.
So I have made the version as 0.2.0
Now I can go ahead and do the push.
So this particular chart would get pushed into the repository.
I can search what are all the charts available within it.
I need to update the local cache. Let me go ahead and update.
Yes, it got updated. Let me go ahead and search the repository.
I should have the next version that is 0.2, in case if I wanted all the versions that is
available as a part of the chart museum, I can use the option -l, helm search repo -l
And then the name of the repository, it's going to provide all the versions that are available.
The latest version is 0.2
Now I'm going to list what are all the deployments available as a part of the kubernetes
I do have the revision one and let me check the details about the pods.
I do have only one pod that is deployed.
Now, I am going to upgrade this particular deployment using helm upgrade, helm upgrade and name of
the deployment and then the path where I do have the charts.
So it's going to identify only the delta
This is the very important benefit of having helm package manager where it's going to identify what
change or what is the delta between the earlier version and the new version
And it's going to make another revision into the deployment and it'll make only that specific changes
into the deployment and it will not disturb the other entities within the kubernetes cluster.
Now, let me go ahead and get all the entities running as a part of kubernetes.
And it went ahead and deployed two pods.
So I do have two pods as a part of the deployment and both the pods are up and running.
You can realize how easy it is to upgrade the kubernetes entities using the helm.
This is the biggest advantage and I don't need to touch any of the templates or any of the manifest file of kubernetes
All I did was changed only the values file.
So within the charts I updated the values file for two replica counts the same way all the values
that are mentioned as a part of the value files can be configured
And in a quick deployment, I can go ahead and do the upgrade. In case if I wanted to get the entire history
about what all things got deployed as a part of the helm, I can go ahead and use the command helm
history and the name of the helm deployment
So here I do have two revisions and revision one is superseded, revision two is deployed.
The one that is running is revision two. So in a quick summary
We have seen how to install a chart and do the upgrade and how easy it is using the helm chart.