In last video I told you that we needed a load balancer service to somehow get traffic into all of our
different pods.
Now it turns out that this entire idea of a load balancer service is a little bit more intricate than
at first glance.
So this video I want to clarify some terminology that you're going to see online and as a matter of
fact we're gonna see very quickly around this load balancer service thing.
So when we talk about a load balancer service or as I've been mentioning it in the previous videos I'm
really talking about two distinct things in the world the Cuban eddies.
So first off there is something in Cuba that is called a load balancer service.
There is something that is also very closely related that is referred to as ingress or in ingress controller.
Now technically an ingress and egress controller are two different things but for the purposes of this
course we're going to kind of refer to them with interchangeable terms.
A lot of the stuff I'm about to show you is kind of a very high level overview and so I'm simplifying
some very specific parts of it to just make some parts a lot easier to understand because having a deep
understanding of the behind the scenes stuff is super not critical right now.
You really just need a taste of what is going on.
It doesn't make a lot of sense to dive into the deep end at the very start because it it's just way
too confusing.
All right.
So what is this stuff a load balancer service is going to be something that tells Cuban cities or specifically
are cluster to reach out to its provider.
We'll talk about what that isn't just a moment and provision a load balancer.
The goal of a load balancer service is to get traffic into a single pod.
On the other hand an ingress or ingress controller.
Again technically different things but we're going to use these terms interchangeably is a pod that
has a set of routing rules in it that are going to distribute traffic to other services inside of our
cluster now.
Just look at these definitions not super useful.
So let's take a look at a diagram or two.
We're going to first focus on what a load balancer service really is.
All right.
So in this diagram we've got our cluster here in the blue box.
We're going to imagine that we are running one singular pod right here called some pod our cluster at
some point in time.
Not right now on our local machine but at some point on the future is going to be running on some cloud
provider.
So maybe eight of us Google Cloud ASR or something similar.
We are going to want to somehow get traffic or network requests from the outside world to some pod inside
of our cluster.
So how do we do that using a load balancer.
Well we would create a config file for a load balancer service.
We would then be that thing into our cluster using that same QCT cell apply command now a load balancer
service is a very special little thing just about all the objects we've been discussing throughout this
last section on Cuba daddy so far has been all about stuff that gets created directly inside of our
cluster.
So we have created services inside the cluster ODS inside the cluster deployments inside the cluster
a load balancer service is a little bit different a load balancer service is going to tell our cluster
to reach out to the its cloud provider so reach out directly to a WSU cloud or Asa and provision something
called a load balancer this load balancer exists completely outside of our cluster it is a part of Google
cloud or a W us or asa this load balancer is going to be used to take traffic from the outside world
and direct it in to some pod inside of our cluster the goal of a load balancer or that really I should
say the goal of a load balancer service is to tell our cluster to reach out to its provider provisional
load balancer with the goal of getting some traffic into a pod on our cluster a load balancer by itself
is not super useful for you and I right now.
Instead what you and I really want to do is what we saw back in this diagram over here.
We want to get traffic distributed to a set of different pods and we want to have some routing rules
inside of something to decide where to send this traffic to one thing on a mention really quickly is
that our ReACT application doesn't really want to have to understand the difference between say the
query pod and the comments pod in the post pod.
We don't want to have to encode that information inside the react app instead of what would be great
is if we can just say make a request to this route and if there is something over here around our cluster
to figure out what pod that request should be forwarded to the load balancer just by itself is not really
doing the full thing for us.
That's not doing everything we need and that is where this idea of an ingress or ingress controller
is going to come into play so the ingress or ingress controller is a pod that has a set of routing rules
inside of it.
It's going to work alongside this load balancer service thing.
Let's take a look at a diagram to understand what this Ingress is really doing.
OK then this diagram very similar.
We've got our cluster right here in the blue box.
It's being hosted with some cloud provider and we want to get some outside traffic into these set of
different pods.
These are different pods so it might be say to post comments query whatever else.
So we are going to have a request coming in still to a load balancer that has been provisioned with
our cloud provider but now this load balancer is going to send that request on to this ingress controller
thing and it's ingress controllers going to have a set of routing rules inside of it.
This route when I use the term routing rules by the way I'm really just saying this ingress controller
is going to look at the path of the incoming request and then decide based upon that path whether to
send the request on to that pod or that pod or that pod or whatever else.
And naturally when I say send the request onto some pod I'm really meaning to say send it to some cluster
IP service that is sending request on to the pod.
So I'm not showing the cluster IP services in here.
They technically do exist but for the purposes of this diagram I'm just saying we're going to send traffic
on to the pod so that is the relationship between this load balancer thing and this ingress controller
thing.
The load balancer is just about getting traffic into our cluster.
This ingress thing is about routing rules or having some routing configuration that's going to send
requests off to the appropriate pod.
Now once you repeat once again that I am simplifying some aspects of this just to make this a little
bit easier to understand in the first go round.
If we went at full depth tried to really understand all the behind the scenes stuff it would take a
lot of time and just not be a very efficient use of time so effectively this is good enough for what
we need to do.
All right.
So we can take a quick pause right here.
When we come back the next video we're going to take a look at a very specific implementation of an
ingress controller that we're going to use inside of our app and we'll start to implement this thing
inside of our cluster.