Now that I've told you a ton about config files without actually saying well what they're really doing
internally.
Let's go ahead and create our first config file in this first config file.
We are going to try to create a pod directly so just a pod by itself out of our hosts service though
just to look back at this diagram over here.
The only part of this thing that I really want to make out of everything we discussed is just one pod
like that right there.
That's all I want to have a pod that's running container.
There's not gonna be any other service.
There's not going to be any deployment nothing like that just a pod by itself.
So let's figure out how we will do this.
And this video we're going to write out all the configuration for it and we'll have a deep discussion
about what every line of this configuration really means to get started.
We're going to first go back to our terminal.
We will change into our post directory and we are going to rebuild that Docker image.
Now it's really important that you rebuild this thing because we're going to apply a additional label
to it that's gonna help us identify it inside the configuration that we're about to write.
So even though we've built it several times down the last couple of videos yeah we're going to build
it again.
So inside of posts I going to run docker build dash T and we'll put down your Docker I.D. slash posts
and then a colon and all through a version number on there.
So you zero zero point one.
Don't forget the colon Olympia space and put in the dot to say I want to build this image out of this
current directory of posts and there we go.
So I've now built that image and that's how we can refer to this exact image.
We've got the name of the image of the tag line with the version number right there on the very ET Now
that we've got that put together.
Let's go back over to our Ed we're going to write out our configuration file to create a pod using this
container or this image the back of my Ed. I'm going to first create a new directory called infra This
is short for infrastructure.
So this is going to contain all the configuration all the code related to the deployment or management
of all of our different services inside there and then going to create a folder called K eights.
We're going to eventually have several different folders inside of here.
Right now we're going to say K AIDS is going to contain all of our Cuban 80s configuration files.
Just you know k 8 s is short for Cuban edits then inside there I'll create a new file and we're going
to call this thing those not yellow All right.
So inside of here.
Yep that's we're going to write out all of our configuration.
Now as I mentioned at the start of this video we're just going to focus on writing on the configuration
and creating this pod.
Then we'll come back the next video and discuss exactly what all the config is actually doing.
So right now we're going to do a little bit of a follow along write out exactly what I write out.
They'll say API version with a capital V a colon and then V1 we'll put in a kind of pod notice that
pod has a capital P well put in metadata well then put in a new line and on the next line there has
to be one indentation that like so the really two spaces right there.
If you don't have that then you're not running out valid camels to make sure you've got exactly two
spaces right out.
Name is post then back at the top level of indentation we'll put down spec we will indent again and
say containers another new line.
We're going to indent one we're level we'll put in a dash space name of posts and then image will be
whatever the image is that you just built two seconds ago.
Back at your terminal.
So essentially that right there.
So for me it will be Steven Greider slash posts Berlin 0 0 1.
That's absolutely critical that you have the exact same indentation that I do all the way through if
you save this and I try to run it as you're about to do a second and you get an error.
I can just about guarantee you there is a typo somewhere inside of here.
That's our config file.
We have told Cuban eddies that we want to create a pod.
We want its name to be posts inside that pod.
We want there to be exactly one container the containers name should be posts and we're going to build
that container using the image of that right there.
So let's figure out how we can use the cube TTL command line tool to actually make use of this config
file.
Next we're going to tell Cuban cities to use this config file to create a new object but to do so we're
gonna go back over to our terminal back at my terminal.
I'm still inside of my posts project directory.
I want to change into that case folder that we just made a second ago.
They'll go up one directory I'll change into infra and then Kate's and then inside there I should see
the post yellow file to tell Cuban notice that we wanted to use this config file.
We will write out cube CTO apply dash F and then the name of the file which in this case is post yellow
I'll go ahead and run that and then we should see something like this right here.
If you immediately see an error when you run that command again I can guarantee you that you've got
a typo somewhere inside this file you will only ever see errors coming out of this command.
If there is a typo there's just about no other scenario unless you're not running the Cuban 80s cluster
at all.
That's only two scenarios other Cuban entities is not running on your machine or there's a typo inside
the file which says that this thing was created.
But what does that really mean.
To inspect the state or to figure out exactly what is going on inside of our cluster there is a variety
of different commands we're going to run with QCT El.
In this case we want to take a look at all the different pods that are running inside of our cluster.
There should be exactly one right now so to inspect and get a list of all the different pods that are
running inside of here.
We can run cube Seitel yet odds and then we'll see that there is exactly one pod with the name of posts.
There's one copy of it that is being tried to be executed and one copy is successfully running this
pod status is running it has never been restarted and it was created 50 seconds ago.
That's it.
That's how we create an object in Cuban edits just about everything else we do with Cuba daddies is
going to be kind of variations of this config file normally the config files we're gonna write out are
gonna be way longer than what you see right here.
Usually closer to say 40 lines or so but this creates just one simple little object.
We then applied it to Cuban entities and Cuban natives use this config to decide exactly what to do
inside the cluster.
Now there's a lot of configuration even though it's only a couple lines that's kind of stuff inside
of here.
So I wanna give you a couple of quick notes about what's going on here in a couple of quick notes about
the cube CTF command line tool in just a moment.