We've been playing around with pods and deployments for quite a while.
And at this point in time if we do a cube GTL get pods we'll see that we still have one pod running
from our deployment.
So in theory this thing right here at this pod inside of it is running a container and it's inside that
container is our post application.
So at this point.
Quick question for you.
How do we actually make a request to that application somewhere hidden in all these crazy layers.
Is our original node server.
How do we actually make use of that thing.
Well that's we're gonna figure out in this video.
So we're going to be discussing services.
Remember a service is another kind of object in Cuban settings.
It's an object very similar to our.
A pod is an object or a deployment is an object.
We create services using config files just as we do.
Pods and deployments we are going to make use of services to set up some communication between all of
our different pods or to get access to a pod from the outside of our cluster.
So any time we need to have some communication or networking between our pods which is the case with
our event boss trying to send events over to our those images or the post pods or any time that we need
to somehow access a pod from outside of the cluster we are always going to be making use of a service.
So anytime we think of networking or communication in any way shape or form we are always thinking about
services just about every single pod that we ever create.
We're going to want to communicate with in some fashion.
So just about every pod or every deployment we create is always going to have some kind of matching
service along with it.
Behind the scenes there are actually several different kinds of services.
So let's go over these different types really quickly.
There are four different types of services that we need to be aware of but effectively there's only
two cluster HP and load balancer that we're going to be using on a very daily basis luster IP.
Services are used anytime that we want to set up communication between different pods inside of our
cluster node ports are used anytime they want to access a pod from outside of our cluster but we only
usually only use a node port for development purposes load balancers are the right way to access a pod
from outside the cluster.
You can think of a node port and load balancer as being very similar but the way that they actually
work are very different.
I'll be sure to tell you exactly how they're different over time so node port and load balancer are
both going to expose a port to the outside world.
We expose a pod to the outside world.
And then finally external name services.
I only put it in this diagram so that you are aware that this exists and it is another type of service
but it's not something that we are going to use.
It's a very advanced very kind of corner case thing that we're not really going to worry about so quick
question for you out of these three different types of services what would be the most appropriate type
of service to use if we want to setup some kind of communication between these different pods.
Well in this case we are trying to set up communication between pods inside of a cluster.
So that would be most appropriate for a cluster IP type service because it only exposes pods to other
pods inside the cluster.
So we would want this right here to be a cluster IP service about the other scenario scenario in which
we want to access a pod from the outside world like maybe a browser running are on our computer or a
browser running on some user's machine in this scenario.
We are trying to access a pod from the outside world so we could use either a node port or a load balancer
if we are in a development environment and we just want to do one little quick one off test or something
like that.
We would use a node port but in just about every other scenario we are going to use a load balancer
type service.
So in this case we would make this either a load balancer
and I'll say sorry about that.
We would all on here at the very end or possibly a node port so those are some the different types of
services that we're going to make use up.
Again we're going to be mostly focused on cluster IP and load balancer but we will sometimes make use
of no port.
So let's take a quick pause right here.
We're gonna come back the next video and we're gonna start to create our first service.