We just put together our first ingress config file but inside of here was a kind of mysterious rule
that said host of post icon.
Let me tell you a little bit more about what is going on inside of here so when we make use of Cuban
eddies we can absolutely just host one single application at one single domain.
But with Cuban eddies Well we can host a ton of infrastructure.
We're not necessarily limited to just hosting one singular application.
So in other words we could host many different apps at many different domains inside of a single Cuban
cities cluster.
We could have some app tied to my outcome.
Another totally different app at post tracker AECOM and yet another at blog app dot com.
The infrastructure for all these different applications that these different domains can be hosted inside
of one single Cuban cities cluster ingress engine X is setup assuming that you might be hosting many
different apps at different domains.
So that's what this host property right here is all about.
We are saying that the config that we're about to write in this little section right here is all tied
to an app posted at post dot com.
Now there's kind of a good side and bad side to this the bad side is that in the development environment
we are used to accessing all of our different running servers at local host.
So how does this kind of routing rule or this idea of having some specific domain really stack up with
ingress engine x.
Well in a development environment what we have to do is trick our local machine into thinking that post
dot com is equivalent to local host.
So in other words whenever we tried to connect to post dot com we're going to trick our computer to
connecting to our local machine rather than the real post dot com that I'm sure exists out there somewhere
online.
To trick our local machine into connecting to local host whenever we go to post dot com we're going
to make a little configuration change on your computer to your host file your host file which is available
on Windows and Mac OS or Linux is where we can set up a series of additional little routing rules and
we can say anytime they tried to go to post dot com instead just connect to our local machine.
Again this is going to somehow trick or make ingress engine X think that we are coming to it from post
dot com and it's going to apply all the routing rules that are shown in this section right here.
Long story short we just tapped out in one line of config to this file different file location depending
upon your operating system.
That's the long and short of it.
So let's get to it now naturally I'm on MAKO s so I'm going to open up my etsy slash hosts file.
That is not a directory that's a file inside my code.
Ed if you're on Windows you will open up that file instead it's going to do that right now.
And here's my host file.
Yours will probably look very similar to this.
Maybe I'll have a couple extra lines in here at the very bottom of this file.
I'm going to add in 1 2 7 0 0 1 and then post scum.
Notice there is a space in between.
Very important if you are on many cube if you're making use a mini cube you are not going to write in
1 2 7 0 0 1 right here.
Instead you will write in whatever the result of many cube IP is.
So if you're on many cube or making use of it run this command take the IP that gets printed up right
there and put it right there instead of 1 2 7 0 0 1.
So now whenever we tried to connect to post dot com your operating system is going to say oh rather
than going to the real post dot com somewhere out on the Internet I'm going to instead connect to the
local machine me right here at 1 2 7 0 0 1 OK.
After making that change I can save the file.
Chances are you're going to see some kind of permission warning if you're on Windows you're probably
going to need to open up your code editor again in administration mode if you're on Mac OS you can make
use of visual studio code you can just hit that little button right there.
Putting your password.
Andrew good to go.
File saved OK.
So now inside of our browser or postman whatever else if we go to post dot com we are going to be actually
make a request to 1 2 7 0 0 1.
That request is going to go into ingress serve it's going ingress engine X is going to think that we
are trying to visit post dot com.
And so it's going to apply the routing rules you see right here.
All right so let's go back over to our browser and we're going to test this out inside of a new browser
tab we are going to navigate to post dot com slash posts that should.
Behind the scenes make a request to our post cluster I.P. service which actually makes requests to our
post pod and you and I know if by going into our post indexed such as file if we make a get request
to slash posts that should send us back all the different posts we have created inside the service.
So let's try navigating to that right now.
And there we go.
I've got my list of posts yay this is great.
We've now got our list of posts right here.
We are able to access some pod and most importantly we didn't have to reach out directly to this part
in the words I didn't have to type in some you l that says go to my post pod instead I put in just a
very normal your l and behind the scenes ingress engine X is going to take this request and route it
off to the appropriate service and that service in turn is going to read it off to the appropriate pod.
So hopefully everything's working for you.
There's definitely many locations throughout all this stuff where things can go wrong if you're running
into trouble.
Remember try doing a little bit troubleshooting on your own.
Google is a great tool great friend to have around.
But if you still can't get it always feel free to hop over to the Q A Discussion Board and I'll do my
best to help you out.
But do remember if you have a problem I really need to see your code.
So do toss your code on it hub first Well we've now proven that we can get access to a pod.
So now we have to go back through all of our different services whereas our diagram here we go.
We need to go back through all of our different services all these different pods.
We need to add in some routing rules to that ingress engine next config file.
And we also need to make sure that at some point time we also create a deployment for a react app as
well.
But still just a little bit left but we are definitely almost at the end here.
It's a quick pause and we'll continue in just a minute.