WEBVTT

00:00.110 --> 00:00.530
I'll come back.

00:00.530 --> 00:07.010
Everybody, in the last lesson, you saw how we can combine many application resources and combine them

00:07.010 --> 00:13.670
into a single deployable unit that can be very easily installed, uninstalled or upgraded.

00:14.330 --> 00:22.820
Well, helm goes beyond that because online there are many, many, uh, repositories that contain helm

00:22.820 --> 00:25.670
charts for Elasticsearch.

00:26.060 --> 00:31.410
Uh, MongoDB, MySQL, Prometheus PostgreSQL.

00:31.530 --> 00:34.800
Some of these applications being really, really hard to deploy.

00:34.800 --> 00:41.700
They have so many Kubernetes resources, and manually deploying them one by one would be very tedious,

00:41.700 --> 00:44.460
very error prone, and very hard to manage.

00:44.580 --> 00:51.180
But they all have these helm charts that combine all of the resources into a single unit that can be

00:51.180 --> 00:53.820
very easily installed on our cluster.

00:54.120 --> 01:01.530
In this section, we're going to look at how we can install MongoDB using helm, as opposed to setting

01:01.530 --> 01:03.990
up all of the resources ourselves.

01:03.990 --> 01:04.680
Okay.

01:05.520 --> 01:10.650
And the MongoDB installation using helm is actually going to be a lot more sophisticated and is going

01:10.650 --> 01:15.750
to provide a lot more features that would otherwise require a lot of effort to set up ourselves.

01:15.750 --> 01:19.050
So a little preview of what's to come.

01:19.050 --> 01:25.560
We're still going to be using helm, uh, for the purposes of packaging up our grade submission API

01:25.560 --> 01:27.120
and portal applications.

01:27.120 --> 01:32.130
But, uh, what we need to do is start setting up for section 12.

01:32.400 --> 01:33.030
Okay.

01:33.030 --> 01:37.860
We need to upgrade the helm chart for the grade submission API.

01:38.670 --> 01:44.380
So copy over everything we had in section 11 over to section 12.

01:46.300 --> 01:50.950
And before we cut to the chase, let's play around with some helm commands.

01:50.950 --> 01:51.850
Get you more familiar?

01:51.850 --> 01:53.440
I think that's a bit too zoomed in.

01:53.920 --> 02:04.450
What we can do to list all of the helm releases in our cluster is, say, Helm list dash a okay, and

02:04.450 --> 02:11.630
I've got two helm charts, a great submission API and a great submission to helm releases, both deployed

02:11.630 --> 02:16.010
in the default namespace based on the following chart.

02:16.010 --> 02:25.040
Okay, now, although they've been deployed in the default namespace, their corresponding templates,

02:25.040 --> 02:28.040
they've all been deployed in the great submission namespace.

02:28.040 --> 02:35.530
So the contents of the helm package, they all get released inside of the great submission namespace.

02:35.530 --> 02:39.580
If I say kubectl get pods n great submission there.

02:39.580 --> 02:46.540
They're kubectl and get pod get deployment dash n great submission.

02:47.800 --> 02:49.030
They're all in the great submission namespace.

02:49.030 --> 02:54.530
So all although the helm releases are in the default namespace, all of the application resources that

02:54.530 --> 02:57.920
it's managing get released and great submission.

02:57.920 --> 03:07.730
However, it's good practice to keep everything great submission related enclosed in the great submission

03:07.730 --> 03:08.660
namespace.

03:08.660 --> 03:11.990
There is no reason to have these in the default namespace.

03:12.020 --> 03:17.900
Okay, so what we can do is uninstall the current helm releases.

03:17.910 --> 03:23.100
Helm uninstall creates a mission API version.

03:24.570 --> 03:27.330
I think we can just say greater mission API.

03:33.030 --> 03:36.000
Because this follows that.

03:36.000 --> 03:37.560
Sorry about that guys.

03:38.520 --> 03:41.460
The release name I called Great Submission API.

03:41.490 --> 03:45.440
I remember now how uninstalled great submission portal.

03:46.340 --> 03:46.730
All right.

03:46.730 --> 03:48.020
And what we want to do.

03:48.140 --> 03:53.060
I'm going to CD out of MongoDB CD into great submission API.

03:56.270 --> 04:00.860
Um, just to stay on the side of caution, repackage everything.

04:00.860 --> 04:03.230
Helm package dot.

04:03.410 --> 04:10.500
And now what I want to do is deploy this helm release create submission API that is based on the Great

04:10.500 --> 04:13.500
Submission API version one of our helm chart.

04:14.520 --> 04:16.260
I'm going to deploy that in the namespace.

