WEBVTT 00:00.670 --> 00:03.940 OK, so this is what we saw in the last demo. 00:04.180 --> 00:11.140 So we deployed parts and services to keep it really simple and we were able to access our application 00:11.830 --> 00:12.610 from a browser. 00:13.390 --> 00:18.460 But deploying applications as just part has its own challenges. 00:19.240 --> 00:24.970 Deploying parts doesn't help us scale our application easily if we wanted to add more instances of a 00:25.000 --> 00:25.780 particular service. 00:26.190 --> 00:31.930 And if you wanted to update the application like an image that was using the application, then your 00:31.930 --> 00:36.140 application will have to be taken down by the new pod is created. 00:36.190 --> 00:38.490 So that that may result in a net downtime. 00:39.130 --> 00:43.960 So the right approach is to use deployments to deploy an application. 00:44.020 --> 00:47.710 So let us now improvise our setup using deployments. 00:48.160 --> 00:54.900 So we choose deployments over replica sets as deployments automatically creator of the gussets as required. 00:55.000 --> 01:02.350 And it can have it can help us perform rolling updates and rollbacks and maintain a record of revisions 01:02.350 --> 01:06.490 and record the cause of change, as we have seen in the previous demos. 01:07.400 --> 01:08.830 So deployments are the way to go. 01:09.160 --> 01:16.520 So we will add more pods if required for the front and applications like voting app and result app by 01:16.540 --> 01:19.860 the by creating a deployment and setting the cost to three. 01:20.430 --> 01:24.670 We'll initially start off with just one replicas for all for each of these components. 01:24.700 --> 01:28.690 And later, we'll see how easy it is to scale them to three or more. 01:28.930 --> 01:29.130 Right. 01:29.590 --> 01:36.760 So we will also encapsulate the databases and the worker applications within deployments. 01:37.180 --> 01:39.370 So let's take a look at that now. 01:40.000 --> 01:42.070 So here I am in the Visual Studio Code. 01:42.520 --> 01:47.830 And this is the project directory, which has all the parts and service definition files. 01:48.310 --> 01:51.380 So let's create a new file for the deployments. 01:51.530 --> 01:54.010 So we'll start with the voting app itself. 01:54.100 --> 02:00.970 So I'll name this file as a wedding app, dash deploy Yamal and I'm going to use the split screen function 02:00.970 --> 02:05.340 so that I can open the port and the deployment definition file side by side. 02:05.920 --> 02:11.800 So let's create the deployment file for the building, the application by using the PA definition file 02:11.860 --> 02:12.700 as the template. 02:13.240 --> 02:17.660 So let's start with the API version and it will be apps slash. 02:17.710 --> 02:19.150 We won the kind. 02:19.380 --> 02:20.440 We'll be deployment. 02:20.790 --> 02:22.420 And let's add the metadata. 02:22.990 --> 02:28.930 The name of the deployment would be wedding app dash deploy and we'll add some labels. 02:36.300 --> 02:38.760 Next, let's add the specked section. 02:39.000 --> 02:42.930 And so it has already pre populated a couple of entries for us. 02:43.740 --> 02:46.740 So we should be specifying the number of replicas. 02:47.650 --> 02:52.500 And for all our part, we're just going to stick to one replica to begin with. 02:52.710 --> 02:59.400 And since we are on a single note cluster to save some resources and under the selector section, I'm 02:59.430 --> 03:01.460 going to add the labels from the pod. 03:01.500 --> 03:09.720 So we use the match labels option and then we will copy and paste the labels over from the pod definition 03:09.720 --> 03:10.060 file. 03:11.620 --> 03:18.050 And now under the template section, I'm just going to copy everything from the metadata to the end 03:18.050 --> 03:24.530 of the file and then paste it under the template section, once done, we fix the formatting. 03:26.720 --> 03:27.020 All right. 03:27.050 --> 03:28.250 So that looks good. 03:28.700 --> 03:32.420 So let's proceed with the next deployment, which will be the red this deployment. 03:32.900 --> 03:34.040 Sorry again I open. 03:34.280 --> 03:36.560 Red is the red is part definition file. 03:36.590 --> 03:41.240 And just like before we create a new file called Red, is that deployed on Yamal? 03:43.040 --> 03:46.530 And then we will copy the contents of the voting app depending on file. 03:46.980 --> 03:47.910 Just to get started. 03:59.390 --> 04:02.070 And we will change the name of the deployment to readies deploy. 04:02.300 --> 04:04.250 And the same for labels as well. 04:04.280 --> 04:07.880 So we'll stick to replica one. 04:08.360 --> 04:12.830 And we will copy the labels from the pod definition file for Redis. 04:14.510 --> 04:19.520 And then we copy over the template from the parts and then paste it and then fix the formatting. 04:24.360 --> 04:25.080 So that's done. 04:25.200 --> 04:29.190 And we will proceed with the post, Chris Cual, the deployment. 04:36.260 --> 04:42.470 Let's copy the reduce deployment file and open the post Chris Paul definition file for reference and 04:42.470 --> 04:49.430 let's make the changes to the names and labels and update the selector labels with the ones on the pod. 04:59.760 --> 05:04.230 And then move over the definition under the template section. 05:04.680 --> 05:06.600 And then we fix the formatting. 05:10.300 --> 05:10.500 OK. 05:10.630 --> 05:11.740 So that looks all right. 05:13.300 --> 05:14.940 Next, let's proceed with the workers. 05:14.980 --> 05:16.330 So we're going to close this. 05:19.350 --> 05:21.330 Let's create a worker app deployment file. 05:24.100 --> 05:27.760 And we will copy and paste that template and update the name. 05:31.850 --> 05:38.710 And let's copy the labels from the pod definition file and put it under The Selecter section and the 05:38.710 --> 05:39.580 same as before. 05:39.610 --> 05:44.530 Let's copy the pod manifest file and pasted under the template section. 05:45.250 --> 05:47.140 So that's the deployment for worker. 05:47.590 --> 05:50.130 And now we are left with one for the result app. 05:50.320 --> 05:52.960 So again, we close these two. 05:52.990 --> 05:55.240 And here is our result app. 05:56.200 --> 06:02.350 We will create a new file result app deployed on YAML and we copy and paste a template again and we 06:02.350 --> 06:05.920 update the name and labels and the template as we did before. 06:15.890 --> 06:22.100 So we are now done with all our deployment definition files, and I'm going to get rid of all of this. 06:22.160 --> 06:25.820 So here is all the new deployment files that we re created. 06:26.390 --> 06:31.970 And now let's head back to our terminal and create these deployments along with the services. 06:32.570 --> 06:37.730 So before we do that, let's make sure that there are no parts and services running in the cluster. 06:37.760 --> 06:43.610 So we have cleaned up everything that was created for the previous demonstration. 06:44.000 --> 06:48.560 So there are no parts or services other than the default component is one. 06:49.100 --> 06:53.960 And now let's refresh and make sure that all our deployment files have been created. 06:54.620 --> 07:00.320 So here we have the five new deployments that we created and the services will remain the same. 07:00.350 --> 07:04.430 So we'll first start with the loading up deployment. 07:05.000 --> 07:11.810 So we'll create it using the cube to create command and passing the voting deployment file as input. 07:11.930 --> 07:17.390 And let's also create the service and let's do a quick check on the deployment and make sure that it's 07:17.390 --> 07:17.720 running. 07:18.050 --> 07:20.600 So, yes, we see that it is in R running state. 07:21.080 --> 07:25.670 So now let's create the ready is deployment and followed by the ready service. 07:26.180 --> 07:29.930 And similarly, let's create the post stress deployment and the post service. 07:30.470 --> 07:33.410 And let's make sure that everything is up. 07:34.010 --> 07:36.980 So we see that all the parts are up. 07:38.150 --> 07:43.340 The deployments are running one out of one part, which means that the ports are up and running. 07:43.670 --> 07:44.810 And let's check the service. 07:44.960 --> 07:46.970 So we have the DB service. 07:47.150 --> 07:50.780 We have the ready service and the voting service greater so far. 07:51.500 --> 07:55.490 So now let's clear the screen and we create the worker deployment. 07:58.590 --> 08:03.990 Remember, the worker does not have a service, so let's make sure that everything is running as as 08:04.080 --> 08:04.680 expected. 08:05.250 --> 08:09.210 And we see that the worker part of the deployment is running as well. 08:09.690 --> 08:13.850 So finally, we create the result up deployment and the result app service. 08:19.010 --> 08:22.580 And we now see that everything is running as expected. 08:22.610 --> 08:24.270 So let's change this. 08:24.560 --> 08:31.700 Two deployments, comma, SBC, so we have all the the five deployments in a running state and we have 08:31.700 --> 08:33.230 four services. 08:34.010 --> 08:38.270 So now let's get the orals for our two front end services. 08:38.300 --> 08:42.530 So we'll use mini queue service and the name of the service that you are, a red flag. 08:44.390 --> 08:46.940 And let's do the same for the result service as well. 08:50.080 --> 08:54.010 And we get that you are El's with the ports. 08:54.040 --> 08:56.470 Thirty thousand four and thirty thousand five. 08:57.280 --> 09:01.900 So now I'm going to launch the Web browser and we'll try to access these applications. 09:02.410 --> 09:05.830 So let's look at the first you RL, which is the voting app itself. 09:05.920 --> 09:06.940 And let's get the vote. 09:08.690 --> 09:13.730 And let me open another window here, which will go to thirty thousand five. 09:14.300 --> 09:17.730 And you can see that the result is shown as expected. 09:20.220 --> 09:25.210 So now I'm going to scale up the deployments are on the current scale command and specify the number 09:25.210 --> 09:26.110 of replicas. 09:26.140 --> 09:29.830 Two, three to add two more replicas for the wedding application. 09:31.220 --> 09:37.880 So when we on the get DEPLOYMENT'S command, we see that there are three parts for the voting app right 09:37.910 --> 09:38.180 now. 09:42.790 --> 09:49.930 Now, if we now go to the euro and refresh the page, each time we see that the page is served by a 09:49.930 --> 09:51.610 new pot each time. 09:52.440 --> 09:57.790 So we see how easy it is to scale our applications with deployments. 09:58.720 --> 09:59.920 Well, that's it for this demo. 10:00.400 --> 10:01.720 I will see you in the next.