1
00:00:00,000 --> 00:00:10,266
Hi, Let us understand how to install an upgrade a chart into the kubernetes cluster.

2
00:00:10,266 --> 00:00:15,466
Once the chart is created, I can directly deploy the charts into the kubernetes cluster as well as do

3
00:00:15,466 --> 00:00:18,732
the other managements like upgrade and rollback.

4
00:00:18,733 --> 00:00:24,499
And in case, if I wanted more management, I can add the charts as a part of the repository and do

5
00:00:24,500 --> 00:00:26,600
the deployment from the repository or

6
00:00:26,600 --> 00:00:33,800
I can use some CICD tools to pick the charts from the repository and deploy them into the kubernetes cluster.

7
00:00:33,800 --> 00:00:38,266
Already we had seen how to add chart as a part of the repository and deploy them.

8
00:00:38,266 --> 00:00:44,699
Now we are going to concentrate on the lifecycle of the charts within the kubernetes cluster.

9
00:00:44,700 --> 00:00:48,433
That is installation, upgrade and rollback.

10
00:00:48,433 --> 00:00:51,499
First, let's go ahead and create a sample chart.

11
00:00:51,500 --> 00:00:54,300
I am going to create a chart with the name

12
00:00:54,300 --> 00:00:59,400
upgrade-rlbk helm create and name of the chart.

13
00:00:59,400 --> 00:01:01,866
The folder should get created.

14
00:01:01,866 --> 00:01:09,032
If I get into the specific folder, I should have a set of templates, chart.yaml and values.yaml

15
00:01:09,033 --> 00:01:12,966
And within templates, as we discussed earlier, it's going to have some sample

16
00:01:12,966 --> 00:01:15,599
deployments, services, ingress details.

17
00:01:15,600 --> 00:01:20,666
I'm going to deploy it as it is, I'm going to modify the description within the chart.yaml file

18
00:01:20,666 --> 00:01:28,132
I'll add some details to the description.

19
00:01:28,133 --> 00:01:33,399
Now, I do have the chart. Now I'm going to push this chart into the repository.

20
00:01:33,400 --> 00:01:37,333
Let me go ahead and add a repository within chart museum that is running.

21
00:01:37,333 --> 00:01:40,399
Let me go ahead and list the repositories available.

22
00:01:40,400 --> 00:01:42,566
So these are all the repositories available.

23
00:01:42,566 --> 00:01:45,766
Let me go ahead and create a repository.

24
00:01:45,766 --> 00:01:49,599
I'm adding a repo with the name mychartmuseumrepo

25
00:01:49,600 --> 00:01:51,433
Using the repo add command

26
00:01:51,433 --> 00:01:57,299
And point it to the IP address of the machine and the port number. So repo got added.

27
00:01:57,300 --> 00:02:03,966
Let me go ahead and list the repos. So I do have the repo.

28
00:02:03,966 --> 00:02:05,399
Now I can go ahead and search

29
00:02:05,400 --> 00:02:09,500
What are all the charts available within this particular repository with helm

30
00:02:09,500 --> 00:02:16,766
search repo and name of the repo. I did not have any charts.

31
00:02:16,766 --> 00:02:21,532
I'm going to add this specific chart using the push command already

32
00:02:21,533 --> 00:02:27,833
we saw how to use the push plugin. I'm going to use the push plugin and add this specific chart into the

33
00:02:27,833 --> 00:02:35,999
repository. So I'll be using helm push and the folder and the name of the repository.

34
00:02:36,000 --> 00:02:39,566
So it is pushed and I need to update the local cache.

35
00:02:39,566 --> 00:02:45,966
This is little confusing for those who are new to git. This looks very similar to the local git repository

36
00:02:45,966 --> 00:02:48,632
and the remote git repository. Whenever I'm going to do

37
00:02:48,633 --> 00:02:56,499
the push the data going to get added into the remote repository and I need to update my local cache as well.

