In this video we're going to go through setting up ingress and tonics on our Google Cloud cluster yet
again.
Now this is going to end up being really easy and straightforward.
So let's just get to it.
I'm going to first go to the official documentation for ingress engine X yet again I'll then go to a
deployment I'll then go down to the mandatory command to the mandatory command is this one right here.
I'm going to copy that command.
I'll go back over to my terminal I go in to make sure that I'm connected to the correct context.
So if you're still running Docker for Mac or Docker for Windows you'll want to open up that Cuban I.D.
menu and just make sure that you're connected to the GK.
Or Google Cuban settings engine context right there.
Well then go ahead and paste that command in and run it.
That'll take just a moment or two to create all the appropriate objects.
There we go.
Everything has been created.
Now if we go back over to the installation directions you'll notice that there is a little bit of additional
setup that we have to go through if we are using Google Cloud.
So I going to click on that Google Cloud link right there and you'll see that is telling us to run this
one additional command.
So I'm going to also copy that GC e.g. K E command go backwards to my console again and paste it.
There we go.
All right.
Well that's pretty much it for that setup we have now installed ingress engine X on our Google Cloud
cluster.
So now we need to update our host file again so that whenever we try to go to ticketing dot Dev rather
than having it loop back to our local machine we want to redirect it to that remote cluster so let me
just give you a quick reminder of what ingress engine X is really doing for us and what the step right
here really truly means.
So we took a look at this diagram a while ago you might recall that I told you that at some point time
we were going to deploy our cluster to some cloud providers such as eight of us Google Cloud or Microsoft
Asa.
So the commands that we just executed created two things for us.
It created first an ingress controller.
That's the thing that runs inside of our cluster that has some of our routing rules tied to it.
But it also created something else it created something a look called a load balancer.
This is tied directly to Google Cloud.
It's essentially a Google cloud thing that is running outside of our cluster entirely.
So whenever we want to connect to our cluster now we really want to attempt to connect to this load
balancer right here.
This is really relevant for when we go to update our host file because we need to at some point enter
an IP address inside there.
So when we go to our host file and we enter in the IP address we actually want to connect to whenever
we go to ticketing dot Dev we want to enter in the IP address of this load balancer to get the IP address
for that load balancer.
We're going to look it up on the Google cloud dashboard.
So again when we just ran those commands it created this load balancer for us.
Which means we should be able to go to the Google cloud load balancer page on this menu on the left
hand side.
And we should see that a load balancer was automatically created for us by our Cuban editors cluster
or more specifically by ingress engine X so going to scroll down on the left hand side and go to the
section called networking then inside of networking I'm going to find network services and go to load
balancing and then site up here.
We're going to see a load balancer that was created for us.
It's got a randomly generated name and it apparently is pointing to our back end server.
Now you might notice a little warning right here right now.
Something says two instances are unhealthy.
That's really okay.
We're gonna ignore that right now.
I'm going to click on that load balancer that was just created for us and it's then going to give us
the IP address that our load balancer exists set.
So again this is the IP address of the load balancer that was created for us by the ingress engine stuff.
So that is the IP address that we want to tell our hosts file to connect to any time we tried to go
to ticketing dot Dev.
Let's open up our host file right now in entering that IP.
I'm gonna copy that IP address.
I'll then go over to my terminal and open up my etsy post file yet again.
Of course if you're on Windows you'll want to make sure that you open up your host file on a Windows
machine.
Again that's some file inside the system 32 directory and then find ticketing dev and I'm going to update
the IP address.
Like so.
So now whenever you type in ticketing that dab into our browser we're going to actually connect to our
load balancer inside of Google Cloud.
So I gotta save this.
I get that permissions ever again.
So enter my password and I'm good to go.
All right.
So that is it.
Now in theory less than we have to do is restart scaffold when we restart scaffold it should reload
are off or I shouldn't really say reload.
It's gonna take our off deployment config file and deploy it to the Google cloud cluster.
It's also going to take our set of routing rules and apply them to that cluster as well.
Let's do that final test in the next video.