WEBVTT

00:00.780 --> 00:01.613
-: In the last section,

00:01.613 --> 00:04.140
we started talking about deployment objects.

00:04.140 --> 00:07.140
Remember, a deployment is going to run and manage

00:07.140 --> 00:09.210
a set of identical pods.

00:09.210 --> 00:11.190
From this point forward throughout this course,

00:11.190 --> 00:14.400
we are no longer going to create pods ourselves manually.

00:14.400 --> 00:16.500
Instead, we're going to create deployments

00:16.500 --> 00:18.690
that will create pods for us.

00:18.690 --> 00:20.310
So deployments are appropriate for use

00:20.310 --> 00:22.773
in both a development and production environment.

00:23.640 --> 00:26.610
We're going to make a deployment that has a pod template

00:26.610 --> 00:28.980
that's going to try to create a container

00:28.980 --> 00:30.960
using the image multi-client,

00:30.960 --> 00:34.080
and we're going to make sure that port 3000 is exposed.

00:34.080 --> 00:35.700
Now the reason we're going to make a deployment

00:35.700 --> 00:37.920
with multi-client and port 3000 open,

00:37.920 --> 00:40.260
is so that we can test this out in the browser

00:40.260 --> 00:43.320
once the deployment creates our actual pod.

00:43.320 --> 00:44.520
So, to make a deployment,

00:44.520 --> 00:47.100
we're going to use the same process that we use

00:47.100 --> 00:48.660
for every other object

00:48.660 --> 00:50.760
that we're ever going to create with Kubernetes.

00:50.760 --> 00:53.250
We're going to make a configuration file,

00:53.250 --> 00:57.090
and then feed that configuration file into kubectl.

00:57.090 --> 00:59.250
So inside of my code editor,

00:59.250 --> 01:01.440
I'm gonna create a new configuration file

01:01.440 --> 01:03.840
inside of my root project directory,

01:03.840 --> 01:05.190
and I'll give this file a name

01:05.190 --> 01:09.003
of client-deployment.emo.

01:11.730 --> 01:12.780
And then inside this file,

01:12.780 --> 01:14.700
we're gonna add all of our configuration

01:14.700 --> 01:17.610
to describe this new deployment that we're making.

01:17.610 --> 01:18.450
We're going to write out

01:18.450 --> 01:20.400
all the configuration together right now,

01:20.400 --> 01:21.660
and then we'll talk about the purpose

01:21.660 --> 01:23.763
of every line immediately after that.

01:24.600 --> 01:28.020
So I'll get started by writing out API version,

01:28.020 --> 01:30.513
and I'll say apps/V1.

01:31.470 --> 01:34.740
I'll specify kind of deployment.

01:34.740 --> 01:35.850
So these two lines right here.

01:35.850 --> 01:37.350
I bet you can guess what's going on.

01:37.350 --> 01:39.750
We are saying that we want to use a object

01:39.750 --> 01:44.010
that is defined inside the API version of apps/V1,

01:44.010 --> 01:45.390
and the specific type of object

01:45.390 --> 01:48.120
that we want to create is a deployment.

01:48.120 --> 01:50.853
Next up, we'll put down our metadata section,

01:52.200 --> 01:55.503
and we'll give the thing a name of client-deployment.

01:56.910 --> 01:59.220
Then we'll do our spec after that.

01:59.220 --> 02:00.300
For the spec,

02:00.300 --> 02:02.523
we'll say replicas is one.

02:03.600 --> 02:07.170
We'll add on a selector with match labels,

02:07.170 --> 02:10.113
and a component web property lexo.

02:12.330 --> 02:13.320
I'll then un-indent

02:13.320 --> 02:15.930
so I now only have one indent right here.

02:15.930 --> 02:17.073
I'll say template.

02:18.690 --> 02:20.373
I'll put in metadata,

02:21.750 --> 02:22.623
labels,

02:24.780 --> 02:26.343
component web.

02:27.240 --> 02:28.620
I'm going to un-indent again

02:28.620 --> 02:32.643
so that I'm on the same indentation layer as metadata.

02:33.600 --> 02:35.520
I'll say spec,

02:35.520 --> 02:36.573
containers,

02:37.500 --> 02:39.450
and we'll define the list of containers

02:39.450 --> 02:41.400
that we want created with every pod

02:41.400 --> 02:43.560
that is controlled by this deployment.

02:43.560 --> 02:45.270
So this is a array entry.

02:45.270 --> 02:47.580
So I'll put in my little dash like so.

02:47.580 --> 02:49.920
And I'll say that I want a pod that has a name,

02:49.920 --> 02:52.980
or so be a container in this pod with a name of client.

02:52.980 --> 02:57.980
I want it to run the image of my docker ID/multi client.

02:58.830 --> 03:00.930
And then finally we'll set up that port mapping.

03:00.930 --> 03:02.490
So I'll say ports

03:02.490 --> 03:07.023
with a container port of 3000 like so.

03:08.430 --> 03:10.320
Okay. So, something's inside this file

03:10.320 --> 03:11.610
might look a little bit familiar.

03:11.610 --> 03:12.540
Let's take a quick pause.

03:12.540 --> 03:13.770
We're gonna come back the next section

03:13.770 --> 03:16.440
and start breaking this thing down line by line.

03:16.440 --> 03:18.090
So I'll see you in just a minute.