38
00:02:56,500 --> 00:03:02,600
Otherwise, I will not be in a position to get any repository using the search. Now without doing the

39
00:03:02,600 --> 00:03:07,266
update I am doing the search. So it should not list any charts.

40
00:03:07,266 --> 00:03:10,066
Now I can go ahead and do an update.

41
00:03:10,066 --> 00:03:14,499
So update what it will do it will connect to the server url and the port and check

42
00:03:14,500 --> 00:03:21,333
Is there any new updates available and it's going to pull the details.

43
00:03:21,333 --> 00:03:24,766
So it got an update from this particular repository.

44
00:03:24,766 --> 00:03:26,299
Don't worry about this particular error.

45
00:03:26,300 --> 00:03:29,033
The reason because the access key was removed.

46
00:03:29,033 --> 00:03:31,399
So it's getting the error message, to avoid that

47
00:03:31,400 --> 00:03:36,666
We can go ahead and remove the repository as well. To avoid any future error messages

48
00:03:36,666 --> 00:03:54,466
I'm going to remove that repository helm repo remove name of the repo. It is removed.

49
00:03:54,466 --> 00:04:01,132
So there should not be any elements. Just now, all the available repo got updated.

50
00:04:01,133 --> 00:04:02,433
Now I can go ahead and search

51
00:04:02,433 --> 00:04:08,366
The charts available within the repository helm search repo and name of the repository.

52
00:04:08,366 --> 00:04:10,932
I should have one chart that we added.

53
00:04:10,933 --> 00:04:15,366
So upgrade-rlbk with version 0.10

54
00:04:15,366 --> 00:04:19,899
And the description that we provided, it is available within the chart.

55
00:04:19,899 --> 00:04:25,000
Now I'm going to install this particular chart into the kubernetes cluster.

56
00:04:25,000 --> 00:04:31,666
I do have a kubernetes cluster up and running with one master and three worker machines. I can check

57
00:04:31,666 --> 00:04:38,099
What are all the entities running within it using the command

58
00:04:38,100 --> 00:04:43,466
kubectl get all. There's one service started by kubernetes

59
00:04:43,466 --> 00:04:45,899
Other than that, there is no other service running.

60
00:04:45,900 --> 00:04:47,966
Let me go ahead and do the installation.

61
00:04:47,966 --> 00:04:53,099
I can use the command helm install and name of the installation.

62
00:04:53,100 --> 00:04:59,266
That's a custom name I can provide and the chart and the repo name.

63
00:04:59,266 --> 00:05:05,932
So this is the chart and repo name that directly I'm referring to the repository. So its going to get

64
00:05:05,933 --> 00:05:12,866
the chart and do the installation and give the instruction as we do have within the notes.txt file

65
00:05:12,866 --> 00:05:16,332
Lets not worry about the other details what got deployed.

66
00:05:16,333 --> 00:05:24,799
I can get the details about the entities that got deployed within the kubernetes cluster.

67
00:05:24,800 --> 00:05:29,333
So all required pods, services, deployments, replica sets it got deployed.

68
00:05:29,333 --> 00:05:36,766
I can get the details about the deployments using helm list

69
00:05:36,766 --> 00:05:40,632
So I do have one deployment and the revision is one

70
00:05:40,633 --> 00:05:46,566
And when it got deployed, I do have the details and the status is deployed.

71
00:05:46,566 --> 00:05:53,199
Now, I'm going to make changes to that specific chart. Let me get into the chart folder.

72
00:05:53,200 --> 00:05:58,266
Let me go ahead and update the values file. The replica count

73
00:05:58,266 --> 00:06:03,999
I wanted to make it as two. So what I did

74
00:06:04,000 --> 00:06:09,666
I modified the values file and changed the replica count to two.

75
00:06:09,666 --> 00:06:15,732
So it should deploy two pods.

