In this demo, we're going to create a pod again, but this time, instead of making use of the Cuchillo
run command, we're going to create it using a Yamal definition file.
So our goal is to create a YAML file with the parts specifications in it.
Now, there are many ways to do it.
You could just create one in any text editor.
So if you're on Windows, you could just use notepad.
Or if you're on Linux, as I am just using native editor like V.I. or Vem, an editor with support for
Yamal language would be very helpful in getting the syntax right.
So instead of notepad at all, a tool like Notepad plus plus in Windows or VM in Linux would be better.
Now I'll talk more about tips and tricks and other tools and ideas that can help with this more in the
upcoming lectures.
For now, let's take with the very basic form of creating a demo file using V.I. Ed on Maylee next system.
So here I am on my Linux terminal.
I'm going to make use of Wim Text-based editor to create this part definition file.
So the name of the file I'm going to call as Paul Yamal and as seen in the lecture, we will start off
with the four root level elements are the root level properties that we that we saw, which are API
version, kinde metadata and spec.
So we know that the value of four API version for a pod is the one, the kind is pod with a capital
P.
So it is case sensitive.
So that's important.
And metadata is a dictionary and it can have values where we define the name of the pod.
So I'm going to use name as Engine X and we can have additional labels that we can specify under it.
So labels again is also a dictionary.
And it can have as many labels as you want under it.
So we can specify a label, which is a key value pairs as a harp and engine X.
And we can also add more labels like tIere and set it to front end.
Anything that can help us group this particular pod.
Next, we have to define the spec.
So spec is also a dictionary.
It has an object called containers.
So before we move on to that, we have to make sure that we get the indentation right.
For example, the app and TEER are children of the labels property.
So it has to be in the same kind of vertical line here.
And similarly, under metadata, you have Nayman labels, which are the children of metadata.
So people have to be on within the same vertical line.
So you have to make sure that the spacing is correct.
Typically it would be two spaces or a tab.
But it is recommended not to use taps.
So always stick to two spaces and stick to that throughout.
So the next thing that we're going to configure is the container.
So a container is a list of objects.
Now we first give it a name.
And note that this is the name of the container within the port.
And there could be multiple containers and each can have a different name.
So one container could be named app.
And another container could be named helper.
Any name that makes sense to you?
We're going to use the same name as that of the container image.
So we will just name it in Genex.
And the second object that we're going to add here is the image name, which is the Docker hub image
name of the container that we're going to create.
So the image name is, again, engine X.
If you're using other registries than Docker Hub, then make sure to specify the full path to that image
repository here.
Now, remember that we can add additional containers to port as well.
So if you have to do that, we have to declare the secondary element to the list, which would be the
second object in the list.
So here I can, for example, add a busy box container using the busy box image.
And that would be the second element of theory.
So in this case, we're going to stick to one single container.
So I'm going to just delete that.
And I'm not going to hit escape.
Colin WQ to save this file, and we will just use the Cat Command to make sure that the file was created
with the expected contents.
So make sure the format is correct.
So the name and labels are children of Medidata.
And you can see that they are on the same kind of vertical line.
And similarly, labels have two children, which are the two labels happened tier and spek has a list.
And we are defining it as a list with a hyphen followed by the objects.
So we can make use of the Kyouko to create a command or the capital apply command, so to create and
apply command.
Kind of works the same if you're creating a new object.
Right.
You can either use, create or you can use apply.
It doesn't matter.
And we pass in the file name using the dash F option.
And here we can see that the part has been created.
So let's check the status.
Real quick.
And you can see that it's in container creating state.
And then when we check again, we see that it's in the running state.
And as before, if you want to get more details about the part, you can always run the cuddle described
command and specify the the name of the pod.
And you should get a much more in-depth information about the pod.
OK.
So that's it for this demo.
In the next section, we will learn some tips and tricks of developing Yamal files and easily using
I.D..