-: When we first started talking about pods and deployments
about a dozen videos or so ago,
you might recall that I opened up my terminal
at some point in time and I told you
that I was going to run a series of commands,
and I also told you, don't try to run these commands.
I told you don't run these because you're probably
gonna see an error message or something like that.
And so one of the commands that I ran
at that point in time, was a simple Docker P S.
Remember the Docker PS commands will print out the status
of all the different containers that are running
on your local machine.
So you saw me run this command, and when I did so
there appeared to be a tremendous number
of containers running on my local machine.
Now, if you open up your terminal right now
and you run a docker PS as well,
you're probably only gonna see like maybe zero,
one, two or three local containers.
And chances are there are they're going to be containers
that we had started up in previous sections
that you never cleaned up or anything like that.
So why am I seeing this output right here
of all these different containers?
And if you look at the name of them
they all appear to be very clearly related to Kubernetes.
So why am I seeing all this output right here
and why are you only seeing one or two or three?
Well, in this section we're going to
investigate this a little bit.
We're going to get a better idea
of what docker is doing for us both on our local computer
and inside that virtual machine that forms our node,
we're going to get a better idea
of how we can kind of reach into the node
and play around with a copy of docker inside there.
All right, so first off, couple diagrams.
Now we've looked at some variations
on this diagram right here a couple time,
and we've gone over the process of what happens
when we feed in a config file through kubectl
a couple times as well.
But I wanna give you just one more quick reminder
of what's going on.
So remember we take a configuration file
that wants to create either a pod or a deployment.
We feed that into kubectl,
that gets passed off to the master,
and then the master reaches into the virtual machine
and communicates with the copy of docker
that runs only inside of the virtual machine,
and it tells it, hey docker client
we need to create a new container.
Go off and grab this image and create a container out of it.
The docker client then turns around
and says to the docker server, hey docker server
we need to go and grab an image
and we need to create a container out of it.
And so it's then up to the docker server
to reach out to docker hub, download an image,
store it inside of some local cash,
and then build a container out of it.
Again, we've gone over this flow several times,
now something else that we've discussed a couple times
is the fact that we have two copies of docker
running on your local machine right now.
We have the copy of docker that's running inside
of the virtual machine, and we have the copy of docker
that we installed way back at the start of this course,
when we ran docker for Mac or docker for Windows.
That's the copy of docker that's associated
with this status bar drop down right here.
All right, now I wanna show you
something really interesting, all right,
I'm gonna flip back over to my terminal
and inside of this terminal window right here
I'm going to run docker PS again.
When I run that, you're gonna see, yep
I've got all this output from docker right here.
Now I'm gonna open up another terminal window,
so here's just another simple terminal window over here
and I'm going to do a docker PS over here as well.
And when I do it over here, it appears that
I'm running absolutely no containers whatsoever.
So what's going on here?
Well, essentially I have configured docker
inside of these two terminal windows to connect
to one of these different docker servers
that's running on my local computer.
So whenever I type in a command inside my terminal,
I'm accessing the copy of docker client
that was set up with docker for Mac,
when I installed it way earlier inside this course.
My first terminal window over here,
this one where I run docker PS
and I see no running containers whatsoever.
This copy of the docker client
or the docker CLI,
is connecting to the docker server
that is running on my local computer,
and again, this is the copy of Docker server
that was installed with Docker for Mac.
In the second terminal window,
I bet you can guess what's going on
in the second terminal window over here,
I have configured my local copy of Docker client,
not to connect to my local Docker server.
Instead, I have reconfigured it to talk to the copy
of Docker server running inside of the virtual machine.
So, inside of this very specific terminal window right here
when I do a docker PS, my copy of Docker client,
the Docker CLI is reaching into the virtual machine.
It's getting in contact with a copy of Docker server
inside there, and it's asking it,
hey what different containers are you running?
And so that's why inside of this terminal window right here
I see this big list of Kubernetes related containers
including the multi-client container right here.
And again, all these containers are running
inside of my virtual machine.
All right, so again the idea here
all I want you to understand right now
is that I have one copy of Docker client
and between these two terminal windows, I have configured it
to either talk to my local copy of Docker server
or the copy of Docker server that is running inside
of the virtual machine.
So let's take a quick pause right here,
now that we understand that,
when we come back the next section
I'm gonna show you how you can reconfigure
your local copy of Docker client
to talk to Docker server inside the virtual machine.
And of course, I'll also tell you
why we would want to do this at all.
All right, so quick break
and we'll come back in the next section.