04:16.260 --> 04:17.400
Great submission.

04:17.430 --> 04:25.170
Nothing should really change because our resources will still get deployed in the same namespace as

04:25.170 --> 04:25.530
before.

04:25.530 --> 04:29.880
But now the helm chart is also in the same namespace, which is ideal.

04:31.150 --> 04:34.060
Then I'll say helm install.

04:34.960 --> 04:37.150
Oh no CD submission API.

04:39.250 --> 04:40.120
Uh CD integrate.

04:40.120 --> 04:41.530
Submission portal.

04:41.800 --> 04:42.460
Helm.

04:42.460 --> 04:43.300
Install.

04:43.300 --> 04:43.780
Grade.

04:43.780 --> 04:45.310
Submission portal.

04:46.240 --> 04:51.520
Based on grade submission portal.

04:51.520 --> 04:51.910
Helm.

04:51.910 --> 04:53.050
Charts.

04:53.080 --> 04:53.950
Okay.

04:55.020 --> 04:56.640
this one right over here.

04:58.620 --> 05:02.190
Hey, we've released the contents of our package.

05:02.310 --> 05:03.840
I made the same mistake.

05:12.990 --> 05:15.330
Remember, we want to deploy the helm chart.

05:16.800 --> 05:18.840
We want to deploy the helm release.

05:19.930 --> 05:22.750
inside of the namespace grid submission.

05:24.370 --> 05:33.190
Okay, now if I say Helm list dash a, here we see a list of all the helm releases, all of them inside

05:33.190 --> 05:34.420
of great submission.

05:34.480 --> 05:35.260
All right.

05:35.260 --> 05:36.070
Beautiful.

05:36.070 --> 05:38.920
So that's another command that you learned.

05:39.310 --> 05:47.300
You're going to learn another one called Helm Upgrade because now what I want to do is CD out of section

05:47.300 --> 05:47.990
11.

05:50.510 --> 05:54.320
And CD into section 12.

05:59.690 --> 06:00.590
All right.

06:01.430 --> 06:06.500
So in the great submission API up there is me.

06:07.290 --> 06:12.150
If I show you the updated code, where is it?

06:12.420 --> 06:13.440
Right over here.

06:14.220 --> 06:21.750
I updated the Great Submission API application to only accept one environment variable the entire MongoDB

06:21.780 --> 06:22.560
URI.

06:22.800 --> 06:27.990
The container doesn't provide this application with this environment variable, then it's just going

06:27.990 --> 06:31.050
to default to using some local host URI.

06:31.080 --> 06:32.430
That doesn't work.

06:32.850 --> 06:37.980
So accordingly we need to change some things around in our helm chart.

06:37.980 --> 06:44.880
So this I packaged up into an image called stateless v4.

06:44.880 --> 06:51.000
I believe this should be the final update of our grade submission API.

06:51.030 --> 06:56.790
So the first thing we got to do is change from v3 to v4.

06:57.210 --> 06:57.870
Okay.

06:58.260 --> 07:01.290
We don't need a config map anymore.

07:01.320 --> 07:10.080
That provides a MongoDB host and port because now the now the host, the port, the username and password,

07:10.080 --> 07:13.140
they're all going to get combined into a single URI.

07:13.140 --> 07:15.270
And that's going to exist inside of the secret.

07:15.270 --> 07:17.310
So we can delete the config map.

07:19.050 --> 07:19.740
Okay.

07:19.750 --> 07:21.730
And now for the secret.

07:21.790 --> 07:29.500
Instead of the data object which expects everything to be base64 encoded, we're going to say string

07:29.500 --> 07:30.160
data.

07:32.080 --> 07:33.130
All right.

07:33.250 --> 07:36.460
And that's going to expect a MongoDB URI.

07:36.490 --> 07:40.480
So everything here Kubernetes will expect to be in plain text.

07:40.720 --> 07:51.900
And we're going to get a value from the values file called MongoDB URI, not base64 encoded plain text.

07:53.700 --> 07:54.390
All right.

07:54.510 --> 08:00.060
Going over here, uh, these are not needed anymore.

08:01.560 --> 08:08.780
The only secret we're going to provide to the great submission API secret, or the only thing we're

08:08.780 --> 08:11.690
going to provide the secret is the MongoDB URI.

08:12.950 --> 08:16.700
And for now we'll just give a default URI.

08:17.870 --> 08:22.550
Let's localhost 27017 okay.

08:23.210 --> 08:29.900
It's not going to work because we're going to be setting up MongoDB officially in the next section.

08:29.900 --> 08:33.210
But as long as we prepare for the next section, that's all I care about.