76
00:06:15,733 --> 00:06:22,433
And I'm going to modify the chart.yaml file because we've made change.

77
00:06:22,433 --> 00:06:28,666
And I'm going to add some description and I'll be making change to the version as well.

78
00:06:28,666 --> 00:06:33,266
So I have made the version as 0.2.0

79
00:06:33,266 --> 00:06:37,732
Now I can go ahead and do the push.

80
00:06:37,733 --> 00:06:42,733
So this particular chart would get pushed into the repository.

81
00:06:42,733 --> 00:06:45,733
I can search what are all the charts available within it.

82
00:06:45,733 --> 00:06:54,266
I need to update the local cache. Let me go ahead and update.

83
00:06:54,266 --> 00:06:58,732
Yes, it got updated. Let me go ahead and search the repository.

84
00:06:58,733 --> 00:07:05,899
I should have the next version that is 0.2, in case if I wanted all the versions that is

85
00:07:05,900 --> 00:07:11,833
available as a part of the chart museum, I can use the option -l, helm search repo -l

86
00:07:11,833 --> 00:07:16,933
And then the name of the repository, it's going to provide all the versions that are available.

87
00:07:16,933 --> 00:07:19,566
The latest version is 0.2

88
00:07:19,566 --> 00:07:25,166
Now I'm going to list what are all the deployments available as a part of the kubernetes

89
00:07:25,166 --> 00:07:32,066
I do have the revision one and let me check the details about the pods.

90
00:07:32,066 --> 00:07:34,832
I do have only one pod that is deployed.

91
00:07:34,833 --> 00:07:42,733
Now, I am going to upgrade this particular deployment using helm upgrade, helm upgrade and name of

92
00:07:42,733 --> 00:07:47,399
the deployment and then the path where I do have the charts.

93
00:07:47,400 --> 00:07:49,766
So it's going to identify only the delta

94
00:07:49,766 --> 00:07:56,499
This is the very important benefit of having helm package manager where it's going to identify what

95
00:07:56,500 --> 00:08:01,433
change or what is the delta between the earlier version and the new version

96
00:08:01,433 --> 00:08:08,333
And it's going to make another revision into the deployment and it'll make only that specific changes

97
00:08:08,333 --> 00:08:14,266
into the deployment and it will not disturb the other entities within the kubernetes cluster.

98
00:08:14,266 --> 00:08:20,599
Now, let me go ahead and get all the entities running as a part of kubernetes.

99
00:08:20,600 --> 00:08:24,766
And it went ahead and deployed two pods.

100
00:08:24,766 --> 00:08:30,466
So I do have two pods as a part of the deployment and both the pods are up and running.

101
00:08:30,466 --> 00:08:35,832
You can realize how easy it is to upgrade the kubernetes entities using the helm.

102
00:08:35,832 --> 00:08:41,899
This is the biggest advantage and I don't need to touch any of the templates or any of the manifest file of kubernetes

103
00:08:41,900 --> 00:08:46,433
All I did was changed only the values file.

104
00:08:46,433 --> 00:08:55,166
So within the charts I updated the values file for two replica counts the same way all the values

105
00:08:55,166 --> 00:08:58,599
that are mentioned as a part of the value files can be configured

106
00:08:58,600 --> 00:09:05,900
And in a quick deployment, I can go ahead and do the upgrade. In case if I wanted to get the entire history

107
00:09:05,900 --> 00:09:11,466
about what all things got deployed as a part of the helm, I can go ahead and use the command helm

108
00:09:11,466 --> 00:09:14,532
history and the name of the helm deployment

109
00:09:14,533 --> 00:09:20,533
So here I do have two revisions and revision one is superseded, revision two is deployed.

110
00:09:20,533 --> 00:09:24,799
The one that is running is revision two. So in a quick summary

111
00:09:24,800 --> 00:09:32,033
We have seen how to install a chart and do the
upgrade and how easy it is using the helm chart.

