This first config file is pretty straightforward in nature.
Well let's go to the thing line by line and just make sure that the purpose of every line is really
crystal clear.
So quick diagram on the left hand side I've got every line that config file and on the right hand side
I've got a couple of notes.
The first thing he wrote was API version B 1.
It turns out that Cuban 80s is actually a really extensible when you install Cuban 80s on your local
machine.
It comes with a preset list of different objects we can create so we can create things like pods deployment
services and so on.
We can also tell Cuban editors about custom objects that we want to create as well.
The goal of the API version right here is to tell Cuban cities about the pool of objects that we want
to draw from.
So in this case we are telling Cuban cities look at the default V1.
Cuban editors list of objects that we can create then on the right next line right.
After that we specify the exact type of object that we want to create from that pool.
So in this case you want to create an object of type pod and remember a pod is going to wrap up a container
and for our definition or our purposes a pod is more or less like a container.
Next up was metadata metadata is going to include some different options.
So we want to apply to the object we're about to create by far the most common option that we're going
to apply is the name property.
So by providing a name right here we are saying that when this pod is created we want the pod to be
given a name of.
When we were back at our terminal a moment ago and we ran that command K get pods we saw the name print
up right here of posts.
Yeah that is the metadata Name property right there.
So if we had changed post to something else like my odd with posts and then tried to create this thing
again it would instead have a name of my pod with post after that we have the spec the spec or specification
is going to have a list of configuration options or the pod that we're about to create.
This is a very precise definition that controls exactly what should be going on inside this pod and
how the pod should behave.
The only required property we have to throw in here is containers.
Containers is going to be an array.
That's what the little dash right there meant inside of our yellow file.
The dash means that we want to add in a array entity right here so we could technically have many containers
inside this one pod but our case we have just one.
So one array entry
or that one array entry we're going to provide some configuration for this one container that's going
to be create inside the pod the container that's going to be created will be given a name of post as
well.
Now one thing not to mention really quickly is that the name properties here don't really have a lot
of big importance.
You can provide a name of whatever makes sense to you.
In this case I gave the pod and the container inside of it an identical name.
Is that bad practice.
Well not really.
Because again our pod is only going to be running one container that's gonna be okay to have the pod
and container have the exact same name the only real purpose of a name for us in this context in the
course is to help us with debugging and help us understand exactly what part we're looking at or what
container we are working with.
We also provide the image property and this is going to be the exact tag applied to some image.
One thing that you might note here is that I put on a version number here at the very end.
You might recall from your background in Docker that if we do not provide a version at the very end
then Docker will default to putting on latest in all scenarios.
If you ever apply or tried to create a pod that has latest on the end right there or doesn't have anything
which implies latest Vancouver 90s default behavior is to try to reach out to Docker Hub and find this
image listed on Docker Hub.
We have not pushed this image Docker Hub.
So if we had done that we would have resulted in an air by putting on an exact version humanity says
oh OK well I'm going to assume that if this image is located on the computer that I'm running on.
So essentially you're computer right now is just gonna go ahead and use that image directly.
So in other words when its latest or an implicit latest which would mean that we just don't have anything
at all.
Humanities assumes that it needs to go out to Docker Hub and try to find the latest image as opposed
to using the image that is already on your computer.
So by putting on that version we're just saying hey if you find that version on the local computer just
use it don't try to reach out to Docker Hub now functionally.
You don't really have to worry about that distinction in practice and the words just don't sweat this
too much.
Don't read too much into it.
We only really put this on here to avoid any errors coming up on this first pod that we are creating
because obviously we'd been kind of nasty to have a air up appear immediately.
So usually when we write out a pod spec or a deployment spec we're usually just going to specify the
image in the form you see right here and not read too much about it again.
So that's it for our config file now.
We also ran a commander to the last video we ran can get pods.
Let's do a quick pause right here and I would expand on the earth not get pods but cubes TTL.
I'll tell you about what that K is right there in just a moment.
You're probably wondering why I was able to run that.
I'll tell you about that in just a moment just a little shortcut.
So when we run cubes you tell to get pods.
There's a variety of other commands you need to know.
So I'll take a quick pause right here and expand on some these commands in just a moment.