08:34.170 --> 08:41.310
And now what I want to do is upgrade the grade submission API release based on this new helm chart.

08:41.730 --> 08:43.050
So here's what I can do.

08:43.050 --> 08:49.200
I'm going to make this version two because I didn't necessarily add a new feature.

08:49.200 --> 08:52.080
I just had some things up.

08:52.080 --> 08:56.580
So 1.0.2 is the new version of this helm chart.

08:56.580 --> 08:59.350
And now what I want to do is upgrade the helm release.

08:59.350 --> 09:02.080
So when I package up this new helm chart.

09:05.890 --> 09:08.350
Chart dot YAML is missing.

09:08.440 --> 09:09.610
Oh sorry about that.

09:09.610 --> 09:12.040
Need to be inside of gray submission API.

09:12.610 --> 09:13.990
Try this again.

09:14.590 --> 09:15.160
All right.

09:15.190 --> 09:19.450
Now we've got great submission API 1.0.2.

09:19.990 --> 09:23.210
Uh, based on our updated helm chart.

09:23.840 --> 09:30.140
I can release the contents of this helm package or sorry, I can upgrade the existing release.

09:30.140 --> 09:34.070
So remember, the existing release is great submission API.

09:37.310 --> 09:47.170
I can upgrade the great submission API helm release to be based on the upgraded helm chart version 1.0.2,

09:47.230 --> 09:51.940
and we want to refer to the helm release that's inside of the grade submission namespace.

09:53.200 --> 09:53.830
Okay.

09:56.050 --> 10:02.200
Upgrade it now in the interest of helming around.

10:02.200 --> 10:07.540
Hahaha, what we can do is actually delete the helm package.

10:07.540 --> 10:11.330
I like having the helm package as an extra step.

10:11.570 --> 10:15.920
So let's just say I added another patch to my templates.

10:16.400 --> 10:17.390
Um, I can update.

10:17.960 --> 10:25.880
I can update this to be version 1.0.3 and I can say Helm Upgrade Grade submission API.

10:26.060 --> 10:35.850
I can update the grade submission API release based on the contents of the helm chart inside of the

10:35.850 --> 10:37.260
Great Submission API folder.

10:37.260 --> 10:39.180
So it's going to recognize templates.

10:39.180 --> 10:43.020
It's going to recognize charts YAML, it's going to recognize Values.yaml.

10:43.020 --> 10:49.740
It will implicitly package everything up into a helm package and create a great submission API release.

10:49.740 --> 10:52.380
So we don't need to do that step ourselves.

10:52.380 --> 10:54.750
It can automatically be done for us.

10:54.750 --> 11:00.670
So all we're doing is we're saying look inside of the current directory, see this helm chart, create

11:00.670 --> 11:01.390
a package.

11:01.390 --> 11:06.070
Release the contents of that package under the Helm Release Grade Submission API.

11:06.070 --> 11:10.360
And we want to upgrade the helm release inside of the grade submission namespace.

11:11.530 --> 11:12.070
All right.

11:12.070 --> 11:12.850
Same thing.

11:12.850 --> 11:17.050
Just different ways of accomplishing the same results.

11:17.050 --> 11:21.800
And so version 1.0.3 let's assume it doesn't work.

11:21.800 --> 11:24.890
And we want to go back to a previous revision.

11:24.890 --> 11:27.110
What I can do is roll back.

11:27.350 --> 11:30.680
So I can say helm roll back.

11:31.400 --> 11:34.100
The helm release is great submission API.

11:34.100 --> 11:37.520
And I want to roll back to revision two.

11:38.510 --> 11:39.950
So I can just say two.

11:42.890 --> 11:43.610
Sorry about that.

11:43.610 --> 11:44.990
Dash n great submission.

11:44.990 --> 11:48.190
Remember the helm release is now in the great submission namespace.

11:49.360 --> 11:50.650
Rollback was a success.

11:50.680 --> 11:51.940
Happy helming.

11:51.970 --> 11:54.850
Now I'm going to say helm list dash a.

11:56.530 --> 11:57.880
Alrighty.

11:58.270 --> 12:01.300
I'm going to put this back to 1.0.2.

12:01.300 --> 12:03.700
Only because we didn't add another patch.

12:03.700 --> 12:05.380
We stopped at this version.

12:05.800 --> 12:13.100
Now the great Submission API, its pods shouldn't be ready because they're going to be trying to connect

12:13.100 --> 12:16.880
to MongoDB using this URI.

12:16.910 --> 12:17.810
They're not going to be.

12:17.990 --> 12:19.520
They're not going to be able to.

