WEBVTT

00:00.720 --> 00:02.550
-: There's one last piece of configuration that we have

00:02.550 --> 00:05.010
to set up on our production Kubernetes cluster

00:05.010 --> 00:07.170
before we can actually deploy our application.

00:07.170 --> 00:08.970
If you open up your Code Editor right now,

00:08.970 --> 00:10.590
and find your k8s directory,

00:10.590 --> 00:13.410
you'll recall that we had set up that ingress service.

00:13.410 --> 00:15.030
And the ingress service relied upon

00:15.030 --> 00:17.310
the ingress nginx project

00:17.310 --> 00:20.550
which we had installed into our local mini-cube cluster

00:20.550 --> 00:22.890
through the use of that mini-cube add ons enable

00:22.890 --> 00:24.090
ingress command.

00:24.090 --> 00:25.770
It was specifically that command that allowed us

00:25.770 --> 00:27.840
to use this nginx ingress

00:27.840 --> 00:29.490
into our local cluster.

00:29.490 --> 00:31.350
Now we have to go through a very similar set up

00:31.350 --> 00:34.200
on our production Kubernetes instance as well.

00:34.200 --> 00:37.050
So by default, the cluster that we just created right here

00:37.050 --> 00:41.940
has absolutely no idea of what an nginx ingress is

00:41.940 --> 00:45.150
and we have to install it as a separate service.

00:45.150 --> 00:46.830
Now as a quick reminder,

00:46.830 --> 00:49.140
when we install that ingress we're going to get a couple

00:49.140 --> 00:50.700
of things created for us.

00:50.700 --> 00:52.500
First off, we've got the ingress config,

00:52.500 --> 00:54.690
which is that ingress config file

00:54.690 --> 00:56.910
we've already created inside of our project,

00:56.910 --> 00:58.680
but we have to go through that additional setup

00:58.680 --> 01:00.930
that is gonna create the load balancer service,

01:00.930 --> 01:03.210
map it to a Google Cloud Load Balancer

01:03.210 --> 01:06.210
and then also set up a deployment running the ingress

01:06.210 --> 01:09.300
controller and the actual nginx pod that's gonna

01:09.300 --> 01:10.890
do the real routing.

01:10.890 --> 01:13.260
So this is all some additional setup

01:13.260 --> 01:15.630
or some additional installation process

01:15.630 --> 01:18.750
above and beyond everything that we've already done.

01:18.750 --> 01:20.550
Now to get the setup directions for this,

01:20.550 --> 01:22.980
we can go back to the documentation for the ingress

01:22.980 --> 01:24.570
nginx page.

01:24.570 --> 01:26.700
So the URL for that right here.

01:26.700 --> 01:29.040
Remember, we do not want Kubernetes ingress.

01:29.040 --> 01:31.500
We want ingress nginx.

01:31.500 --> 01:33.840
And so I'm going to copy this URL right here,

01:33.840 --> 01:37.680
github.com/kubernetes/ingress.nginx.

01:37.680 --> 01:40.383
And I'll open that in a new tab inside my browser.

01:42.000 --> 01:43.920
Now at the very top of this github repository

01:43.920 --> 01:45.840
is the home page for this project,

01:45.840 --> 01:47.390
so I'm gonna go there right now

01:48.360 --> 01:50.310
and then at the top of this page is a section

01:50.310 --> 01:51.540
marked as deployment,

01:51.540 --> 01:54.210
which has directions on deploying this project out to

01:54.210 --> 01:56.820
either a local or production environment.

01:56.820 --> 01:58.650
So I'll go to deployment

01:58.650 --> 02:00.690
and then inside of here you'll recall that there's both

02:00.690 --> 02:04.920
the mandatory command and the provider specific commands

02:04.920 --> 02:06.390
on here as well.

02:06.390 --> 02:09.450
So if you wanted to we could use this mandatory command.

02:09.450 --> 02:11.340
But we're gonna do things a little bit differently

02:11.340 --> 02:12.780
this time around.

02:12.780 --> 02:15.330
If you go back up to the top here and look at contents,

02:15.330 --> 02:16.650
you'll notice that down at the bottom,

02:16.650 --> 02:19.560
the very last option is using Helm.

02:19.560 --> 02:22.230
So let's talk about exactly what Helm is.

02:22.230 --> 02:23.940
I'm gonna click on that link.

02:23.940 --> 02:26.220
And it says right here that the controller

02:26.220 --> 02:28.830
can be installed using Helm.

02:28.830 --> 02:30.210
So what's Helm?

02:30.210 --> 02:31.350
Well, really straight forward,

02:31.350 --> 02:33.780
Helm is essentially a program

02:33.780 --> 02:36.240
that we can use to administer third party software

02:36.240 --> 02:38.850
inside of our Kubernetes cluster.

02:38.850 --> 02:40.200
So just as we've been talking about,

02:40.200 --> 02:44.250
yeah we want to get some outside software

02:44.250 --> 02:46.950
into our cluster, like this outside deployment

02:46.950 --> 02:49.020
and the pod that it controls.

02:49.020 --> 02:52.230
We want to install that as a third party system essentially,

02:52.230 --> 02:55.260
and to do so we can either manually run all those apply

02:55.260 --> 02:57.690
commands with all those configs that are mapped

02:57.690 --> 02:59.940
up to them that we just saw inside the official

02:59.940 --> 03:01.560
documentation over here.

03:01.560 --> 03:03.750
So like all these apply commands that we've seen,

