WEBVTT 00:00.230 --> 00:07.950 In this demo, we're going to create a pod again, but this time, instead of making use of the Cuchillo 00:07.980 --> 00:11.790 run command, we're going to create it using a Yamal definition file. 00:12.570 --> 00:17.490 So our goal is to create a YAML file with the parts specifications in it. 00:18.240 --> 00:20.460 Now, there are many ways to do it. 00:20.670 --> 00:24.180 You could just create one in any text editor. 00:25.140 --> 00:27.460 So if you're on Windows, you could just use notepad. 00:27.750 --> 00:34.920 Or if you're on Linux, as I am just using native editor like V.I. or Vem, an editor with support for 00:34.920 --> 00:40.350 Yamal language would be very helpful in getting the syntax right. 00:40.500 --> 00:48.060 So instead of notepad at all, a tool like Notepad plus plus in Windows or VM in Linux would be better. 00:48.720 --> 00:56.550 Now I'll talk more about tips and tricks and other tools and ideas that can help with this more in the 00:56.550 --> 00:57.510 upcoming lectures. 00:58.110 --> 01:07.560 For now, let's take with the very basic form of creating a demo file using V.I. Ed on Maylee next system. 01:07.710 --> 01:09.750 So here I am on my Linux terminal. 01:10.220 --> 01:15.540 I'm going to make use of Wim Text-based editor to create this part definition file. 01:15.990 --> 01:22.830 So the name of the file I'm going to call as Paul Yamal and as seen in the lecture, we will start off 01:22.860 --> 01:29.550 with the four root level elements are the root level properties that we that we saw, which are API 01:29.550 --> 01:32.370 version, kinde metadata and spec. 01:33.600 --> 01:42.440 So we know that the value of four API version for a pod is the one, the kind is pod with a capital 01:42.440 --> 01:42.850 P. 01:42.980 --> 01:45.290 So it is case sensitive. 01:45.530 --> 01:47.390 So that's important. 01:48.060 --> 01:52.760 And metadata is a dictionary and it can have values where we define the name of the pod. 01:53.300 --> 02:01.280 So I'm going to use name as Engine X and we can have additional labels that we can specify under it. 02:01.820 --> 02:04.400 So labels again is also a dictionary. 02:04.430 --> 02:08.030 And it can have as many labels as you want under it. 02:08.510 --> 02:13.910 So we can specify a label, which is a key value pairs as a harp and engine X. 02:14.540 --> 02:20.740 And we can also add more labels like tIere and set it to front end. 02:21.290 --> 02:24.020 Anything that can help us group this particular pod. 02:25.340 --> 02:27.800 Next, we have to define the spec. 02:27.890 --> 02:29.930 So spec is also a dictionary. 02:30.650 --> 02:32.470 It has an object called containers. 02:33.140 --> 02:38.750 So before we move on to that, we have to make sure that we get the indentation right. 02:38.990 --> 02:44.030 For example, the app and TEER are children of the labels property. 02:44.060 --> 02:47.810 So it has to be in the same kind of vertical line here. 02:48.110 --> 02:53.620 And similarly, under metadata, you have Nayman labels, which are the children of metadata. 02:53.720 --> 02:58.010 So people have to be on within the same vertical line. 02:58.640 --> 03:01.130 So you have to make sure that the spacing is correct. 03:01.340 --> 03:04.500 Typically it would be two spaces or a tab. 03:05.720 --> 03:08.160 But it is recommended not to use taps. 03:08.210 --> 03:12.980 So always stick to two spaces and stick to that throughout. 03:13.370 --> 03:17.180 So the next thing that we're going to configure is the container. 03:17.360 --> 03:19.760 So a container is a list of objects. 03:20.420 --> 03:22.310 Now we first give it a name. 03:22.580 --> 03:26.000 And note that this is the name of the container within the port. 03:26.510 --> 03:30.380 And there could be multiple containers and each can have a different name. 03:30.950 --> 03:33.390 So one container could be named app. 03:33.560 --> 03:36.130 And another container could be named helper. 03:36.770 --> 03:38.570 Any name that makes sense to you? 03:39.350 --> 03:42.530 We're going to use the same name as that of the container image. 03:42.740 --> 03:44.960 So we will just name it in Genex. 03:47.060 --> 03:52.630 And the second object that we're going to add here is the image name, which is the Docker hub image 03:52.640 --> 03:55.010 name of the container that we're going to create. 03:55.910 --> 03:59.510 So the image name is, again, engine X. 04:00.290 --> 04:06.830 If you're using other registries than Docker Hub, then make sure to specify the full path to that image 04:06.830 --> 04:07.770 repository here. 04:08.780 --> 04:13.040 Now, remember that we can add additional containers to port as well. 04:13.100 --> 04:19.970 So if you have to do that, we have to declare the secondary element to the list, which would be the 04:19.970 --> 04:21.230 second object in the list. 04:21.950 --> 04:26.660 So here I can, for example, add a busy box container using the busy box image. 04:27.140 --> 04:29.210 And that would be the second element of theory. 04:30.940 --> 04:34.720 So in this case, we're going to stick to one single container. 04:35.080 --> 04:37.030 So I'm going to just delete that. 04:40.340 --> 04:42.090 And I'm not going to hit escape. 04:42.430 --> 04:49.900 Colin WQ to save this file, and we will just use the Cat Command to make sure that the file was created 04:49.960 --> 04:51.970 with the expected contents. 04:52.780 --> 04:54.430 So make sure the format is correct. 04:55.150 --> 04:57.980 So the name and labels are children of Medidata. 04:58.160 --> 05:02.230 And you can see that they are on the same kind of vertical line. 05:02.980 --> 05:08.890 And similarly, labels have two children, which are the two labels happened tier and spek has a list. 05:09.970 --> 05:15.100 And we are defining it as a list with a hyphen followed by the objects. 05:18.360 --> 05:24.540 So we can make use of the Kyouko to create a command or the capital apply command, so to create and 05:24.540 --> 05:25.260 apply command. 05:25.740 --> 05:30.630 Kind of works the same if you're creating a new object. 05:30.740 --> 05:31.000 Right. 05:31.230 --> 05:33.060 You can either use, create or you can use apply. 05:33.690 --> 05:34.380 It doesn't matter. 05:35.760 --> 05:39.770 And we pass in the file name using the dash F option. 05:40.260 --> 05:43.590 And here we can see that the part has been created. 05:43.740 --> 05:45.120 So let's check the status. 05:45.180 --> 05:45.840 Real quick. 05:47.260 --> 05:49.950 And you can see that it's in container creating state. 05:50.490 --> 05:53.010 And then when we check again, we see that it's in the running state. 05:53.600 --> 05:58.180 And as before, if you want to get more details about the part, you can always run the cuddle described 05:58.230 --> 06:01.390 command and specify the the name of the pod. 06:01.980 --> 06:05.970 And you should get a much more in-depth information about the pod. 06:06.530 --> 06:06.650 OK. 06:06.810 --> 06:08.010 So that's it for this demo. 06:08.490 --> 06:15.960 In the next section, we will learn some tips and tricks of developing Yamal files and easily using 06:16.060 --> 06:16.810 I.D..