12:20.990 --> 12:21.440
Okay.

12:21.440 --> 12:22.070
Beautiful.

12:22.070 --> 12:23.750
That's all I wanted.

12:23.780 --> 12:26.900
Create container config error.

12:27.500 --> 12:29.300
That's a bit strange.

12:30.050 --> 12:32.240
Uh kubectl

12:33.750 --> 12:35.070
Describe.

12:35.670 --> 12:37.440
Describe this pod.

12:37.860 --> 12:39.780
Dash n grade submission.

12:41.790 --> 12:42.600
Error config.

12:42.600 --> 12:44.580
Map grade submission API config.

12:44.580 --> 12:45.210
Not found.

12:45.210 --> 12:48.120
Oh, something else I forgot to change.

12:49.500 --> 12:52.140
So config map ref.

12:54.210 --> 12:55.260
We don't need anymore.

12:55.260 --> 13:00.620
We only need to reference a secret All right, you know what?

13:00.890 --> 13:04.040
How about we use that as an excuse to go up to version three?

13:04.790 --> 13:07.550
We'll say helm upgrade.

13:07.760 --> 13:10.880
We'll upgrade the grade submission API release.

13:11.480 --> 13:15.980
And remember, what's beautiful about helm is we don't need to manage these pods individually.

13:15.980 --> 13:19.340
We can manage the entire unit at once.

13:19.340 --> 13:19.970
Upgraded.

13:19.970 --> 13:26.580
Install it, uninstall it as we see fit, upgrade everything based on the existing helm chart and the

13:26.580 --> 13:27.930
current directory.

13:28.110 --> 13:30.330
Dash n grade submission.

13:32.670 --> 13:34.110
All right, we're on revision five.

13:34.110 --> 13:38.820
So I was expecting the grade submission API readiness to not work.

13:38.820 --> 13:40.740
I just wasn't expecting this error.

13:40.740 --> 13:48.010
But that's only because I forgot to remove the config map reference that doesn't exist.

13:49.450 --> 13:52.090
Kubectl get pods n grade submission.

13:52.120 --> 13:53.560
Alright, beautiful.

13:53.560 --> 13:56.410
The containers should be running with the grade submission.

13:56.410 --> 14:00.250
APIs should be having a hard time trying to connect to MongoDB.

14:00.250 --> 14:02.020
That's exactly what I want.

14:02.230 --> 14:08.140
Cube CTL logs, dash, f dash and grade submission retrying.

14:08.140 --> 14:09.250
That's okay.

14:09.280 --> 14:17.400
Now what I want to do is I'm going to delete all the application resources for MongoDB because we're

14:17.400 --> 14:26.220
going to be deploying redeploying MongoDB with many more additional features using helm in another video.

14:26.250 --> 14:26.730
Okay.

14:26.730 --> 14:36.460
So kubectl delete we'll delete the secret MongoDB secret dash n grade submission.

14:38.170 --> 14:41.830
Um, there's another easy delete secret.

14:41.830 --> 14:42.910
Sorry, guys.

14:45.610 --> 14:47.170
Um, okay.

14:47.170 --> 14:49.030
Delete service.

14:52.540 --> 14:58.360
Again, another reason to use helm is instead of managing resources one by one, we have a very simple

14:58.360 --> 14:59.810
MongoDB DB deployment.

14:59.810 --> 15:05.480
But if we were to really inject many, many features into it, then we'd have many more resources and

15:05.480 --> 15:08.330
managing them all manually would be a nightmare.

15:08.360 --> 15:13.160
That's why helm was really a game changer in the Kubernetes world.

15:13.160 --> 15:22.730
Okay, so just like how JavaScript has NPM, how Python has Hip or Anaconda, Kubernetes has its own

15:22.730 --> 15:30.300
package manager helm, that we can very easily use to deploy really complex projects as singular, easily

15:30.300 --> 15:31.500
manageable units.

15:31.500 --> 15:38.160
Okay, so we'll delete the MongoDB service.

15:40.500 --> 15:45.420
And we'll delete the MongoDB Statefulset that what it's called?

15:45.930 --> 15:46.890
Just running ODB.

15:50.690 --> 15:53.510
Okay, so MongoDB is officially gone.

15:54.530 --> 15:56.870
Kubectl get pods dash n.

15:56.870 --> 16:04.760
This is the exact setup we want to have before we move on to the next lesson or the next section, if

16:04.760 --> 16:05.330
you will.

16:05.600 --> 16:07.310
Hope you enjoyed this video.

16:07.340 --> 16:11.480
Hope you had fun helming around with me and I'll see you in the next one.