03:03.750 --> 03:06.180
but we can also make use of this command line tool

03:06.180 --> 03:07.620
called Helm.

03:07.620 --> 03:09.600
Helm is very commonly used with some of these more

03:09.600 --> 03:11.550
complicated projects where some of the setup

03:11.550 --> 03:13.710
might be a little bit challenging in nature.

03:13.710 --> 03:15.930
Now you might be thinking that there's nothing wrong

03:15.930 --> 03:19.650
whatsoever with using this very simple apply command

03:19.650 --> 03:21.390
right here that we had ran previously,

03:21.390 --> 03:24.540
and using the very simple apply command

03:24.540 --> 03:26.400
with GCE right here,

03:26.400 --> 03:28.290
those look like they're really straightforward,

03:28.290 --> 03:30.600
but in this case we're gonna use Helm instead,

03:30.600 --> 03:32.430
because something that we're gonna do a little bit

03:32.430 --> 03:35.160
later on is going to absolutely, positively

03:35.160 --> 03:36.930
require us to use Helm.

03:36.930 --> 03:39.060
So this is a pretty good opportunity to get this thing

03:39.060 --> 03:41.493
set up and understand exactly how it works.

03:42.450 --> 03:44.610
So to get started, I'm going to navigate to

03:44.610 --> 03:47.403
github.com/helm/helm.

03:51.270 --> 03:52.770
Oops.

03:52.770 --> 03:54.003
Helm, there we go.

03:55.470 --> 03:57.660
And then on this page we're going to go to the official

03:57.660 --> 04:00.090
documentation, the link is right up here at the top.

04:00.090 --> 04:02.040
But do note that there is other information

04:02.040 --> 04:03.450
inside this read me right here

04:03.450 --> 04:05.200
that you might want to be aware of.

04:07.440 --> 04:10.200
Okay so we'll go to helm.sh

04:10.200 --> 04:13.203
and then on the top right-hand side, we'll find get helm.

04:16.320 --> 04:17.910
Oh, I forgot about that.

04:17.910 --> 04:19.680
It just links you back to the github page.

04:19.680 --> 04:20.910
Okay we're gonna try this a different way.

04:20.910 --> 04:23.070
We're gonna go down to the read me

04:23.070 --> 04:26.160
and down here it's gonna talk about install

04:26.160 --> 04:28.770
and we're gonna go to the quick start guide

04:28.770 --> 04:30.153
right there, that's better.

04:31.110 --> 04:32.460
All right that's what we're looking for.

04:32.460 --> 04:34.650
Okay so on this page, we're going to go through

04:34.650 --> 04:36.600
one of these install directions.

04:36.600 --> 04:39.120
Now there's a lot of different ways of installing Helm

04:39.120 --> 04:41.310
because it assumes that you might be running Helm

04:41.310 --> 04:43.200
in production or you might be running it on your

04:43.200 --> 04:44.460
local computer.

04:44.460 --> 04:46.830
So one of the preferred ways that it lists inside of here

04:46.830 --> 04:50.040
to install Helm is it's gonna say, oh yeah,

04:50.040 --> 04:52.050
you should install using Home Brew, which is a tool

04:52.050 --> 04:54.570
for installing software on a MacOS machine.

04:54.570 --> 04:57.210
And clearly we probably do not have access to Home Brew

04:57.210 --> 04:59.490
in our production Kubernetes environment.

04:59.490 --> 05:01.680
So we cannot use this preferred method.

05:01.680 --> 05:03.690
So instead we're going to scroll down a little bit

05:03.690 --> 05:04.863
or maybe a lot,

05:06.210 --> 05:07.810
we're gonna go down, down, down,

05:09.480 --> 05:11.160
so here's the installing Helm section.

05:11.160 --> 05:12.750
You could also get here by clicking the link

05:12.750 --> 05:14.430
on the left-hand side.

05:14.430 --> 05:16.560
And then we'll go a little bit lower here,

05:16.560 --> 05:19.080
a little bit lower, a little bit lower, there we go.

05:19.080 --> 05:21.600
So From Script, this is what we want to do.

05:21.600 --> 05:23.280
If you can't find this section, you can of course

05:23.280 --> 05:26.250
just do a control F and search for

05:26.250 --> 05:27.393
From Script like so.

05:28.440 --> 05:31.170
So to install Helm we're going to copy these three

05:31.170 --> 05:33.960
commands right here and run them inside of our Cloud

05:33.960 --> 05:35.823
Console on Google Cloud.

05:37.050 --> 05:39.600
So I'm gonna take the first command right here,

05:39.600 --> 05:42.003
not the dollar sign, I want just the curl.

05:42.840 --> 05:44.730
I'm gonna copy that.

05:44.730 --> 05:47.673
And I'll paste it over here inside of my Cloud Shell.

05:49.470 --> 05:51.780
That's gonna download that script.

05:51.780 --> 05:53.610
We then need to change the permissions

05:53.610 --> 05:56.550
for the script that we downloaded by running change mod.

05:56.550 --> 05:57.753
So I'll copy that.

05:58.770 --> 06:00.690
We'll run it as well,

06:00.690 --> 06:03.017
and then finally we'll execute the script with

06:03.017 --> 06:05.103
./get_helm.sh.

06:07.770 --> 06:09.450
Okay so that's gonna do a little bit of setup

06:09.450 --> 06:10.980
and then very quickly you'll see,

06:10.980 --> 06:12.450
okay everything's good to go.

06:12.450 --> 06:14.693
So quick break and I'll see you in just a minute.
