Hopefully you now have Cuba that is up and running on your local machine.
The first thing we're going to do is just run one simple command to make sure that it is running successfully
to run this command.
We're going to open up a new terminal window.
That's really important.
Please make sure you open up a new terminal window even if you already have an open.
And in this new window we will run cube CCL version so I'll go ahead run that and we should see something
print out for a client version and server version.
Now if you're running a newer version than I am that is totally fine.
Newer versions of Cuban 80s add in some pretty exotic features that we are very unlikely to use anytime
inside this course.
So really we could be using a much earlier version of Cuban 80s than what even I'm using right now and
everything inside this course is still going to work just fine.
Remember Cuban editors to some degree is about stability because we're using it to manage a tremendous
aspect of our application now that we've got Cuban editors up and running.
We're going to take a look at a quick couple of diagrams here really just one big diagram and get a
quick tour of what communities is really all about.
So I'm gonna walk you through the workflow of how we're really going to use Cuban eddies quick note
here but I'm gonna show you is really in debt.
There's gonna be a lot of terminology floating around.
I do not expect you to memorize anything all this.
Any of this.
You don't have to memorize any of it.
I just want to throw some terms out there and start exposing you to a couple of these ideas.
We are going to actually implement the entire workflow that we're about to discuss in just a moment.
So you'll see a much more in-depth version of all the stuff in the coming videos.
All right so let's get to it.
Here's our diagram.
I'm going to zoom in on a part of it and I'm going to work this thing step by step.
The first part we're gonna take a look at is over here on the left hand side
so this little workflow right here should look really familiar.
We've got some post files or essentially our post service source code.
We took all those files and a docker file and we fed them more or less into Docker.
And now with that came an image for our post service.
We can now create as many instances of this image or containers as we call them as you wish.
The image is really the blueprint for how to create a post container.
Now of course at some point time we're going to want to actually create an instance of this post image
or again a container.
So to do so again zoom out here for just a moment.
This is jumping around just a little bit.
There we go so we've got our image all created.
That's kind of the prerequisite here.
Whenever we want to use cabinets we have to have a set of images that are already ready to go.
So of course we're going to want to actually create a container of this thing at some point in time
and we're going to want to deploy it into our Cuban cities cluster.
Now in the cluster I have kind of drawn out or diagram right here I'm showing three separate notes.
And remember a node is a virtual machine.
It is essentially a computer that's going to run some number of containers for us.
We are currently running Cuban eddies on our own personal computers.
If you're running Cuban ads on your own computer it's extremely likely that you are only running one
node by default.
So you have one virtual machine.
It's only once we start deploying to some cloud provider that we're going to have multiple nodes regardless.
Everything we're about to discuss works identical whether we have one node or 1000 notes it's all the
same I am going to show three nodes on here just to give old more clarity on what is going on behind
the scenes all right.
So to create a container out of image or something out of the post image we are going to first create
a configuration file in this configuration file we're going to list out some very explicit directions
for Cuban net is going to say please create two copies of the poster image for us make containers and
host them somewhere on these notes inside that config file.
We are also going to say please allow these copies of posts to be accessible.
So in other words set up some networking on the on these things allow other containers to get created
among these nodes to access these post services that we're about to create so we're gonna feed that
thing into Cuban net.
We're gonna get that config file into Cuban 80s using that command line tool.
We just wrote out a second ago cube CTO.
That's how we interact with our communities cluster the Cuban 80s cluster is going to read this config
file read over and say OK.
Well I guess I got to create two containers adipose so Cuban eddies is going to look out among the world
and try to find a copy of this post image.
It's going to first take a look at the docker Damon or the docker server running on your personal computer.
So on your computer we have built up that post image already.
So Cuban 80s is going to look at your local machine and see if there is a copy of that image already
available if it is not available then it will default to looking out at Docker Hub and try to find a
copy of that image there instead.
Either way Cuban 80s is going to try to find that image once it finds that image that's going to create
two containers because we asked for two and randomly distributes more or less randomly.
Again there's some science to this distribute those two containers that create get created among these
nodes
so we get to containers like so each container that is created is going to be hosted or essentially
created inside of something called a port for the purposes of this course.
This is really important for the purposes of this course.
You and I are going to be pretty much using the terms pod and container interchangeably pods and containers
and reality are not the same thing but in the context this course it is good enough and I feel pretty
strongly about this.
Now they're not technically the same thing but I feel pretty strongly that we can safely say a pod in
a container is more or less the same thing a pod.
Technically it wraps up a container and technically a pod can have multiple containers inside of it.
But again for the fourth time for the purposes of this course we're going to say a pod and a container
are basically the same thing so we asked for two copies of the post service.
So Cuban Eddie's is going to create two pods each of them is going to have a copy of The Post container
running inside of it
in order to manage these two pods communities is also going to create something called a deployment
this deployment is going to read in this configuration file over here and it's going to say oh OK they
wanted two copies of The Post's image.
So this deployment is going to be in charge of managing both these pots if anything ever goes wrong
with these pods.
So if it crashes for some reason or if it just stops running or whatever else might possibly happen.
This deployment right here is going to make sure that that pod automatically gets recreate it for us.
So the deployment is in charge of making sure that we've always got the right number of pods and that
these pods are running successfully.
It's now second step here in this config file we had also said Please allow us to access these services
from other pods or essentially containers inside of our communities cluster to do so communities is
going to create something else called a service.
Now this is where life starts to get a little bit confusing because hey we are in a course you're talking
about micro services and now we're introducing this thing called a service.
So the term service in the world of Cuban 80s is not like the way that we've been using the word service
throughout this course.
It is not necessarily a running program.
It's not necessarily a running server or a running application server or anything like that.
Instead a server is something that gives us access to running ads or running containers inside of our
cluster.
I'm going to zoom in on this a little bit more right now because we can see it a lot more easily so
the service is what is in charge of kind of abstracting away all of those difficulties we spoke about
a little bit ago in handling networking among different micro services.
You might recall a little bit ago we looked at a diagram right here like this one more or less.
And we said Oh yeah.
You know what this event plus is kind of challenging for us to have the event plus always know how to
reach out to all these different copies of comments that exist and how to know what port to reach out
to as well.
So when we started talking about Cuban cities we introduced this thing down here where we said Oh yeah.
Just send me a request and I will afford it on to the appropriate service.
So that's what person in the appropriate will say container here.
I don't want to overuse the term service moving forward.
And so that's what this service thing is in abstracts away all the difficulties of trying to figure
out what IP or what port some given program is running on.
So if at some point in time in the future we create another pod running say our event bus over here
the event bus to reach out to oppose either of these things right here rather than trying to reach out
to that container directly.
It's going to instead just reach out to this service which will be available at a very easy to know
or easy to understand U.R.L..
It won't be like local host four thousand five which is of course really challenging to remember.
Instead it will be a very well understood or else something like post serve or postal service something
just very simple very straightforward doesn't really require a lot of difficult memorization.
And so this service thing is going to make it much more easy for us to get from our event bus and reach
on out to our running pods.
So that is our big overview of Cuban cities.
Now at this point this video is running a little bit long so we're can take a quick pause right here.
We'll come back the next video and I just want to kind of highlight a couple of really impedes important
pieces of terminology.
And then as I mentioned we're going to start to implement this exact workflow.