Hello and welcome to this demo.
In this demo we're going to see how to create a pod using a demo definition file.
OK.
So in order to create Yammer files you can actually use any editor of your choice.
You could even use just a notepad or notepad plus plus or Adam or there are multiple options available.
In my case I tend to use pi charm or a tool from the brains family.
So I personally use pi term which is actually a python editor.
And it has it has good support for Yemen files.
So I use jet brains pi charm as my editor if you'd like to use pi charm you can actually go to dead
brains dot com and select pi charm brains dot com forward slash pi charm and you can actually see when
you click on download you can actually see there are two options.
One is a professional version and another is community version which is free so you can actually download
this lightweight idea which is free and to develop definition files and later on I will also show some
tips and tricks around using this idea which will make your life a developing Cuban it is to finish
in files enamel.
Very easy.
So there are ways that you can.
There are plugins that will help you validate your file available with a pie chart.
So we look at those as well.
So to start with I'm going to create a new project.
I'm going to call it as part and I'm just going to create the project.
So that's that's my folder named part and under part I'm going to start by creating a pod definition
file.
I'm going to name that part that dash definition dot Jamel.
And so now I have a one file.
And as we saw in the lecture every component is definition file has the four root level properties which
are API version.
So I'm going to specify each of those so we have API portion kind metadata and spec okay.
So as we disclosed API version is going to be V1 for pod the kind.
As we know is pod.
So I'm going to set that as pod.
The metadata is an object or a dictionary.
So I'm going to hit enter and then I'm going to hit tab or you can actually use spaces as well.
I'm going to provide the properties unlimited data which are name.
And I'm going to set a name for my part which is going to be my app dash pod and when I hit enter as
you see it goes to the next line.
But it's intended it has equal number of spaces before it then the previous line.
And I'm going to have labels and other labels.
So since labels is a dictionary again I'm going to invent the next few lines to the right as well under
labels.
I have app and the name of the app is going to be my app.
Now if you look at this whole file and if you look at the bottom page chart has support for understanding
ammo files.
So if you look at the bottom you can actually see the various elements in a tree structure.
So as you can see document one of one indicates this file is in the entire file.
And under this file it it actually shows you in tree structure the various properties.
So you have API version which is directly under the File kind.
Metadata and spec are all directly under the file or root properties of the file which is what we wanted.
And if you look at V1 V1 is actually under API version so now as you can see under the document I have
API version and under that I have V1.
So that matches what we're trying to do.
Similarly if I select part you can see that it's under kind and if you select name which is under metadata
you can see that it's under metadata.
Similarly when you select labels you will also see that it is under metadata.
So that means name and labels are children of metadata and theirs.
So there are siblings and they must be intended.
They must have the same intonation.
So under a name you have my app part so you can see the hierarchy there.
Similarly app is under labels and my app is under AB which is under labels.
Now if you look at it name and labels need to be on the same vertical line for now.
If I simply move labels to the right you now see that labels is under names and labels is now a child
of name and which is not right it is supposed to be a sibling.
So I'm going to remove those extra spaces I'm going to hit backspace and I'm going to level it.
So this is right and under labels you can actually have as many labels as you want so you can create
any key value pair here you can see cost center is our location north america or something like that
type of this particular pod maybe a front end or something like that.
So anything that will help you group this particular part in the future for now I'm just going to remove
all of that and I'll no move on to the specs section under the spec section.
Remember the specs section is unique to each object that you're creating.
So for a pod under the spec section you actually have containers and under containers you have the containers
is in fact an array or a list so you have a list of items.
So you need a each item in the list is identified by a dash so as you have to put a dash followed by
space and then name which is the name of my pod.
Sorry the name of my container inside the pod and that's going to be in the next control container.
And and then I have image which is the name of the image itself which is NTI and.
So if you look at it I have under spec I have containers which is a list and then I have an item in
the list which is which has name and image.
Now if you try and look at the hierarchy of what we just created say if I select Name I see that it's
under spec and it's under containers but there's something in between it says item once one of one.
What that actually means is that's what indicates that the container is a list and it has multiple items
and this is the first item of just one item.
So these two lines is one item in the containers.
Similarly you can have we know that we discussed that you can have additional containers in a port so
if you had additional containers then this is how you would define it.
You would in the new line you would add a new dash followed by new information about the way followed
by information about the new port which could be like a back and container and the image is could be
something like Redis or something.
So in this case now when it's like name you can actually see that it says item two or two and then one
of two.
So now it actually identifies each item in the array or the list so that indicates that the format is
correct and that is what we were trying to do.
I'm just gonna get rid of the second container and I'm going to leave it as one can report.
So this is good.
I'm now going to copy this the contents of this and create an actual port using this the content that
we just created.
So I'm going to go to the cube master.
I'm going to create a a folder structure for my demos.
I'm going to call it demos and under demos I'm going to create a folder called pod and under part I'm
going to create a file named pod definition dot Jamil
and I will paste the contents that I just created
OK.
So when I know I'm going verify the contents of the file
I can now run the cube control get parts command before I create the port I just want to make sure there's
nothing running.
So if you're following me from the previous lab where I deployed a port using the cube control run command.
That's the part that's still running so I'm gonna get rid of that using the cube control delete deployment
command.
So that's gone by now.
Right now we're the cube control get port command.
I see that there are no resources found I can now create a new port using the cube control create port
definition the Yemen command and I see that a new pod my part my airport is created when I run the cube
control get ports command I see that it's in the process of creating the container and I will now monitor
it and when I run it again I see that it's in a running state well that's it for this lecture in the
next demo we're going to look at some tips and tricks around working with the ammo files in my.
Thank you for your time and I will see you in the next demo.